From 979f3bf82b1b668a20fb35c5ec1f2072da172dbe Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 5 Feb 2026 03:14:42 +0000 Subject: [PATCH 1/3] chore: Updating the year of the copyright PiperOrigin-RevId: 865609999 Source-Link: https://github.com/googleapis/googleapis/commit/df993ddf3d3e3907f21dcff0132f309bc9d21a5e Source-Link: https://github.com/googleapis/googleapis-gen/commit/37f219fad7c877df2808b284c9b618944b637200 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXN1cHBvcnQvLk93bEJvdC55YW1sIiwiaCI6IjM3ZjIxOWZhZDdjODc3ZGYyODA4YjI4NGM5YjYxODk0NGI2MzcyMDAifQ== --- .../google-cloud-support/.eslintignore | 7 + .../google-cloud-support/.eslintrc.json | 3 + .../google-cloud-support/.gitattributes | 4 + .../google-cloud-support/.gitignore | 14 + .../google-cloud-support/.jsdoc.js | 55 + .../google-cloud-support/.mocharc.js | 33 + owl-bot-staging/google-cloud-support/.nycrc | 24 + .../google-cloud-support/.prettierignore | 6 + .../google-cloud-support/.prettierrc.js | 22 + .../google-cloud-support/CODE_OF_CONDUCT.md | 94 + .../google-cloud-support/CONTRIBUTING.md | 76 + owl-bot-staging/google-cloud-support/LICENSE | 202 + .../google-cloud-support/README.md | 140 + .../google/cloud/support/v2/actor.proto | 56 + .../google/cloud/support/v2/attachment.proto | 69 + .../cloud/support/v2/attachment_service.proto | 86 + .../protos/google/cloud/support/v2/case.proto | 197 + .../cloud/support/v2/case_service.proto | 351 + .../google/cloud/support/v2/comment.proto | 69 + .../cloud/support/v2/comment_service.proto | 107 + .../google/cloud/support/v2/escalation.proto | 53 + .../google/cloud/support/v2beta/actor.proto | 56 + .../cloud/support/v2beta/attachment.proto | 69 + .../support/v2beta/attachment_service.proto | 105 + .../google/cloud/support/v2beta/case.proto | 218 + .../cloud/support/v2beta/case_service.proto | 360 + .../google/cloud/support/v2beta/comment.proto | 69 + .../support/v2beta/comment_service.proto | 126 + .../google/cloud/support/v2beta/content.proto | 31 + .../cloud/support/v2beta/email_message.proto | 68 + .../cloud/support/v2beta/escalation.proto | 53 + .../cloud/support/v2beta/feed_item.proto | 56 + .../cloud/support/v2beta/feed_service.proto | 88 + .../google-cloud-support/protos/protos.d.ts | 13074 ++++++ .../google-cloud-support/protos/protos.js | 33942 ++++++++++++++++ .../google-cloud-support/protos/protos.json | 3752 ++ ...ase_attachment_service.list_attachments.js | 77 + .../generated/v2/case_service.close_case.js | 61 + .../generated/v2/case_service.create_case.js | 66 + .../v2/case_service.escalate_case.js | 65 + .../generated/v2/case_service.get_case.js | 61 + .../generated/v2/case_service.list_cases.js | 89 + ...ase_service.search_case_classifications.js | 73 + .../generated/v2/case_service.search_cases.js | 100 + .../generated/v2/case_service.update_case.js | 71 + .../v2/comment_service.create_comment.js | 66 + .../v2/comment_service.list_comments.js | 72 + ...ppet_metadata_google.cloud.support.v2.json | 519 + .../case_attachment_service.get_attachment.js | 61 + ...ase_attachment_service.list_attachments.js | 77 + .../v2beta/case_service.close_case.js | 61 + .../v2beta/case_service.create_case.js | 66 + .../v2beta/case_service.escalate_case.js | 65 + .../generated/v2beta/case_service.get_case.js | 61 + .../v2beta/case_service.list_cases.js | 94 + ...ase_service.search_case_classifications.js | 77 + .../v2beta/case_service.search_cases.js | 100 + .../v2beta/case_service.update_case.js | 71 + .../v2beta/comment_service.create_comment.js | 66 + .../v2beta/comment_service.get_comment.js | 61 + .../v2beta/comment_service.list_comments.js | 72 + .../v2beta/feed_service.show_feed.js | 81 + ..._metadata_google.cloud.support.v2beta.json | 659 + .../google-cloud-support/src/index.ts | 32 + .../src/v2/case_attachment_service_client.ts | 858 + ...case_attachment_service_client_config.json | 43 + .../case_attachment_service_proto_list.json | 10 + .../src/v2/case_service_client.ts | 1917 + .../src/v2/case_service_client_config.json | 78 + .../src/v2/case_service_proto_list.json | 10 + .../src/v2/comment_service_client.ts | 935 + .../src/v2/comment_service_client_config.json | 48 + .../src/v2/comment_service_proto_list.json | 10 + .../src/v2/gapic_metadata.json | 181 + .../google-cloud-support/src/v2/index.ts | 21 + .../v2beta/case_attachment_service_client.ts | 1056 + ...case_attachment_service_client_config.json | 47 + .../case_attachment_service_proto_list.json | 14 + .../src/v2beta/case_service_client.ts | 2036 + .../v2beta/case_service_client_config.json | 78 + .../src/v2beta/case_service_proto_list.json | 14 + .../src/v2beta/comment_service_client.ts | 1133 + .../v2beta/comment_service_client_config.json | 52 + .../v2beta/comment_service_proto_list.json | 14 + .../src/v2beta/feed_service_client.ts | 966 + .../v2beta/feed_service_client_config.json | 43 + .../src/v2beta/feed_service_proto_list.json | 14 + .../src/v2beta/gapic_metadata.json | 229 + .../google-cloud-support/src/v2beta/index.ts | 22 + .../system-test/fixtures/sample/src/index.js | 29 + .../system-test/fixtures/sample/src/index.ts | 44 + .../system-test/install.ts | 49 + .../test/gapic_case_attachment_service_v2.ts | 769 + .../gapic_case_attachment_service_v2beta.ts | 969 + .../test/gapic_case_service_v2.ts | 1763 + .../test/gapic_case_service_v2beta.ts | 1855 + .../test/gapic_comment_service_v2.ts | 877 + .../test/gapic_comment_service_v2beta.ts | 1077 + .../test/gapic_feed_service_v2beta.ts | 861 + .../google-cloud-support/tsconfig.json | 22 + .../google-cloud-support/webpack.config.js | 64 + 101 files changed, 74967 insertions(+) create mode 100644 owl-bot-staging/google-cloud-support/.eslintignore create mode 100644 owl-bot-staging/google-cloud-support/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-support/.gitattributes create mode 100644 owl-bot-staging/google-cloud-support/.gitignore create mode 100644 owl-bot-staging/google-cloud-support/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-support/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-support/.nycrc create mode 100644 owl-bot-staging/google-cloud-support/.prettierignore create mode 100644 owl-bot-staging/google-cloud-support/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-support/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/google-cloud-support/CONTRIBUTING.md create mode 100644 owl-bot-staging/google-cloud-support/LICENSE create mode 100644 owl-bot-staging/google-cloud-support/README.md create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/actor.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case_service.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/escalation.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/content.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto create mode 100644 owl-bot-staging/google-cloud-support/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-support/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-support/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.close_case.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.create_case.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.escalate_case.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.get_case.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.list_cases.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_cases.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.update_case.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.create_comment.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.list_comments.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/snippet_metadata_google.cloud.support.v2.json create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.get_attachment.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.list_attachments.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.close_case.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.create_case.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.escalate_case.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.get_case.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.list_cases.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_case_classifications.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_cases.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.update_case.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.create_comment.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.get_comment.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.list_comments.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/feed_service.show_feed.js create mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/snippet_metadata_google.cloud.support.v2beta.json create mode 100644 owl-bot-staging/google-cloud-support/src/index.ts create mode 100644 owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client.ts create mode 100644 owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2/case_service_client.ts create mode 100644 owl-bot-staging/google-cloud-support/src/v2/case_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2/case_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2/comment_service_client.ts create mode 100644 owl-bot-staging/google-cloud-support/src/v2/comment_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2/comment_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2/index.ts create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client.ts create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/case_service_client.ts create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/case_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/case_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client.ts create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/comment_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client.ts create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/feed_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/index.ts create mode 100644 owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-support/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2.ts create mode 100644 owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2beta.ts create mode 100644 owl-bot-staging/google-cloud-support/test/gapic_case_service_v2.ts create mode 100644 owl-bot-staging/google-cloud-support/test/gapic_case_service_v2beta.ts create mode 100644 owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2.ts create mode 100644 owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2beta.ts create mode 100644 owl-bot-staging/google-cloud-support/test/gapic_feed_service_v2beta.ts create mode 100644 owl-bot-staging/google-cloud-support/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-support/webpack.config.js diff --git a/owl-bot-staging/google-cloud-support/.eslintignore b/owl-bot-staging/google-cloud-support/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-support/.eslintrc.json b/owl-bot-staging/google-cloud-support/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-support/.gitattributes b/owl-bot-staging/google-cloud-support/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.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-support/.gitignore b/owl-bot-staging/google-cloud-support/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.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-support/.jsdoc.js b/owl-bot-staging/google-cloud-support/.jsdoc.js new file mode 100644 index 00000000000..86a15a2c062 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.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/support', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-support/.mocharc.js b/owl-bot-staging/google-cloud-support/.mocharc.js new file mode 100644 index 00000000000..5eb34e86c87 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.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-support/.nycrc b/owl-bot-staging/google-cloud-support/.nycrc new file mode 100644 index 00000000000..81a95fc94b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.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-support/.prettierignore b/owl-bot-staging/google-cloud-support/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/google-cloud-support/.prettierrc.js b/owl-bot-staging/google-cloud-support/.prettierrc.js new file mode 100644 index 00000000000..7649ee3c254 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.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-support/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-support/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/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-support/CONTRIBUTING.md b/owl-bot-staging/google-cloud-support/CONTRIBUTING.md new file mode 100644 index 00000000000..e4e064c8af9 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/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 Support 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=cloudsupport.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-support/LICENSE b/owl-bot-staging/google-cloud-support/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/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-support/README.md b/owl-bot-staging/google-cloud-support/README.md new file mode 100644 index 00000000000..6ddbe43a7fb --- /dev/null +++ b/owl-bot-staging/google-cloud-support/README.md @@ -0,0 +1,140 @@ +[//]: # "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 + +# [Google Cloud Support API: Nodejs Client][homepage] + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority + +[![npm version](https://img.shields.io/npm/v/@google-cloud/support.svg)](https://www.npmjs.org/package/@google-cloud/support) + +Google Cloud Support API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Google Cloud Support API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/support/latest) +* [Google Cloud Support API Documentation](https://cloud.google.com/support/docs/reference/support-api) + +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 Google Cloud Support 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/support +``` + +[//]: # "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 | +| --------------------------- | --------------------------------- | +| list attachments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js) | +| close case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.close_case.js) | +| create case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.create_case.js) | +| escalate case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.escalate_case.js) | +| get case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.get_case.js) | +| list cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.list_cases.js) | +| search case classifications | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js) | +| search cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.search_cases.js) | +| update case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.update_case.js) | +| create comment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/comment_service.create_comment.js) | +| list comments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/comment_service.list_comments.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/snippet_metadata_google.cloud.support.v2.json) | +| get attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_attachment_service.get_attachment.js) | +| list attachments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_attachment_service.list_attachments.js) | +| close case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.close_case.js) | +| create case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.create_case.js) | +| escalate case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.escalate_case.js) | +| get case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.get_case.js) | +| list cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.list_cases.js) | +| search case classifications | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.search_case_classifications.js) | +| search cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.search_cases.js) | +| update case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.update_case.js) | +| create comment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/comment_service.create_comment.js) | +| get comment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/comment_service.get_comment.js) | +| list comments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/comment_service.list_comments.js) | +| show feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/feed_service.show_feed.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/snippet_metadata_google.cloud.support.v2beta.json) | + + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/support@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-support/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-support/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=cloudsupport.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-support/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/actor.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/actor.proto new file mode 100644 index 00000000000..3dfb5de103e --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/actor.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.support.v2; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "ActorProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// An Actor represents an entity that performed an action. For example, an actor +// could be a user who posted a comment on a support case, a user who +// uploaded an attachment, or a service account that created a support case. +message Actor { + // The name to display for the actor. If not provided, it is inferred from + // credentials supplied during case creation. When an email is provided, a + // display name must also be provided. This will be obfuscated if the user + // is a Google Support agent. + string display_name = 1; + + // The email address of the actor. If not provided, it is inferred from the + // credentials supplied during case creation. When a name is provided, an + // email must also be provided. If the user is a Google Support agent, this is + // obfuscated. + // + // This field is deprecated. Use `username` instead. + string email = 2 [deprecated = true]; + + // Output only. Whether the actor is a Google support actor. + bool google_support = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The username of the actor. It may look like an email or other + // format provided by the identity provider. If not provided, it is inferred + // from the credentials supplied. When a name is provided, a username must + // also be provided. If the user is a Google Support agent, this will not be + // set. + string username = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment.proto new file mode 100644 index 00000000000..9039620b314 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment.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.support.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2/actor.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "AttachmentProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// An Attachment contains metadata about a file that was uploaded to a +// case - it is NOT a file itself. That being said, the name of an Attachment +// object can be used to download its accompanying file through the +// `media.download` endpoint. +// +// While attachments can be uploaded in the console at the +// same time as a comment, they're associated on a "case" level, not a +// "comment" level. +message Attachment { + option (google.api.resource) = { + type: "cloudsupport.googleapis.com/Attachment" + pattern: "organizations/{organization}/cases/{case}/attachments/{attachment_id}" + pattern: "projects/{project}/cases/{case}/attachments/{attachment_id}" + }; + + // Output only. Identifier. The resource name of the attachment. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. The time at which the attachment was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user who uploaded the attachment. Note, the name and email + // will be obfuscated if the attachment was uploaded by Google support. + Actor creator = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The filename of the attachment (e.g. `"graph.jpg"`). + string filename = 4; + + // Output only. The MIME type of the attachment (e.g. text/plain). + string mime_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The size of the attachment in bytes. + int64 size_bytes = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto new file mode 100644 index 00000000000..5c63b8dc101 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto @@ -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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2/attachment.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "AttachmentServiceProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// A service to manage file attachments for Google Cloud support cases. +service CaseAttachmentService { + option (google.api.default_host) = "cloudsupport.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // List all the attachments associated with a support case. + rpc ListAttachments(ListAttachmentsRequest) + returns (ListAttachmentsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/cases/*}/attachments" + additional_bindings { + get: "/v2/{parent=organizations/*/cases/*}/attachments" + } + }; + option (google.api.method_signature) = "parent"; + } +} + +// The request message for the ListAttachments endpoint. +message ListAttachmentsRequest { + // Required. The name of the case for which attachments should be listed. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // The maximum number of attachments fetched with each request. + // + // If not provided, the default is 10. The maximum page size that will be + // returned is 100. + // + // The size of each page can be smaller than the requested page size and can + // include zero. For example, you could request 100 attachments on one page, + // receive 0, and then on the next page, receive 90. + int32 page_size = 2; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 3; +} + +// The response message for the ListAttachments endpoint. +message ListAttachmentsResponse { + // The list of attachments associated with a case. + repeated Attachment attachments = 1; + + // A token to retrieve the next page of results. Set this in the `page_token` + // field of subsequent `cases.attachments.list` requests. If unspecified, + // there are no more results to retrieve. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case.proto new file mode 100644 index 00000000000..b14160b4c90 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case.proto @@ -0,0 +1,197 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2/actor.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "CaseProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// A Case is an object that contains the details of a support case. It +// contains fields for the time it was created, its priority, its +// classification, and more. Cases can also have comments and attachments that +// get added over time. +// +// A case is parented by a Google Cloud organization or project. +// +// Organizations are identified by a number, so the name of a case parented by +// an organization would look like this: +// +// ``` +// organizations/123/cases/456 +// ``` +// +// Projects have two unique identifiers, an ID and a number, and they look like +// this: +// +// ``` +// projects/abc/cases/456 +// ``` +// +// ``` +// projects/123/cases/456 +// ``` +// +// You can use either of them when calling the API. To learn more +// about project identifiers, see [AIP-2510](https://google.aip.dev/cloud/2510). +message Case { + option (google.api.resource) = { + type: "cloudsupport.googleapis.com/Case" + pattern: "organizations/{organization}/cases/{case}" + pattern: "projects/{project}/cases/{case}" + }; + + // The status of a support case. + enum State { + // Case is in an unknown state. + STATE_UNSPECIFIED = 0; + + // The case has been created but no one is assigned to work on it yet. + NEW = 1; + + // The case is currently being handled by Google support. + IN_PROGRESS_GOOGLE_SUPPORT = 2; + + // Google is waiting for a response. + ACTION_REQUIRED = 3; + + // A solution has been offered for the case, but it isn't yet closed. + SOLUTION_PROVIDED = 4; + + // The case has been resolved. + CLOSED = 5; + } + + // The case Priority. P0 is most urgent and P4 the least. + enum Priority { + // Priority is undefined or has not been set yet. + PRIORITY_UNSPECIFIED = 0; + + // Extreme impact on a production service. Service is hard down. + P0 = 1; + + // Critical impact on a production service. Service is currently unusable. + P1 = 2; + + // Severe impact on a production service. Service is usable but greatly + // impaired. + P2 = 3; + + // Medium impact on a production service. Service is available, but + // moderately impaired. + P3 = 4; + + // General questions or minor issues. Production service is fully + // available. + P4 = 5; + } + + // Identifier. The resource name for the case. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The short summary of the issue reported in this case. + string display_name = 2; + + // A broad description of the issue. + string description = 3; + + // The issue classification applicable to this case. + CaseClassification classification = 4; + + // The timezone of the user who created the support case. + // It should be in a format IANA recognizes: https://www.iana.org/time-zones. + // There is no additional validation done by the API. + string time_zone = 8; + + // The email addresses to receive updates on this case. + repeated string subscriber_email_addresses = 9; + + // Output only. The current status of the support case. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time this case was created. + google.protobuf.Timestamp create_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time this case was last updated. + google.protobuf.Timestamp update_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The user who created the case. + // + // Note: The name and email will be obfuscated if the case was created by + // Google Support. + Actor creator = 15; + + // A user-supplied email address to send case update notifications for. This + // should only be used in BYOID flows, where we cannot infer the user's email + // address directly from their EUCs. + string contact_email = 35; + + // Whether the case is currently escalated. + bool escalated = 17; + + // Whether this case was created for internal API testing and should not be + // acted on by the support team. + bool test_case = 19; + + // The language the user has requested to receive support in. This should be a + // BCP 47 language code (e.g., `"en"`, `"zh-CN"`, `"zh-TW"`, `"ja"`, `"ko"`). + // If no language or an unsupported language is specified, this field defaults + // to English (en). + // + // Language selection during case creation may affect your available support + // options. For a list of supported languages and their support working hours, + // see: https://cloud.google.com/support/docs/language-working-hours + string language_code = 23; + + // The priority of this case. + Priority priority = 32; +} + +// A Case Classification represents the topic that a case is about. It's very +// important to use accurate classifications, because they're +// used to route your cases to specialists who can help you. +// +// A classification always has an ID that is its unique identifier. +// A valid ID is required when creating a case. +message CaseClassification { + // The unique ID for a classification. Must be specified for case creation. + // + // To retrieve valid classification IDs for case creation, use + // `caseClassifications.search`. + // + // Classification IDs returned by `caseClassifications.search` are guaranteed + // to be valid for at least 6 months. If a given classification is + // deactiveated, it will immediately stop being returned. After 6 months, + // `case.create` requests using the classification ID will fail. + string id = 3; + + // A display name for the classification. + // + // The display name is not static and can change. To uniquely and consistently + // identify classifications, use the `CaseClassification.id` field. + string display_name = 4; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case_service.proto new file mode 100644 index 00000000000..4030bc1cafe --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case_service.proto @@ -0,0 +1,351 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2/case.proto"; +import "google/cloud/support/v2/escalation.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "CaseServiceProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// A service to manage Google Cloud support cases. +service CaseService { + option (google.api.default_host) = "cloudsupport.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieve a case. + rpc GetCase(GetCaseRequest) returns (Case) { + option (google.api.http) = { + get: "/v2/{name=projects/*/cases/*}" + additional_bindings { get: "/v2/{name=organizations/*/cases/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Retrieve all cases under a parent, but not its children. + // + // For example, listing cases under an organization only returns the cases + // that are directly parented by that organization. To retrieve cases + // under an organization and its projects, use `cases.search`. + rpc ListCases(ListCasesRequest) returns (ListCasesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/cases" + additional_bindings { get: "/v2/{parent=organizations/*}/cases" } + }; + option (google.api.method_signature) = "parent"; + } + + // Search for cases using a query. + rpc SearchCases(SearchCasesRequest) returns (SearchCasesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/cases:search" + additional_bindings { get: "/v2/{parent=organizations/*}/cases:search" } + }; + } + + // Create a new case and associate it with a parent. + // + // It must have the following fields set: `display_name`, `description`, + // `classification`, and `priority`. If you're just testing the API and don't + // want to route your case to an agent, set `testCase=true`. + rpc CreateCase(CreateCaseRequest) returns (Case) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/cases" + body: "case" + additional_bindings { + post: "/v2/{parent=organizations/*}/cases" + body: "case" + } + }; + option (google.api.method_signature) = "parent,case"; + } + + // Update a case. Only some fields can be updated. + rpc UpdateCase(UpdateCaseRequest) returns (Case) { + option (google.api.http) = { + patch: "/v2/{case.name=projects/*/cases/*}" + body: "case" + additional_bindings { + patch: "/v2/{case.name=organizations/*/cases/*}" + body: "case" + } + }; + option (google.api.method_signature) = "case,update_mask"; + } + + // Escalate a case, starting the Google Cloud Support escalation management + // process. + // + // This operation is only available for some support services. Go to + // https://cloud.google.com/support and look for 'Technical support + // escalations' in the feature list to find out which ones let you + // do that. + rpc EscalateCase(EscalateCaseRequest) returns (Case) { + option (google.api.http) = { + post: "/v2/{name=projects/*/cases/*}:escalate" + body: "*" + additional_bindings { + post: "/v2/{name=organizations/*/cases/*}:escalate" + body: "*" + } + }; + } + + // Close a case. + rpc CloseCase(CloseCaseRequest) returns (Case) { + option (google.api.http) = { + post: "/v2/{name=projects/*/cases/*}:close" + body: "*" + additional_bindings { + post: "/v2/{name=organizations/*/cases/*}:close" + body: "*" + } + }; + } + + // Retrieve valid classifications to use when creating a support case. + // + // Classifications are hierarchical. Each classification is a string + // containing all levels of the hierarchy separated by `" > "`. For example, + // `"Technical Issue > Compute > Compute Engine"`. + // + // Classification IDs returned by this endpoint are valid for at least six + // months. When a classification is deactivated, this endpoint immediately + // stops returning it. After six months, `case.create` requests using the + // classification will fail. + rpc SearchCaseClassifications(SearchCaseClassificationsRequest) + returns (SearchCaseClassificationsResponse) { + option (google.api.http) = { + get: "/v2/caseClassifications:search" + }; + } +} + +// The request message for the GetCase endpoint. +message GetCaseRequest { + // Required. The full name of a case to be retrieved. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; +} + +// The request message for the CreateCase endpoint. +message CreateCaseRequest { + // Required. The name of the parent under which the case should be created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudsupport.googleapis.com/Case" + } + ]; + + // Required. The case to be created. + Case case = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for the ListCases endpoint. +message ListCasesRequest { + // Required. The name of a parent to list cases under. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudsupport.googleapis.com/Case" + } + ]; + + // An expression used to filter cases. + // + // If it's an empty string, then no filtering happens. Otherwise, the endpoint + // returns the cases that match the filter. + // + // Expressions use the following fields separated by `AND` and specified with + // `=`: + // + // - `state`: Can be `OPEN` or `CLOSED`. + // - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + // can specify multiple values for priority using the `OR` operator. For + // example, `priority=P1 OR priority=P2`. + // - `creator.email`: The email address of the case creator. + // + // EXAMPLES: + // + // - `state=CLOSED` + // - `state=OPEN AND creator.email="tester@example.com"` + // - `state=OPEN AND (priority=P0 OR priority=P1)` + string filter = 2; + + // The maximum number of cases fetched with each request. Defaults to 10. + int32 page_size = 4; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 5; +} + +// The response message for the ListCases endpoint. +message ListCasesResponse { + // The list of cases associated with the parent after any + // filters have been applied. + repeated Case cases = 1; + + // A token to retrieve the next page of results. Set this in the `page_token` + // field of subsequent `cases.list` requests. If unspecified, there are no + // more results to retrieve. + string next_page_token = 2; +} + +// The request message for the SearchCases endpoint. +message SearchCasesRequest { + // The name of the parent resource to search for cases under. + string parent = 4; + + // An expression used to filter cases. + // + // Expressions use the following fields separated by `AND` and specified with + // `=`: + // + // - `organization`: An organization name in the form + // `organizations/`. + // - `project`: A project name in the form `projects/`. + // - `state`: Can be `OPEN` or `CLOSED`. + // - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + // can specify multiple values for priority using the `OR` operator. For + // example, `priority=P1 OR priority=P2`. + // - `creator.email`: The email address of the case creator. + // + // You must specify either `organization` or `project`. + // + // To search across `displayName`, `description`, and comments, use a global + // restriction with no keyword or operator. For example, `"my search"`. + // + // To search only cases updated after a certain date, use `update_time` + // restricted with that particular date, time, and timezone in ISO datetime + // format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + // `update_time` only supports the greater than operator (`>`). + // + // Examples: + // + // - `organization="organizations/123456789"` + // - `project="projects/my-project-id"` + // - `project="projects/123456789"` + // - `organization="organizations/123456789" AND state=CLOSED` + // - `project="projects/my-project-id" AND creator.email="tester@example.com"` + // - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + string query = 1; + + // The maximum number of cases fetched with each request. The default page + // size is 10. + int32 page_size = 2; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 3; +} + +// The response message for the SearchCases endpoint. +message SearchCasesResponse { + // The list of cases associated with the parent after any + // filters have been applied. + repeated Case cases = 1; + + // A token to retrieve the next page of results. Set this in the + // `page_token` field of subsequent `cases.search` requests. If unspecified, + // there are no more results to retrieve. + string next_page_token = 2; +} + +// The request message for the EscalateCase endpoint. +message EscalateCaseRequest { + // Required. The name of the case to be escalated. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // The escalation information to be sent with the escalation request. + Escalation escalation = 2; +} + +// The request message for the UpdateCase endpoint +message UpdateCaseRequest { + // Required. The case to update. + Case case = 1 [(google.api.field_behavior) = REQUIRED]; + + // A list of attributes of the case that should be updated. Supported values + // are `priority`, `display_name`, and `subscriber_email_addresses`. If no + // fields are specified, all supported fields are updated. + // + // Be careful - if you do not provide a field mask, then you might + // accidentally clear some fields. For example, if you leave the field mask + // empty and do not provide a value for `subscriber_email_addresses`, then + // `subscriber_email_addresses` is updated to empty. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the CloseCase endpoint. +message CloseCaseRequest { + // Required. The name of the case to close. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; +} + +// The request message for the SearchCaseClassifications endpoint. +message SearchCaseClassificationsRequest { + // An expression used to filter case classifications. + // + // If it's an empty string, then no filtering happens. Otherwise, case + // classifications will be returned that match the filter. + string query = 1; + + // The maximum number of classifications fetched with each request. + int32 page_size = 2; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 3; +} + +// The response message for SearchCaseClassifications endpoint. +message SearchCaseClassificationsResponse { + // The classifications retrieved. + repeated CaseClassification case_classifications = 1; + + // A token to retrieve the next page of results. Set this in the `page_token` + // field of subsequent `caseClassifications.list` requests. If unspecified, + // there are no more results to retrieve. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment.proto new file mode 100644 index 00000000000..85c6f6076c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment.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.support.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2/actor.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "CommentProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// A comment associated with a support case. +// +// Case comments are the primary way for Google Support to communicate with a +// user who has opened a case. When a user responds to Google Support, the +// user's responses also appear as comments. +message Comment { + option (google.api.resource) = { + type: "cloudsupport.googleapis.com/Comment" + pattern: "organizations/{organization}/cases/{case}/comments/{comment}" + pattern: "projects/{project}/cases/{case}/comments/{comment}" + }; + + // Output only. Identifier. The resource name of the comment. + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The time when the comment was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user or Google Support agent who created the comment. + Actor creator = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The full comment body. + // + // Maximum of 12800 characters. + string body = 4; + + // Output only. DEPRECATED. DO NOT USE. + // + // A duplicate of the `body` field. + // + // This field is only present for legacy reasons. + string plain_text_body = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto new file mode 100644 index 00000000000..6321b52b620 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto @@ -0,0 +1,107 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2/comment.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "CommentServiceProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// A service to manage comments on cases. +service CommentService { + option (google.api.default_host) = "cloudsupport.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // List all the comments associated with a case. + rpc ListComments(ListCommentsRequest) returns (ListCommentsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/cases/*}/comments" + additional_bindings { + get: "/v2/{parent=organizations/*/cases/*}/comments" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Add a new comment to a case. + // + // The comment must have the following fields set: `body`. + rpc CreateComment(CreateCommentRequest) returns (Comment) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/cases/*}/comments" + body: "comment" + additional_bindings { + post: "/v2/{parent=organizations/*/cases/*}/comments" + body: "comment" + } + }; + option (google.api.method_signature) = "parent,comment"; + } +} + +// The request message for the ListComments endpoint. +message ListCommentsRequest { + // Required. The name of the case for which to list comments. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // The maximum number of comments to fetch. Defaults to 10. + int32 page_size = 4; + + // A token identifying the page of results to return. If unspecified, the + // first page is returned. + string page_token = 5; +} + +// The response message for the ListComments endpoint. +message ListCommentsResponse { + // List of the comments associated with the case. + repeated Comment comments = 1; + + // A token to retrieve the next page of results. Set this in the `page_token` + // field of subsequent `cases.comments.list` requests. If unspecified, there + // are no more results to retrieve. + string next_page_token = 2; +} + +// The request message for the CreateComment endpoint. +message CreateCommentRequest { + // Required. The name of the case to which the comment should be added. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // Required. The comment to be added. + Comment comment = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/escalation.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/escalation.proto new file mode 100644 index 00000000000..ffc79d9e11f --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/escalation.proto @@ -0,0 +1,53 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "EscalationProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// An escalation of a support case. +message Escalation { + // An enum detailing the possible reasons a case may be escalated. + enum Reason { + // The escalation reason is in an unknown state or has not been specified. + REASON_UNSPECIFIED = 0; + + // The case is taking too long to resolve. + RESOLUTION_TIME = 1; + + // The support agent does not have the expertise required to successfully + // resolve the issue. + TECHNICAL_EXPERTISE = 2; + + // The issue is having a significant business impact. + BUSINESS_IMPACT = 3; + } + + // Required. The reason why the Case is being escalated. + Reason reason = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. A free text description to accompany the `reason` field above. + // Provides additional context on why the case is being escalated. + string justification = 5 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto new file mode 100644 index 00000000000..908b94ad5fb --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto @@ -0,0 +1,56 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2beta; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2Beta"; +option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "ActorProto"; +option java_package = "com.google.cloud.support.v2beta"; +option php_namespace = "Google\\Cloud\\Support\\V2beta"; +option ruby_package = "Google::Cloud::Support::V2beta"; + +// An Actor represents an entity that performed an action. For example, an actor +// could be a user who posted a comment on a support case, a user who +// uploaded an attachment, or a service account that created a support case. +message Actor { + // The name to display for the actor. If not provided, it is inferred from + // credentials supplied during case creation. When an email is provided, a + // display name must also be provided. This will be obfuscated if the user + // is a Google Support agent. + string display_name = 1; + + // The email address of the actor. If not provided, it is inferred from the + // credentials supplied during case creation. When a name is provided, an + // email must also be provided. If the user is a Google Support agent, this is + // obfuscated. + // + // This field is deprecated. Use `username` instead. + string email = 2 [deprecated = true]; + + // Output only. Whether the actor is a Google support actor. + bool google_support = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The username of the actor. It may look like an email or other + // format provided by the identity provider. If not provided, it is inferred + // from the credentials supplied. When a name is provided, a username must + // also be provided. If the user is a Google Support agent, this will not be + // set. + string username = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto new file mode 100644 index 00000000000..1ea39feaa84 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2beta/actor.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2Beta"; +option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "AttachmentProto"; +option java_package = "com.google.cloud.support.v2beta"; +option php_namespace = "Google\\Cloud\\Support\\V2beta"; +option ruby_package = "Google::Cloud::Support::V2beta"; + +// An Attachment contains metadata about a file that was uploaded to a +// case - it is NOT a file itself. That being said, the name of an Attachment +// object can be used to download its accompanying file through the +// `media.download` endpoint. +// +// While attachments can be uploaded in the console at the +// same time as a comment, they're associated on a "case" level, not a +// "comment" level. +message Attachment { + option (google.api.resource) = { + type: "cloudsupport.googleapis.com/Attachment" + pattern: "organizations/{organization}/cases/{case}/attachments/{attachment_id}" + pattern: "projects/{project}/cases/{case}/attachments/{attachment_id}" + }; + + // Output only. Identifier. The resource name of the attachment. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. The time at which the attachment was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user who uploaded the attachment. Note, the name and email + // will be obfuscated if the attachment was uploaded by Google support. + Actor creator = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The filename of the attachment (e.g. `"graph.jpg"`). + string filename = 4; + + // Output only. The MIME type of the attachment (e.g. text/plain). + string mime_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The size of the attachment in bytes. + int64 size_bytes = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto new file mode 100644 index 00000000000..e488712eec1 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto @@ -0,0 +1,105 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2beta/attachment.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2Beta"; +option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "AttachmentServiceProto"; +option java_package = "com.google.cloud.support.v2beta"; +option php_namespace = "Google\\Cloud\\Support\\V2beta"; +option ruby_package = "Google::Cloud::Support::V2beta"; + +// A service to manage file attachments for Google Cloud support cases. +service CaseAttachmentService { + option (google.api.default_host) = "cloudsupport.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // List all the attachments associated with a support case. + rpc ListAttachments(ListAttachmentsRequest) + returns (ListAttachmentsResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*/cases/*}/attachments" + additional_bindings { + get: "/v2beta/{parent=organizations/*/cases/*}/attachments" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieve an attachment. + rpc GetAttachment(GetAttachmentRequest) returns (Attachment) { + option (google.api.http) = { + get: "/v2beta/{name=*/*/cases/*/attachments/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for the ListAttachments endpoint. +message ListAttachmentsRequest { + // Required. The name of the case for which attachments should be listed. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // The maximum number of attachments fetched with each request. + // + // If not provided, the default is 10. The maximum page size that will be + // returned is 100. + // + // The size of each page can be smaller than the requested page size and can + // include zero. For example, you could request 100 attachments on one page, + // receive 0, and then on the next page, receive 90. + int32 page_size = 2; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 3; +} + +// Request for getting an attachment. +message GetAttachmentRequest { + // Required. The name of the attachment to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Attachment" + } + ]; +} + +// The response message for the ListAttachments endpoint. +message ListAttachmentsResponse { + // The list of attachments associated with a case. + repeated Attachment attachments = 1; + + // A token to retrieve the next page of results. Set this in the `page_token` + // field of subsequent `cases.attachments.list` requests. If unspecified, + // there are no more results to retrieve. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case.proto new file mode 100644 index 00000000000..b042e9d95e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case.proto @@ -0,0 +1,218 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2beta/actor.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2Beta"; +option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "CaseProto"; +option java_package = "com.google.cloud.support.v2beta"; +option php_namespace = "Google\\Cloud\\Support\\V2beta"; +option ruby_package = "Google::Cloud::Support::V2beta"; + +// The product line a support case may be associated with. +enum ProductLine { + // Unknown product type. + PRODUCT_LINE_UNSPECIFIED = 0; + + // Google Cloud + GOOGLE_CLOUD = 1; + + // Google Maps + GOOGLE_MAPS = 2; +} + +// A Case is an object that contains the details of a support case. It +// contains fields for the time it was created, its priority, its +// classification, and more. Cases can also have comments and attachments that +// get added over time. +// +// A case is parented by a Google Cloud organization or project. +// +// Organizations are identified by a number, so the name of a case parented by +// an organization would look like this: +// +// ``` +// organizations/123/cases/456 +// ``` +// +// Projects have two unique identifiers, an ID and a number, and they look like +// this: +// +// ``` +// projects/abc/cases/456 +// ``` +// +// ``` +// projects/123/cases/456 +// ``` +// +// You can use either of them when calling the API. To learn more +// about project identifiers, see [AIP-2510](https://google.aip.dev/cloud/2510). +message Case { + option (google.api.resource) = { + type: "cloudsupport.googleapis.com/Case" + pattern: "organizations/{organization}/cases/{case}" + pattern: "projects/{project}/cases/{case}" + }; + + // The status of a support case. + enum State { + // Case is in an unknown state. + STATE_UNSPECIFIED = 0; + + // The case has been created but no one is assigned to work on it yet. + NEW = 1; + + // The case is currently being handled by Google support. + IN_PROGRESS_GOOGLE_SUPPORT = 2; + + // Google is waiting for a response. + ACTION_REQUIRED = 3; + + // A solution has been offered for the case, but it isn't yet closed. + SOLUTION_PROVIDED = 4; + + // The case has been resolved. + CLOSED = 5; + } + + // The case Priority. P0 is most urgent and P4 the least. + enum Priority { + // Priority is undefined or has not been set yet. + PRIORITY_UNSPECIFIED = 0; + + // Extreme impact on a production service. Service is hard down. + P0 = 1; + + // Critical impact on a production service. Service is currently unusable. + P1 = 2; + + // Severe impact on a production service. Service is usable but greatly + // impaired. + P2 = 3; + + // Medium impact on a production service. Service is available, but + // moderately impaired. + P3 = 4; + + // General questions or minor issues. Production service is fully + // available. + P4 = 5; + } + + // Identifier. The resource name for the case. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The short summary of the issue reported in this case. + string display_name = 2; + + // A broad description of the issue. + string description = 3; + + // The issue classification applicable to this case. + CaseClassification classification = 4; + + // The timezone of the user who created the support case. + // It should be in a format IANA recognizes: https://www.iana.org/time-zones. + // There is no additional validation done by the API. + string time_zone = 8; + + // The email addresses to receive updates on this case. + repeated string subscriber_email_addresses = 9; + + // Output only. The current status of the support case. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time this case was created. + google.protobuf.Timestamp create_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time this case was last updated. + google.protobuf.Timestamp update_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The user who created the case. + // + // Note: The name and email will be obfuscated if the case was created by + // Google Support. + Actor creator = 15; + + // A user-supplied email address to send case update notifications for. This + // should only be used in BYOID flows, where we cannot infer the user's email + // address directly from their EUCs. + string contact_email = 35; + + // Whether the case is currently escalated. + bool escalated = 17; + + // Whether this case was created for internal API testing and should not be + // acted on by the support team. + bool test_case = 19; + + // The language the user has requested to receive support in. This should be a + // BCP 47 language code (e.g., `"en"`, `"zh-CN"`, `"zh-TW"`, `"ja"`, `"ko"`). + // If no language or an unsupported language is specified, this field defaults + // to English (en). + // + // Language selection during case creation may affect your available support + // options. For a list of supported languages and their support working hours, + // see: https://cloud.google.com/support/docs/language-working-hours + string language_code = 23; + + // The priority of this case. + Priority priority = 32; +} + +// A Case Classification represents the topic that a case is about. It's very +// important to use accurate classifications, because they're +// used to route your cases to specialists who can help you. +// +// A classification always has an ID that is its unique identifier. +// A valid ID is required when creating a case. +message CaseClassification { + // The unique ID for a classification. Must be specified for case creation. + // + // To retrieve valid classification IDs for case creation, use + // `caseClassifications.search`. + // + // Classification IDs returned by `caseClassifications.search` are guaranteed + // to be valid for at least 6 months. If a given classification is + // deactiveated, it will immediately stop being returned. After 6 months, + // `case.create` requests using the classification ID will fail. + string id = 3; + + // A display name for the classification. + // + // The display name is not static and can change. To uniquely and consistently + // identify classifications, use the `CaseClassification.id` field. + string display_name = 4; + + // The full product the classification corresponds to. + Product product = 10; +} + +// The product a case may be associated with. +message Product { + // The product line of the Product. + ProductLine product_line = 1; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto new file mode 100644 index 00000000000..cd9894d2b97 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto @@ -0,0 +1,360 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2beta/case.proto"; +import "google/cloud/support/v2beta/escalation.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2Beta"; +option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "CaseServiceProto"; +option java_package = "com.google.cloud.support.v2beta"; +option php_namespace = "Google\\Cloud\\Support\\V2beta"; +option ruby_package = "Google::Cloud::Support::V2beta"; + +// A service to manage Google Cloud support cases. +service CaseService { + option (google.api.default_host) = "cloudsupport.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieve a case. + rpc GetCase(GetCaseRequest) returns (Case) { + option (google.api.http) = { + get: "/v2beta/{name=projects/*/cases/*}" + additional_bindings { get: "/v2beta/{name=organizations/*/cases/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Retrieve all cases under a parent, but not its children. + // + // For example, listing cases under an organization only returns the cases + // that are directly parented by that organization. To retrieve cases + // under an organization and its projects, use `cases.search`. + rpc ListCases(ListCasesRequest) returns (ListCasesResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*}/cases" + additional_bindings { get: "/v2beta/{parent=organizations/*}/cases" } + }; + option (google.api.method_signature) = "parent"; + } + + // Search for cases using a query. + rpc SearchCases(SearchCasesRequest) returns (SearchCasesResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*}/cases:search" + additional_bindings { + get: "/v2beta/{parent=organizations/*}/cases:search" + } + }; + } + + // Create a new case and associate it with a parent. + // + // It must have the following fields set: `display_name`, `description`, + // `classification`, and `priority`. If you're just testing the API and don't + // want to route your case to an agent, set `testCase=true`. + rpc CreateCase(CreateCaseRequest) returns (Case) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*}/cases" + body: "case" + additional_bindings { + post: "/v2beta/{parent=organizations/*}/cases" + body: "case" + } + }; + option (google.api.method_signature) = "parent,case"; + } + + // Update a case. Only some fields can be updated. + rpc UpdateCase(UpdateCaseRequest) returns (Case) { + option (google.api.http) = { + patch: "/v2beta/{case.name=projects/*/cases/*}" + body: "case" + additional_bindings { + patch: "/v2beta/{case.name=organizations/*/cases/*}" + body: "case" + } + }; + option (google.api.method_signature) = "case,update_mask"; + } + + // Escalate a case, starting the Google Cloud Support escalation management + // process. + // + // This operation is only available for some support services. Go to + // https://cloud.google.com/support and look for 'Technical support + // escalations' in the feature list to find out which ones let you + // do that. + rpc EscalateCase(EscalateCaseRequest) returns (Case) { + option (google.api.http) = { + post: "/v2beta/{name=projects/*/cases/*}:escalate" + body: "*" + additional_bindings { + post: "/v2beta/{name=organizations/*/cases/*}:escalate" + body: "*" + } + }; + } + + // Close a case. + rpc CloseCase(CloseCaseRequest) returns (Case) { + option (google.api.http) = { + post: "/v2beta/{name=projects/*/cases/*}:close" + body: "*" + additional_bindings { + post: "/v2beta/{name=organizations/*/cases/*}:close" + body: "*" + } + }; + } + + // Retrieve valid classifications to use when creating a support case. + // + // Classifications are hierarchical. Each classification is a string + // containing all levels of the hierarchy separated by `" > "`. For example, + // `"Technical Issue > Compute > Compute Engine"`. + // + // Classification IDs returned by this endpoint are valid for at least six + // months. When a classification is deactivated, this endpoint immediately + // stops returning it. After six months, `case.create` requests using the + // classification will fail. + rpc SearchCaseClassifications(SearchCaseClassificationsRequest) + returns (SearchCaseClassificationsResponse) { + option (google.api.http) = { + get: "/v2beta/caseClassifications:search" + }; + } +} + +// The request message for the GetCase endpoint. +message GetCaseRequest { + // Required. The full name of a case to be retrieved. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; +} + +// The request message for the CreateCase endpoint. +message CreateCaseRequest { + // Required. The name of the parent under which the case should be created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudsupport.googleapis.com/Case" + } + ]; + + // Required. The case to be created. + Case case = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for the ListCases endpoint. +message ListCasesRequest { + // Required. The name of a parent to list cases under. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudsupport.googleapis.com/Case" + } + ]; + + // An expression used to filter cases. + // + // If it's an empty string, then no filtering happens. Otherwise, the endpoint + // returns the cases that match the filter. + // + // Expressions use the following fields separated by `AND` and specified with + // `=`: + // + // - `state`: Can be `OPEN` or `CLOSED`. + // - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + // can specify multiple values for priority using the `OR` operator. For + // example, `priority=P1 OR priority=P2`. + // - `creator.email`: The email address of the case creator. + // + // EXAMPLES: + // + // - `state=CLOSED` + // - `state=OPEN AND creator.email="tester@example.com"` + // - `state=OPEN AND (priority=P0 OR priority=P1)` + string filter = 2; + + // The maximum number of cases fetched with each request. Defaults to 10. + int32 page_size = 4; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 5; + + // The product line to request cases for. If unspecified, only + // Google Cloud cases will be returned. + optional ProductLine product_line = 8; +} + +// The response message for the ListCases endpoint. +message ListCasesResponse { + // The list of cases associated with the parent after any + // filters have been applied. + repeated Case cases = 1; + + // A token to retrieve the next page of results. Set this in the `page_token` + // field of subsequent `cases.list` requests. If unspecified, there are no + // more results to retrieve. + string next_page_token = 2; +} + +// The request message for the SearchCases endpoint. +message SearchCasesRequest { + // The name of the parent resource to search for cases under. + string parent = 4; + + // An expression used to filter cases. + // + // Expressions use the following fields separated by `AND` and specified with + // `=`: + // + // - `organization`: An organization name in the form + // `organizations/`. + // - `project`: A project name in the form `projects/`. + // - `state`: Can be `OPEN` or `CLOSED`. + // - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + // can specify multiple values for priority using the `OR` operator. For + // example, `priority=P1 OR priority=P2`. + // - `creator.email`: The email address of the case creator. + // + // You must specify either `organization` or `project`. + // + // To search across `displayName`, `description`, and comments, use a global + // restriction with no keyword or operator. For example, `"my search"`. + // + // To search only cases updated after a certain date, use `update_time` + // restricted with that particular date, time, and timezone in ISO datetime + // format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + // `update_time` only supports the greater than operator (`>`). + // + // Examples: + // + // - `organization="organizations/123456789"` + // - `project="projects/my-project-id"` + // - `project="projects/123456789"` + // - `organization="organizations/123456789" AND state=CLOSED` + // - `project="projects/my-project-id" AND creator.email="tester@example.com"` + // - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + string query = 1; + + // The maximum number of cases fetched with each request. The default page + // size is 10. + int32 page_size = 2; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 3; +} + +// The response message for the SearchCases endpoint. +message SearchCasesResponse { + // The list of cases associated with the parent after any + // filters have been applied. + repeated Case cases = 1; + + // A token to retrieve the next page of results. Set this in the + // `page_token` field of subsequent `cases.search` requests. If unspecified, + // there are no more results to retrieve. + string next_page_token = 2; +} + +// The request message for the EscalateCase endpoint. +message EscalateCaseRequest { + // Required. The name of the case to be escalated. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // The escalation information to be sent with the escalation request. + Escalation escalation = 2; +} + +// The request message for the UpdateCase endpoint +message UpdateCaseRequest { + // Required. The case to update. + Case case = 1 [(google.api.field_behavior) = REQUIRED]; + + // A list of attributes of the case that should be updated. Supported values + // are `priority`, `display_name`, and `subscriber_email_addresses`. If no + // fields are specified, all supported fields are updated. + // + // Be careful - if you do not provide a field mask, then you might + // accidentally clear some fields. For example, if you leave the field mask + // empty and do not provide a value for `subscriber_email_addresses`, then + // `subscriber_email_addresses` is updated to empty. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the CloseCase endpoint. +message CloseCaseRequest { + // Required. The name of the case to close. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; +} + +// The request message for the SearchCaseClassifications endpoint. +message SearchCaseClassificationsRequest { + // An expression used to filter case classifications. + // + // If it's an empty string, then no filtering happens. Otherwise, case + // classifications will be returned that match the filter. + string query = 1; + + // The maximum number of classifications fetched with each request. + int32 page_size = 2; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 3; + + // Optional. The product to return case classifications for. + Product product = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for SearchCaseClassifications endpoint. +message SearchCaseClassificationsResponse { + // The classifications retrieved. + repeated CaseClassification case_classifications = 1; + + // A token to retrieve the next page of results. Set this in the `page_token` + // field of subsequent `caseClassifications.list` requests. If unspecified, + // there are no more results to retrieve. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto new file mode 100644 index 00000000000..0bc668d095f --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2beta/actor.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2Beta"; +option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "CommentProto"; +option java_package = "com.google.cloud.support.v2beta"; +option php_namespace = "Google\\Cloud\\Support\\V2beta"; +option ruby_package = "Google::Cloud::Support::V2beta"; + +// A comment associated with a support case. +// +// Case comments are the primary way for Google Support to communicate with a +// user who has opened a case. When a user responds to Google Support, the +// user's responses also appear as comments. +message Comment { + option (google.api.resource) = { + type: "cloudsupport.googleapis.com/Comment" + pattern: "organizations/{organization}/cases/{case}/comments/{comment}" + pattern: "projects/{project}/cases/{case}/comments/{comment}" + }; + + // Output only. Identifier. The resource name of the comment. + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The time when the comment was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user or Google Support agent who created the comment. + Actor creator = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The full comment body. + // + // Maximum of 12800 characters. + string body = 4; + + // Output only. DEPRECATED. DO NOT USE. + // + // A duplicate of the `body` field. + // + // This field is only present for legacy reasons. + string plain_text_body = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto new file mode 100644 index 00000000000..f0cd726cfb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto @@ -0,0 +1,126 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2beta/comment.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2Beta"; +option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "CommentServiceProto"; +option java_package = "com.google.cloud.support.v2beta"; +option php_namespace = "Google\\Cloud\\Support\\V2beta"; +option ruby_package = "Google::Cloud::Support::V2beta"; + +// A service to manage comments on cases. +service CommentService { + option (google.api.default_host) = "cloudsupport.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // List all the comments associated with a case. + rpc ListComments(ListCommentsRequest) returns (ListCommentsResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*/cases/*}/comments" + additional_bindings { + get: "/v2beta/{parent=organizations/*/cases/*}/comments" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Add a new comment to a case. + // + // The comment must have the following fields set: `body`. + rpc CreateComment(CreateCommentRequest) returns (Comment) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/cases/*}/comments" + body: "comment" + additional_bindings { + post: "/v2beta/{parent=organizations/*/cases/*}/comments" + body: "comment" + } + }; + option (google.api.method_signature) = "parent,comment"; + } + + // Retrieve a comment. + rpc GetComment(GetCommentRequest) returns (Comment) { + option (google.api.http) = { + get: "/v2beta/{name=*/*/cases/*/comments/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for the ListComments endpoint. +message ListCommentsRequest { + // Required. The name of the case for which to list comments. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // The maximum number of comments to fetch. Defaults to 10. + int32 page_size = 4; + + // A token identifying the page of results to return. If unspecified, the + // first page is returned. + string page_token = 5; +} + +// The response message for the ListComments endpoint. +message ListCommentsResponse { + // List of the comments associated with the case. + repeated Comment comments = 1; + + // A token to retrieve the next page of results. Set this in the `page_token` + // field of subsequent `cases.comments.list` requests. If unspecified, there + // are no more results to retrieve. + string next_page_token = 2; +} + +// The request message for the CreateComment endpoint. +message CreateCommentRequest { + // Required. The name of the case to which the comment should be added. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // Required. The comment to be added. + Comment comment = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for the GetComment endpoint. +message GetCommentRequest { + // Required. The name of the comment to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Comment" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/content.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/content.proto new file mode 100644 index 00000000000..bd7c184bcd9 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/content.proto @@ -0,0 +1,31 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2beta; + +option csharp_namespace = "Google.Cloud.Support.V2Beta"; +option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "ContentProto"; +option java_package = "com.google.cloud.support.v2beta"; +option php_namespace = "Google\\Cloud\\Support\\V2beta"; +option ruby_package = "Google::Cloud::Support::V2beta"; + +// Stores text attached to a support object. +message TextContent { + // Content in this field should be rendered and interpreted as-is. + string plain_text = 1; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto new file mode 100644 index 00000000000..f20350358d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2beta/actor.proto"; +import "google/cloud/support/v2beta/content.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2Beta"; +option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "EmailMessageProto"; +option java_package = "com.google.cloud.support.v2beta"; +option php_namespace = "Google\\Cloud\\Support\\V2beta"; +option ruby_package = "Google::Cloud::Support::V2beta"; + +// An email associated with a support case. +message EmailMessage { + option (google.api.resource) = { + type: "cloudsupport.googleapis.com/EmailMessage" + pattern: "projects/{project}/cases/{case}/emailMessages/{email_message}" + pattern: "organizations/{organization}/cases/{case}/emailMessages/{email_message}" + plural: "emailMessages" + singular: "emailMessage" + }; + + // Identifier. Resource name for the email message. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Time when this email message object was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user or Google Support agent that created this email + // message. This is inferred from the headers on the email message. + Actor actor = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Subject of the email. + string subject = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email addresses the email was sent to. + repeated string recipient_email_addresses = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email addresses CCed on the email. + repeated string cc_email_addresses = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The full email message body. A best-effort attempt is made to + // remove extraneous reply threads. + TextContent body_content = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto new file mode 100644 index 00000000000..e3cd802232f --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto @@ -0,0 +1,53 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2beta; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2Beta"; +option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "EscalationProto"; +option java_package = "com.google.cloud.support.v2beta"; +option php_namespace = "Google\\Cloud\\Support\\V2beta"; +option ruby_package = "Google::Cloud::Support::V2beta"; + +// An escalation of a support case. +message Escalation { + // An enum detailing the possible reasons a case may be escalated. + enum Reason { + // The escalation reason is in an unknown state or has not been specified. + REASON_UNSPECIFIED = 0; + + // The case is taking too long to resolve. + RESOLUTION_TIME = 1; + + // The support agent does not have the expertise required to successfully + // resolve the issue. + TECHNICAL_EXPERTISE = 2; + + // The issue is having a significant business impact. + BUSINESS_IMPACT = 3; + } + + // Required. The reason why the Case is being escalated. + Reason reason = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. A free text description to accompany the `reason` field above. + // Provides additional context on why the case is being escalated. + string justification = 5 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto new file mode 100644 index 00000000000..0540170772e --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto @@ -0,0 +1,56 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2beta; + +import "google/api/field_behavior.proto"; +import "google/cloud/support/v2beta/attachment.proto"; +import "google/cloud/support/v2beta/comment.proto"; +import "google/cloud/support/v2beta/email_message.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2Beta"; +option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "FeedItemProto"; +option java_package = "com.google.cloud.support.v2beta"; +option php_namespace = "Google\\Cloud\\Support\\V2beta"; +option ruby_package = "Google::Cloud::Support::V2beta"; + +// A feed item associated with a support case. +message FeedItem { + // The object corresponding to the event. + oneof event_object { + // Output only. A comment added to the case. + Comment comment = 100 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. An attachment attached to the case. + Attachment attachment = 101 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. An email message received in reply to the case. + EmailMessage email_message = 102 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A deleted attachment that used to be associated with the + // support case. + Attachment deleted_attachment = 103 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Time corresponding to the event of this item. + google.protobuf.Timestamp event_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto new file mode 100644 index 00000000000..bcf447d31d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto @@ -0,0 +1,88 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.support.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2beta/feed_item.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2Beta"; +option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "FeedServiceProto"; +option java_package = "com.google.cloud.support.v2beta"; +option php_namespace = "Google\\Cloud\\Support\\V2beta"; +option ruby_package = "Google::Cloud::Support::V2beta"; + +// A service to view case feed items. +service FeedService { + option (google.api.default_host) = "cloudsupport.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Show items in the feed of this case, including case emails, + // attachments, and comments. + rpc ShowFeed(ShowFeedRequest) returns (ShowFeedResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*/cases/*}:showFeed" + additional_bindings { + get: "/v2beta/{parent=organizations/*/cases/*}:showFeed" + } + }; + option (google.api.method_signature) = "parent"; + } +} + +// The request message for the ShowFeed endpoint. +message ShowFeedRequest { + // Required. The resource name of the case for which feed items should be + // listed. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // Optional. Field to order feed items by, followed by `asc` or `desc` + // postfix. The only valid field is + // `creation_time`. This list is case-insensitive, default sorting order is + // ascending, and the redundant space characters are insignificant. + // + // Example: `creation_time desc` + string order_by = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of feed items fetched with each request. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying the page of results to return. If + // unspecified, it retrieves the first page. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for the ShowFeed endpoint. +message ShowFeedResponse { + // The list of feed items associated with the given Case. + repeated FeedItem feed_items = 1; + + // A token to retrieve the next page of results. This should be set in the + // `page_token` field of subsequent `ShowFeedRequests`. + // If unspecified, there are no more results to retrieve. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-support/protos/protos.d.ts b/owl-bot-staging/google-cloud-support/protos/protos.d.ts new file mode 100644 index 00000000000..bda14d751a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/protos.d.ts @@ -0,0 +1,13074 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 support. */ + namespace support { + + /** Namespace v2. */ + namespace v2 { + + /** Properties of an Actor. */ + interface IActor { + + /** Actor displayName */ + displayName?: (string|null); + + /** Actor email */ + email?: (string|null); + + /** Actor googleSupport */ + googleSupport?: (boolean|null); + + /** Actor username */ + username?: (string|null); + } + + /** Represents an Actor. */ + class Actor implements IActor { + + /** + * Constructs a new Actor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IActor); + + /** Actor displayName. */ + public displayName: string; + + /** Actor email. */ + public email: string; + + /** Actor googleSupport. */ + public googleSupport: boolean; + + /** Actor username. */ + public username: string; + + /** + * Creates a new Actor instance using the specified properties. + * @param [properties] Properties to set + * @returns Actor instance + */ + public static create(properties?: google.cloud.support.v2.IActor): google.cloud.support.v2.Actor; + + /** + * Encodes the specified Actor message. Does not implicitly {@link google.cloud.support.v2.Actor.verify|verify} messages. + * @param message Actor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IActor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Actor message, length delimited. Does not implicitly {@link google.cloud.support.v2.Actor.verify|verify} messages. + * @param message Actor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IActor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Actor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Actor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Actor; + + /** + * Decodes an Actor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Actor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Actor; + + /** + * Verifies an Actor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Actor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Actor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Actor; + + /** + * Creates a plain object from an Actor message. Also converts values to other types if specified. + * @param message Actor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.Actor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Actor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Actor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Attachment. */ + interface IAttachment { + + /** Attachment name */ + name?: (string|null); + + /** Attachment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Attachment creator */ + creator?: (google.cloud.support.v2.IActor|null); + + /** Attachment filename */ + filename?: (string|null); + + /** Attachment mimeType */ + mimeType?: (string|null); + + /** Attachment sizeBytes */ + sizeBytes?: (number|Long|string|null); + } + + /** Represents an Attachment. */ + class Attachment implements IAttachment { + + /** + * Constructs a new Attachment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IAttachment); + + /** Attachment name. */ + public name: string; + + /** Attachment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Attachment creator. */ + public creator?: (google.cloud.support.v2.IActor|null); + + /** Attachment filename. */ + public filename: string; + + /** Attachment mimeType. */ + public mimeType: string; + + /** Attachment sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** + * Creates a new Attachment instance using the specified properties. + * @param [properties] Properties to set + * @returns Attachment instance + */ + public static create(properties?: google.cloud.support.v2.IAttachment): google.cloud.support.v2.Attachment; + + /** + * Encodes the specified Attachment message. Does not implicitly {@link google.cloud.support.v2.Attachment.verify|verify} messages. + * @param message Attachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.cloud.support.v2.Attachment.verify|verify} messages. + * @param message Attachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Attachment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Attachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Attachment; + + /** + * Decodes an Attachment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Attachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Attachment; + + /** + * Verifies an Attachment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Attachment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Attachment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Attachment; + + /** + * Creates a plain object from an Attachment message. Also converts values to other types if specified. + * @param message Attachment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.Attachment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Attachment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Attachment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CaseAttachmentService */ + class CaseAttachmentService extends $protobuf.rpc.Service { + + /** + * Constructs a new CaseAttachmentService 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 CaseAttachmentService 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): CaseAttachmentService; + + /** + * Calls ListAttachments. + * @param request ListAttachmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAttachmentsResponse + */ + public listAttachments(request: google.cloud.support.v2.IListAttachmentsRequest, callback: google.cloud.support.v2.CaseAttachmentService.ListAttachmentsCallback): void; + + /** + * Calls ListAttachments. + * @param request ListAttachmentsRequest message or plain object + * @returns Promise + */ + public listAttachments(request: google.cloud.support.v2.IListAttachmentsRequest): Promise; + } + + namespace CaseAttachmentService { + + /** + * Callback as used by {@link google.cloud.support.v2.CaseAttachmentService|listAttachments}. + * @param error Error, if any + * @param [response] ListAttachmentsResponse + */ + type ListAttachmentsCallback = (error: (Error|null), response?: google.cloud.support.v2.ListAttachmentsResponse) => void; + } + + /** Properties of a ListAttachmentsRequest. */ + interface IListAttachmentsRequest { + + /** ListAttachmentsRequest parent */ + parent?: (string|null); + + /** ListAttachmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListAttachmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAttachmentsRequest. */ + class ListAttachmentsRequest implements IListAttachmentsRequest { + + /** + * Constructs a new ListAttachmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IListAttachmentsRequest); + + /** ListAttachmentsRequest parent. */ + public parent: string; + + /** ListAttachmentsRequest pageSize. */ + public pageSize: number; + + /** ListAttachmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAttachmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttachmentsRequest instance + */ + public static create(properties?: google.cloud.support.v2.IListAttachmentsRequest): google.cloud.support.v2.ListAttachmentsRequest; + + /** + * Encodes the specified ListAttachmentsRequest message. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsRequest.verify|verify} messages. + * @param message ListAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IListAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsRequest.verify|verify} messages. + * @param message ListAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IListAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttachmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListAttachmentsRequest; + + /** + * Decodes a ListAttachmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListAttachmentsRequest; + + /** + * Verifies a ListAttachmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttachmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListAttachmentsRequest; + + /** + * Creates a plain object from a ListAttachmentsRequest message. Also converts values to other types if specified. + * @param message ListAttachmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.ListAttachmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttachmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttachmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAttachmentsResponse. */ + interface IListAttachmentsResponse { + + /** ListAttachmentsResponse attachments */ + attachments?: (google.cloud.support.v2.IAttachment[]|null); + + /** ListAttachmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAttachmentsResponse. */ + class ListAttachmentsResponse implements IListAttachmentsResponse { + + /** + * Constructs a new ListAttachmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IListAttachmentsResponse); + + /** ListAttachmentsResponse attachments. */ + public attachments: google.cloud.support.v2.IAttachment[]; + + /** ListAttachmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAttachmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttachmentsResponse instance + */ + public static create(properties?: google.cloud.support.v2.IListAttachmentsResponse): google.cloud.support.v2.ListAttachmentsResponse; + + /** + * Encodes the specified ListAttachmentsResponse message. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsResponse.verify|verify} messages. + * @param message ListAttachmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IListAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsResponse.verify|verify} messages. + * @param message ListAttachmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IListAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttachmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListAttachmentsResponse; + + /** + * Decodes a ListAttachmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListAttachmentsResponse; + + /** + * Verifies a ListAttachmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttachmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttachmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListAttachmentsResponse; + + /** + * Creates a plain object from a ListAttachmentsResponse message. Also converts values to other types if specified. + * @param message ListAttachmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.ListAttachmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttachmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttachmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Case. */ + interface ICase { + + /** Case name */ + name?: (string|null); + + /** Case displayName */ + displayName?: (string|null); + + /** Case description */ + description?: (string|null); + + /** Case classification */ + classification?: (google.cloud.support.v2.ICaseClassification|null); + + /** Case timeZone */ + timeZone?: (string|null); + + /** Case subscriberEmailAddresses */ + subscriberEmailAddresses?: (string[]|null); + + /** Case state */ + state?: (google.cloud.support.v2.Case.State|keyof typeof google.cloud.support.v2.Case.State|null); + + /** Case createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Case updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Case creator */ + creator?: (google.cloud.support.v2.IActor|null); + + /** Case contactEmail */ + contactEmail?: (string|null); + + /** Case escalated */ + escalated?: (boolean|null); + + /** Case testCase */ + testCase?: (boolean|null); + + /** Case languageCode */ + languageCode?: (string|null); + + /** Case priority */ + priority?: (google.cloud.support.v2.Case.Priority|keyof typeof google.cloud.support.v2.Case.Priority|null); + } + + /** Represents a Case. */ + class Case implements ICase { + + /** + * Constructs a new Case. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ICase); + + /** Case name. */ + public name: string; + + /** Case displayName. */ + public displayName: string; + + /** Case description. */ + public description: string; + + /** Case classification. */ + public classification?: (google.cloud.support.v2.ICaseClassification|null); + + /** Case timeZone. */ + public timeZone: string; + + /** Case subscriberEmailAddresses. */ + public subscriberEmailAddresses: string[]; + + /** Case state. */ + public state: (google.cloud.support.v2.Case.State|keyof typeof google.cloud.support.v2.Case.State); + + /** Case createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Case updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Case creator. */ + public creator?: (google.cloud.support.v2.IActor|null); + + /** Case contactEmail. */ + public contactEmail: string; + + /** Case escalated. */ + public escalated: boolean; + + /** Case testCase. */ + public testCase: boolean; + + /** Case languageCode. */ + public languageCode: string; + + /** Case priority. */ + public priority: (google.cloud.support.v2.Case.Priority|keyof typeof google.cloud.support.v2.Case.Priority); + + /** + * Creates a new Case instance using the specified properties. + * @param [properties] Properties to set + * @returns Case instance + */ + public static create(properties?: google.cloud.support.v2.ICase): google.cloud.support.v2.Case; + + /** + * Encodes the specified Case message. Does not implicitly {@link google.cloud.support.v2.Case.verify|verify} messages. + * @param message Case message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ICase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.support.v2.Case.verify|verify} messages. + * @param message Case message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ICase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Case message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Case; + + /** + * Decodes a Case message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Case; + + /** + * Verifies a Case message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Case message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Case + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Case; + + /** + * Creates a plain object from a Case message. Also converts values to other types if specified. + * @param message Case + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.Case, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Case to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Case + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Case { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + NEW = 1, + IN_PROGRESS_GOOGLE_SUPPORT = 2, + ACTION_REQUIRED = 3, + SOLUTION_PROVIDED = 4, + CLOSED = 5 + } + + /** Priority enum. */ + enum Priority { + PRIORITY_UNSPECIFIED = 0, + P0 = 1, + P1 = 2, + P2 = 3, + P3 = 4, + P4 = 5 + } + } + + /** Properties of a CaseClassification. */ + interface ICaseClassification { + + /** CaseClassification id */ + id?: (string|null); + + /** CaseClassification displayName */ + displayName?: (string|null); + } + + /** Represents a CaseClassification. */ + class CaseClassification implements ICaseClassification { + + /** + * Constructs a new CaseClassification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ICaseClassification); + + /** CaseClassification id. */ + public id: string; + + /** CaseClassification displayName. */ + public displayName: string; + + /** + * Creates a new CaseClassification instance using the specified properties. + * @param [properties] Properties to set + * @returns CaseClassification instance + */ + public static create(properties?: google.cloud.support.v2.ICaseClassification): google.cloud.support.v2.CaseClassification; + + /** + * Encodes the specified CaseClassification message. Does not implicitly {@link google.cloud.support.v2.CaseClassification.verify|verify} messages. + * @param message CaseClassification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ICaseClassification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaseClassification message, length delimited. Does not implicitly {@link google.cloud.support.v2.CaseClassification.verify|verify} messages. + * @param message CaseClassification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ICaseClassification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaseClassification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaseClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.CaseClassification; + + /** + * Decodes a CaseClassification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaseClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.CaseClassification; + + /** + * Verifies a CaseClassification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CaseClassification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaseClassification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.CaseClassification; + + /** + * Creates a plain object from a CaseClassification message. Also converts values to other types if specified. + * @param message CaseClassification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.CaseClassification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaseClassification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaseClassification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CaseService */ + class CaseService extends $protobuf.rpc.Service { + + /** + * Constructs a new CaseService 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 CaseService 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): CaseService; + + /** + * Calls GetCase. + * @param request GetCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public getCase(request: google.cloud.support.v2.IGetCaseRequest, callback: google.cloud.support.v2.CaseService.GetCaseCallback): void; + + /** + * Calls GetCase. + * @param request GetCaseRequest message or plain object + * @returns Promise + */ + public getCase(request: google.cloud.support.v2.IGetCaseRequest): Promise; + + /** + * Calls ListCases. + * @param request ListCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCasesResponse + */ + public listCases(request: google.cloud.support.v2.IListCasesRequest, callback: google.cloud.support.v2.CaseService.ListCasesCallback): void; + + /** + * Calls ListCases. + * @param request ListCasesRequest message or plain object + * @returns Promise + */ + public listCases(request: google.cloud.support.v2.IListCasesRequest): Promise; + + /** + * Calls SearchCases. + * @param request SearchCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchCasesResponse + */ + public searchCases(request: google.cloud.support.v2.ISearchCasesRequest, callback: google.cloud.support.v2.CaseService.SearchCasesCallback): void; + + /** + * Calls SearchCases. + * @param request SearchCasesRequest message or plain object + * @returns Promise + */ + public searchCases(request: google.cloud.support.v2.ISearchCasesRequest): Promise; + + /** + * Calls CreateCase. + * @param request CreateCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public createCase(request: google.cloud.support.v2.ICreateCaseRequest, callback: google.cloud.support.v2.CaseService.CreateCaseCallback): void; + + /** + * Calls CreateCase. + * @param request CreateCaseRequest message or plain object + * @returns Promise + */ + public createCase(request: google.cloud.support.v2.ICreateCaseRequest): Promise; + + /** + * Calls UpdateCase. + * @param request UpdateCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public updateCase(request: google.cloud.support.v2.IUpdateCaseRequest, callback: google.cloud.support.v2.CaseService.UpdateCaseCallback): void; + + /** + * Calls UpdateCase. + * @param request UpdateCaseRequest message or plain object + * @returns Promise + */ + public updateCase(request: google.cloud.support.v2.IUpdateCaseRequest): Promise; + + /** + * Calls EscalateCase. + * @param request EscalateCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public escalateCase(request: google.cloud.support.v2.IEscalateCaseRequest, callback: google.cloud.support.v2.CaseService.EscalateCaseCallback): void; + + /** + * Calls EscalateCase. + * @param request EscalateCaseRequest message or plain object + * @returns Promise + */ + public escalateCase(request: google.cloud.support.v2.IEscalateCaseRequest): Promise; + + /** + * Calls CloseCase. + * @param request CloseCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public closeCase(request: google.cloud.support.v2.ICloseCaseRequest, callback: google.cloud.support.v2.CaseService.CloseCaseCallback): void; + + /** + * Calls CloseCase. + * @param request CloseCaseRequest message or plain object + * @returns Promise + */ + public closeCase(request: google.cloud.support.v2.ICloseCaseRequest): Promise; + + /** + * Calls SearchCaseClassifications. + * @param request SearchCaseClassificationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchCaseClassificationsResponse + */ + public searchCaseClassifications(request: google.cloud.support.v2.ISearchCaseClassificationsRequest, callback: google.cloud.support.v2.CaseService.SearchCaseClassificationsCallback): void; + + /** + * Calls SearchCaseClassifications. + * @param request SearchCaseClassificationsRequest message or plain object + * @returns Promise + */ + public searchCaseClassifications(request: google.cloud.support.v2.ISearchCaseClassificationsRequest): Promise; + } + + namespace CaseService { + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|getCase}. + * @param error Error, if any + * @param [response] Case + */ + type GetCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|listCases}. + * @param error Error, if any + * @param [response] ListCasesResponse + */ + type ListCasesCallback = (error: (Error|null), response?: google.cloud.support.v2.ListCasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|searchCases}. + * @param error Error, if any + * @param [response] SearchCasesResponse + */ + type SearchCasesCallback = (error: (Error|null), response?: google.cloud.support.v2.SearchCasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|createCase}. + * @param error Error, if any + * @param [response] Case + */ + type CreateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|updateCase}. + * @param error Error, if any + * @param [response] Case + */ + type UpdateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|escalateCase}. + * @param error Error, if any + * @param [response] Case + */ + type EscalateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|closeCase}. + * @param error Error, if any + * @param [response] Case + */ + type CloseCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|searchCaseClassifications}. + * @param error Error, if any + * @param [response] SearchCaseClassificationsResponse + */ + type SearchCaseClassificationsCallback = (error: (Error|null), response?: google.cloud.support.v2.SearchCaseClassificationsResponse) => void; + } + + /** Properties of a GetCaseRequest. */ + interface IGetCaseRequest { + + /** GetCaseRequest name */ + name?: (string|null); + } + + /** Represents a GetCaseRequest. */ + class GetCaseRequest implements IGetCaseRequest { + + /** + * Constructs a new GetCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IGetCaseRequest); + + /** GetCaseRequest name. */ + public name: string; + + /** + * Creates a new GetCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2.IGetCaseRequest): google.cloud.support.v2.GetCaseRequest; + + /** + * Encodes the specified GetCaseRequest message. Does not implicitly {@link google.cloud.support.v2.GetCaseRequest.verify|verify} messages. + * @param message GetCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IGetCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.GetCaseRequest.verify|verify} messages. + * @param message GetCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IGetCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.GetCaseRequest; + + /** + * Decodes a GetCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.GetCaseRequest; + + /** + * Verifies a GetCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.GetCaseRequest; + + /** + * Creates a plain object from a GetCaseRequest message. Also converts values to other types if specified. + * @param message GetCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.GetCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCaseRequest. */ + interface ICreateCaseRequest { + + /** CreateCaseRequest parent */ + parent?: (string|null); + + /** CreateCaseRequest case */ + "case"?: (google.cloud.support.v2.ICase|null); + } + + /** Represents a CreateCaseRequest. */ + class CreateCaseRequest implements ICreateCaseRequest { + + /** + * Constructs a new CreateCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ICreateCaseRequest); + + /** CreateCaseRequest parent. */ + public parent: string; + + /** CreateCaseRequest case. */ + public case?: (google.cloud.support.v2.ICase|null); + + /** + * Creates a new CreateCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2.ICreateCaseRequest): google.cloud.support.v2.CreateCaseRequest; + + /** + * Encodes the specified CreateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.CreateCaseRequest.verify|verify} messages. + * @param message CreateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ICreateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CreateCaseRequest.verify|verify} messages. + * @param message CreateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ICreateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.CreateCaseRequest; + + /** + * Decodes a CreateCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.CreateCaseRequest; + + /** + * Verifies a CreateCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.CreateCaseRequest; + + /** + * Creates a plain object from a CreateCaseRequest message. Also converts values to other types if specified. + * @param message CreateCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.CreateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCasesRequest. */ + interface IListCasesRequest { + + /** ListCasesRequest parent */ + parent?: (string|null); + + /** ListCasesRequest filter */ + filter?: (string|null); + + /** ListCasesRequest pageSize */ + pageSize?: (number|null); + + /** ListCasesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCasesRequest. */ + class ListCasesRequest implements IListCasesRequest { + + /** + * Constructs a new ListCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IListCasesRequest); + + /** ListCasesRequest parent. */ + public parent: string; + + /** ListCasesRequest filter. */ + public filter: string; + + /** ListCasesRequest pageSize. */ + public pageSize: number; + + /** ListCasesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCasesRequest instance + */ + public static create(properties?: google.cloud.support.v2.IListCasesRequest): google.cloud.support.v2.ListCasesRequest; + + /** + * Encodes the specified ListCasesRequest message. Does not implicitly {@link google.cloud.support.v2.ListCasesRequest.verify|verify} messages. + * @param message ListCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IListCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCasesRequest.verify|verify} messages. + * @param message ListCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IListCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListCasesRequest; + + /** + * Decodes a ListCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListCasesRequest; + + /** + * Verifies a ListCasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListCasesRequest; + + /** + * Creates a plain object from a ListCasesRequest message. Also converts values to other types if specified. + * @param message ListCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.ListCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCasesResponse. */ + interface IListCasesResponse { + + /** ListCasesResponse cases */ + cases?: (google.cloud.support.v2.ICase[]|null); + + /** ListCasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCasesResponse. */ + class ListCasesResponse implements IListCasesResponse { + + /** + * Constructs a new ListCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IListCasesResponse); + + /** ListCasesResponse cases. */ + public cases: google.cloud.support.v2.ICase[]; + + /** ListCasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCasesResponse instance + */ + public static create(properties?: google.cloud.support.v2.IListCasesResponse): google.cloud.support.v2.ListCasesResponse; + + /** + * Encodes the specified ListCasesResponse message. Does not implicitly {@link google.cloud.support.v2.ListCasesResponse.verify|verify} messages. + * @param message ListCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IListCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCasesResponse.verify|verify} messages. + * @param message ListCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IListCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListCasesResponse; + + /** + * Decodes a ListCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListCasesResponse; + + /** + * Verifies a ListCasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListCasesResponse; + + /** + * Creates a plain object from a ListCasesResponse message. Also converts values to other types if specified. + * @param message ListCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.ListCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchCasesRequest. */ + interface ISearchCasesRequest { + + /** SearchCasesRequest parent */ + parent?: (string|null); + + /** SearchCasesRequest query */ + query?: (string|null); + + /** SearchCasesRequest pageSize */ + pageSize?: (number|null); + + /** SearchCasesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchCasesRequest. */ + class SearchCasesRequest implements ISearchCasesRequest { + + /** + * Constructs a new SearchCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ISearchCasesRequest); + + /** SearchCasesRequest parent. */ + public parent: string; + + /** SearchCasesRequest query. */ + public query: string; + + /** SearchCasesRequest pageSize. */ + public pageSize: number; + + /** SearchCasesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCasesRequest instance + */ + public static create(properties?: google.cloud.support.v2.ISearchCasesRequest): google.cloud.support.v2.SearchCasesRequest; + + /** + * Encodes the specified SearchCasesRequest message. Does not implicitly {@link google.cloud.support.v2.SearchCasesRequest.verify|verify} messages. + * @param message SearchCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ISearchCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCasesRequest.verify|verify} messages. + * @param message SearchCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ISearchCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.SearchCasesRequest; + + /** + * Decodes a SearchCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.SearchCasesRequest; + + /** + * Verifies a SearchCasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.SearchCasesRequest; + + /** + * Creates a plain object from a SearchCasesRequest message. Also converts values to other types if specified. + * @param message SearchCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.SearchCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchCasesResponse. */ + interface ISearchCasesResponse { + + /** SearchCasesResponse cases */ + cases?: (google.cloud.support.v2.ICase[]|null); + + /** SearchCasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchCasesResponse. */ + class SearchCasesResponse implements ISearchCasesResponse { + + /** + * Constructs a new SearchCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ISearchCasesResponse); + + /** SearchCasesResponse cases. */ + public cases: google.cloud.support.v2.ICase[]; + + /** SearchCasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCasesResponse instance + */ + public static create(properties?: google.cloud.support.v2.ISearchCasesResponse): google.cloud.support.v2.SearchCasesResponse; + + /** + * Encodes the specified SearchCasesResponse message. Does not implicitly {@link google.cloud.support.v2.SearchCasesResponse.verify|verify} messages. + * @param message SearchCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ISearchCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCasesResponse.verify|verify} messages. + * @param message SearchCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ISearchCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.SearchCasesResponse; + + /** + * Decodes a SearchCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.SearchCasesResponse; + + /** + * Verifies a SearchCasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.SearchCasesResponse; + + /** + * Creates a plain object from a SearchCasesResponse message. Also converts values to other types if specified. + * @param message SearchCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.SearchCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EscalateCaseRequest. */ + interface IEscalateCaseRequest { + + /** EscalateCaseRequest name */ + name?: (string|null); + + /** EscalateCaseRequest escalation */ + escalation?: (google.cloud.support.v2.IEscalation|null); + } + + /** Represents an EscalateCaseRequest. */ + class EscalateCaseRequest implements IEscalateCaseRequest { + + /** + * Constructs a new EscalateCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IEscalateCaseRequest); + + /** EscalateCaseRequest name. */ + public name: string; + + /** EscalateCaseRequest escalation. */ + public escalation?: (google.cloud.support.v2.IEscalation|null); + + /** + * Creates a new EscalateCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EscalateCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2.IEscalateCaseRequest): google.cloud.support.v2.EscalateCaseRequest; + + /** + * Encodes the specified EscalateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.EscalateCaseRequest.verify|verify} messages. + * @param message EscalateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IEscalateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EscalateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.EscalateCaseRequest.verify|verify} messages. + * @param message EscalateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IEscalateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EscalateCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EscalateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.EscalateCaseRequest; + + /** + * Decodes an EscalateCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EscalateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.EscalateCaseRequest; + + /** + * Verifies an EscalateCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EscalateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EscalateCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.EscalateCaseRequest; + + /** + * Creates a plain object from an EscalateCaseRequest message. Also converts values to other types if specified. + * @param message EscalateCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.EscalateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EscalateCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EscalateCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCaseRequest. */ + interface IUpdateCaseRequest { + + /** UpdateCaseRequest case */ + "case"?: (google.cloud.support.v2.ICase|null); + + /** UpdateCaseRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCaseRequest. */ + class UpdateCaseRequest implements IUpdateCaseRequest { + + /** + * Constructs a new UpdateCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IUpdateCaseRequest); + + /** UpdateCaseRequest case. */ + public case?: (google.cloud.support.v2.ICase|null); + + /** UpdateCaseRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2.IUpdateCaseRequest): google.cloud.support.v2.UpdateCaseRequest; + + /** + * Encodes the specified UpdateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.UpdateCaseRequest.verify|verify} messages. + * @param message UpdateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IUpdateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.UpdateCaseRequest.verify|verify} messages. + * @param message UpdateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IUpdateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.UpdateCaseRequest; + + /** + * Decodes an UpdateCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.UpdateCaseRequest; + + /** + * Verifies an UpdateCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.UpdateCaseRequest; + + /** + * Creates a plain object from an UpdateCaseRequest message. Also converts values to other types if specified. + * @param message UpdateCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.UpdateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloseCaseRequest. */ + interface ICloseCaseRequest { + + /** CloseCaseRequest name */ + name?: (string|null); + } + + /** Represents a CloseCaseRequest. */ + class CloseCaseRequest implements ICloseCaseRequest { + + /** + * Constructs a new CloseCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ICloseCaseRequest); + + /** CloseCaseRequest name. */ + public name: string; + + /** + * Creates a new CloseCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CloseCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2.ICloseCaseRequest): google.cloud.support.v2.CloseCaseRequest; + + /** + * Encodes the specified CloseCaseRequest message. Does not implicitly {@link google.cloud.support.v2.CloseCaseRequest.verify|verify} messages. + * @param message CloseCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ICloseCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloseCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CloseCaseRequest.verify|verify} messages. + * @param message CloseCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ICloseCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloseCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloseCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.CloseCaseRequest; + + /** + * Decodes a CloseCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloseCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.CloseCaseRequest; + + /** + * Verifies a CloseCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloseCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloseCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.CloseCaseRequest; + + /** + * Creates a plain object from a CloseCaseRequest message. Also converts values to other types if specified. + * @param message CloseCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.CloseCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloseCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloseCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchCaseClassificationsRequest. */ + interface ISearchCaseClassificationsRequest { + + /** SearchCaseClassificationsRequest query */ + query?: (string|null); + + /** SearchCaseClassificationsRequest pageSize */ + pageSize?: (number|null); + + /** SearchCaseClassificationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchCaseClassificationsRequest. */ + class SearchCaseClassificationsRequest implements ISearchCaseClassificationsRequest { + + /** + * Constructs a new SearchCaseClassificationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ISearchCaseClassificationsRequest); + + /** SearchCaseClassificationsRequest query. */ + public query: string; + + /** SearchCaseClassificationsRequest pageSize. */ + public pageSize: number; + + /** SearchCaseClassificationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchCaseClassificationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCaseClassificationsRequest instance + */ + public static create(properties?: google.cloud.support.v2.ISearchCaseClassificationsRequest): google.cloud.support.v2.SearchCaseClassificationsRequest; + + /** + * Encodes the specified SearchCaseClassificationsRequest message. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsRequest.verify|verify} messages. + * @param message SearchCaseClassificationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ISearchCaseClassificationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCaseClassificationsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsRequest.verify|verify} messages. + * @param message SearchCaseClassificationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ISearchCaseClassificationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCaseClassificationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.SearchCaseClassificationsRequest; + + /** + * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCaseClassificationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.SearchCaseClassificationsRequest; + + /** + * Verifies a SearchCaseClassificationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCaseClassificationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCaseClassificationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.SearchCaseClassificationsRequest; + + /** + * Creates a plain object from a SearchCaseClassificationsRequest message. Also converts values to other types if specified. + * @param message SearchCaseClassificationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.SearchCaseClassificationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCaseClassificationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCaseClassificationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchCaseClassificationsResponse. */ + interface ISearchCaseClassificationsResponse { + + /** SearchCaseClassificationsResponse caseClassifications */ + caseClassifications?: (google.cloud.support.v2.ICaseClassification[]|null); + + /** SearchCaseClassificationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchCaseClassificationsResponse. */ + class SearchCaseClassificationsResponse implements ISearchCaseClassificationsResponse { + + /** + * Constructs a new SearchCaseClassificationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ISearchCaseClassificationsResponse); + + /** SearchCaseClassificationsResponse caseClassifications. */ + public caseClassifications: google.cloud.support.v2.ICaseClassification[]; + + /** SearchCaseClassificationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchCaseClassificationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCaseClassificationsResponse instance + */ + public static create(properties?: google.cloud.support.v2.ISearchCaseClassificationsResponse): google.cloud.support.v2.SearchCaseClassificationsResponse; + + /** + * Encodes the specified SearchCaseClassificationsResponse message. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsResponse.verify|verify} messages. + * @param message SearchCaseClassificationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ISearchCaseClassificationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCaseClassificationsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsResponse.verify|verify} messages. + * @param message SearchCaseClassificationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ISearchCaseClassificationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCaseClassificationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.SearchCaseClassificationsResponse; + + /** + * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCaseClassificationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.SearchCaseClassificationsResponse; + + /** + * Verifies a SearchCaseClassificationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCaseClassificationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCaseClassificationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.SearchCaseClassificationsResponse; + + /** + * Creates a plain object from a SearchCaseClassificationsResponse message. Also converts values to other types if specified. + * @param message SearchCaseClassificationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.SearchCaseClassificationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCaseClassificationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCaseClassificationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Escalation. */ + interface IEscalation { + + /** Escalation reason */ + reason?: (google.cloud.support.v2.Escalation.Reason|keyof typeof google.cloud.support.v2.Escalation.Reason|null); + + /** Escalation justification */ + justification?: (string|null); + } + + /** Represents an Escalation. */ + class Escalation implements IEscalation { + + /** + * Constructs a new Escalation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IEscalation); + + /** Escalation reason. */ + public reason: (google.cloud.support.v2.Escalation.Reason|keyof typeof google.cloud.support.v2.Escalation.Reason); + + /** Escalation justification. */ + public justification: string; + + /** + * Creates a new Escalation instance using the specified properties. + * @param [properties] Properties to set + * @returns Escalation instance + */ + public static create(properties?: google.cloud.support.v2.IEscalation): google.cloud.support.v2.Escalation; + + /** + * Encodes the specified Escalation message. Does not implicitly {@link google.cloud.support.v2.Escalation.verify|verify} messages. + * @param message Escalation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IEscalation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Escalation message, length delimited. Does not implicitly {@link google.cloud.support.v2.Escalation.verify|verify} messages. + * @param message Escalation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IEscalation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Escalation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Escalation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Escalation; + + /** + * Decodes an Escalation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Escalation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Escalation; + + /** + * Verifies an Escalation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Escalation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Escalation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Escalation; + + /** + * Creates a plain object from an Escalation message. Also converts values to other types if specified. + * @param message Escalation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.Escalation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Escalation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Escalation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Escalation { + + /** Reason enum. */ + enum Reason { + REASON_UNSPECIFIED = 0, + RESOLUTION_TIME = 1, + TECHNICAL_EXPERTISE = 2, + BUSINESS_IMPACT = 3 + } + } + + /** Properties of a Comment. */ + interface IComment { + + /** Comment name */ + name?: (string|null); + + /** Comment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Comment creator */ + creator?: (google.cloud.support.v2.IActor|null); + + /** Comment body */ + body?: (string|null); + + /** Comment plainTextBody */ + plainTextBody?: (string|null); + } + + /** Represents a Comment. */ + class Comment implements IComment { + + /** + * Constructs a new Comment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IComment); + + /** Comment name. */ + public name: string; + + /** Comment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Comment creator. */ + public creator?: (google.cloud.support.v2.IActor|null); + + /** Comment body. */ + public body: string; + + /** Comment plainTextBody. */ + public plainTextBody: string; + + /** + * Creates a new Comment instance using the specified properties. + * @param [properties] Properties to set + * @returns Comment instance + */ + public static create(properties?: google.cloud.support.v2.IComment): google.cloud.support.v2.Comment; + + /** + * Encodes the specified Comment message. Does not implicitly {@link google.cloud.support.v2.Comment.verify|verify} messages. + * @param message Comment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IComment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Comment message, length delimited. Does not implicitly {@link google.cloud.support.v2.Comment.verify|verify} messages. + * @param message Comment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IComment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Comment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Comment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Comment; + + /** + * Decodes a Comment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Comment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Comment; + + /** + * Verifies a Comment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Comment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Comment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Comment; + + /** + * Creates a plain object from a Comment message. Also converts values to other types if specified. + * @param message Comment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.Comment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Comment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Comment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CommentService */ + class CommentService extends $protobuf.rpc.Service { + + /** + * Constructs a new CommentService 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 CommentService 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): CommentService; + + /** + * Calls ListComments. + * @param request ListCommentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCommentsResponse + */ + public listComments(request: google.cloud.support.v2.IListCommentsRequest, callback: google.cloud.support.v2.CommentService.ListCommentsCallback): void; + + /** + * Calls ListComments. + * @param request ListCommentsRequest message or plain object + * @returns Promise + */ + public listComments(request: google.cloud.support.v2.IListCommentsRequest): Promise; + + /** + * Calls CreateComment. + * @param request CreateCommentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Comment + */ + public createComment(request: google.cloud.support.v2.ICreateCommentRequest, callback: google.cloud.support.v2.CommentService.CreateCommentCallback): void; + + /** + * Calls CreateComment. + * @param request CreateCommentRequest message or plain object + * @returns Promise + */ + public createComment(request: google.cloud.support.v2.ICreateCommentRequest): Promise; + } + + namespace CommentService { + + /** + * Callback as used by {@link google.cloud.support.v2.CommentService|listComments}. + * @param error Error, if any + * @param [response] ListCommentsResponse + */ + type ListCommentsCallback = (error: (Error|null), response?: google.cloud.support.v2.ListCommentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CommentService|createComment}. + * @param error Error, if any + * @param [response] Comment + */ + type CreateCommentCallback = (error: (Error|null), response?: google.cloud.support.v2.Comment) => void; + } + + /** Properties of a ListCommentsRequest. */ + interface IListCommentsRequest { + + /** ListCommentsRequest parent */ + parent?: (string|null); + + /** ListCommentsRequest pageSize */ + pageSize?: (number|null); + + /** ListCommentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCommentsRequest. */ + class ListCommentsRequest implements IListCommentsRequest { + + /** + * Constructs a new ListCommentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IListCommentsRequest); + + /** ListCommentsRequest parent. */ + public parent: string; + + /** ListCommentsRequest pageSize. */ + public pageSize: number; + + /** ListCommentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCommentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCommentsRequest instance + */ + public static create(properties?: google.cloud.support.v2.IListCommentsRequest): google.cloud.support.v2.ListCommentsRequest; + + /** + * Encodes the specified ListCommentsRequest message. Does not implicitly {@link google.cloud.support.v2.ListCommentsRequest.verify|verify} messages. + * @param message ListCommentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IListCommentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCommentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCommentsRequest.verify|verify} messages. + * @param message ListCommentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IListCommentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCommentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCommentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListCommentsRequest; + + /** + * Decodes a ListCommentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCommentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListCommentsRequest; + + /** + * Verifies a ListCommentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCommentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCommentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListCommentsRequest; + + /** + * Creates a plain object from a ListCommentsRequest message. Also converts values to other types if specified. + * @param message ListCommentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.ListCommentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCommentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCommentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCommentsResponse. */ + interface IListCommentsResponse { + + /** ListCommentsResponse comments */ + comments?: (google.cloud.support.v2.IComment[]|null); + + /** ListCommentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCommentsResponse. */ + class ListCommentsResponse implements IListCommentsResponse { + + /** + * Constructs a new ListCommentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IListCommentsResponse); + + /** ListCommentsResponse comments. */ + public comments: google.cloud.support.v2.IComment[]; + + /** ListCommentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCommentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCommentsResponse instance + */ + public static create(properties?: google.cloud.support.v2.IListCommentsResponse): google.cloud.support.v2.ListCommentsResponse; + + /** + * Encodes the specified ListCommentsResponse message. Does not implicitly {@link google.cloud.support.v2.ListCommentsResponse.verify|verify} messages. + * @param message ListCommentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IListCommentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCommentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCommentsResponse.verify|verify} messages. + * @param message ListCommentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IListCommentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCommentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCommentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListCommentsResponse; + + /** + * Decodes a ListCommentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCommentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListCommentsResponse; + + /** + * Verifies a ListCommentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCommentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCommentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListCommentsResponse; + + /** + * Creates a plain object from a ListCommentsResponse message. Also converts values to other types if specified. + * @param message ListCommentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.ListCommentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCommentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCommentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCommentRequest. */ + interface ICreateCommentRequest { + + /** CreateCommentRequest parent */ + parent?: (string|null); + + /** CreateCommentRequest comment */ + comment?: (google.cloud.support.v2.IComment|null); + } + + /** Represents a CreateCommentRequest. */ + class CreateCommentRequest implements ICreateCommentRequest { + + /** + * Constructs a new CreateCommentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ICreateCommentRequest); + + /** CreateCommentRequest parent. */ + public parent: string; + + /** CreateCommentRequest comment. */ + public comment?: (google.cloud.support.v2.IComment|null); + + /** + * Creates a new CreateCommentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCommentRequest instance + */ + public static create(properties?: google.cloud.support.v2.ICreateCommentRequest): google.cloud.support.v2.CreateCommentRequest; + + /** + * Encodes the specified CreateCommentRequest message. Does not implicitly {@link google.cloud.support.v2.CreateCommentRequest.verify|verify} messages. + * @param message CreateCommentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ICreateCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CreateCommentRequest.verify|verify} messages. + * @param message CreateCommentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ICreateCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCommentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.CreateCommentRequest; + + /** + * Decodes a CreateCommentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.CreateCommentRequest; + + /** + * Verifies a CreateCommentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCommentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCommentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.CreateCommentRequest; + + /** + * Creates a plain object from a CreateCommentRequest message. Also converts values to other types if specified. + * @param message CreateCommentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.CreateCommentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCommentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCommentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v2beta. */ + namespace v2beta { + + /** Properties of an Actor. */ + interface IActor { + + /** Actor displayName */ + displayName?: (string|null); + + /** Actor email */ + email?: (string|null); + + /** Actor googleSupport */ + googleSupport?: (boolean|null); + + /** Actor username */ + username?: (string|null); + } + + /** Represents an Actor. */ + class Actor implements IActor { + + /** + * Constructs a new Actor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IActor); + + /** Actor displayName. */ + public displayName: string; + + /** Actor email. */ + public email: string; + + /** Actor googleSupport. */ + public googleSupport: boolean; + + /** Actor username. */ + public username: string; + + /** + * Creates a new Actor instance using the specified properties. + * @param [properties] Properties to set + * @returns Actor instance + */ + public static create(properties?: google.cloud.support.v2beta.IActor): google.cloud.support.v2beta.Actor; + + /** + * Encodes the specified Actor message. Does not implicitly {@link google.cloud.support.v2beta.Actor.verify|verify} messages. + * @param message Actor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IActor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Actor message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Actor.verify|verify} messages. + * @param message Actor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IActor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Actor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Actor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.Actor; + + /** + * Decodes an Actor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Actor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.Actor; + + /** + * Verifies an Actor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Actor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Actor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.Actor; + + /** + * Creates a plain object from an Actor message. Also converts values to other types if specified. + * @param message Actor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.Actor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Actor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Actor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Attachment. */ + interface IAttachment { + + /** Attachment name */ + name?: (string|null); + + /** Attachment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Attachment creator */ + creator?: (google.cloud.support.v2beta.IActor|null); + + /** Attachment filename */ + filename?: (string|null); + + /** Attachment mimeType */ + mimeType?: (string|null); + + /** Attachment sizeBytes */ + sizeBytes?: (number|Long|string|null); + } + + /** Represents an Attachment. */ + class Attachment implements IAttachment { + + /** + * Constructs a new Attachment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IAttachment); + + /** Attachment name. */ + public name: string; + + /** Attachment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Attachment creator. */ + public creator?: (google.cloud.support.v2beta.IActor|null); + + /** Attachment filename. */ + public filename: string; + + /** Attachment mimeType. */ + public mimeType: string; + + /** Attachment sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** + * Creates a new Attachment instance using the specified properties. + * @param [properties] Properties to set + * @returns Attachment instance + */ + public static create(properties?: google.cloud.support.v2beta.IAttachment): google.cloud.support.v2beta.Attachment; + + /** + * Encodes the specified Attachment message. Does not implicitly {@link google.cloud.support.v2beta.Attachment.verify|verify} messages. + * @param message Attachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Attachment.verify|verify} messages. + * @param message Attachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Attachment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Attachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.Attachment; + + /** + * Decodes an Attachment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Attachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.Attachment; + + /** + * Verifies an Attachment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Attachment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Attachment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.Attachment; + + /** + * Creates a plain object from an Attachment message. Also converts values to other types if specified. + * @param message Attachment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.Attachment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Attachment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Attachment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CaseAttachmentService */ + class CaseAttachmentService extends $protobuf.rpc.Service { + + /** + * Constructs a new CaseAttachmentService 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 CaseAttachmentService 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): CaseAttachmentService; + + /** + * Calls ListAttachments. + * @param request ListAttachmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAttachmentsResponse + */ + public listAttachments(request: google.cloud.support.v2beta.IListAttachmentsRequest, callback: google.cloud.support.v2beta.CaseAttachmentService.ListAttachmentsCallback): void; + + /** + * Calls ListAttachments. + * @param request ListAttachmentsRequest message or plain object + * @returns Promise + */ + public listAttachments(request: google.cloud.support.v2beta.IListAttachmentsRequest): Promise; + + /** + * Calls GetAttachment. + * @param request GetAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Attachment + */ + public getAttachment(request: google.cloud.support.v2beta.IGetAttachmentRequest, callback: google.cloud.support.v2beta.CaseAttachmentService.GetAttachmentCallback): void; + + /** + * Calls GetAttachment. + * @param request GetAttachmentRequest message or plain object + * @returns Promise + */ + public getAttachment(request: google.cloud.support.v2beta.IGetAttachmentRequest): Promise; + } + + namespace CaseAttachmentService { + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseAttachmentService|listAttachments}. + * @param error Error, if any + * @param [response] ListAttachmentsResponse + */ + type ListAttachmentsCallback = (error: (Error|null), response?: google.cloud.support.v2beta.ListAttachmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseAttachmentService|getAttachment}. + * @param error Error, if any + * @param [response] Attachment + */ + type GetAttachmentCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Attachment) => void; + } + + /** Properties of a ListAttachmentsRequest. */ + interface IListAttachmentsRequest { + + /** ListAttachmentsRequest parent */ + parent?: (string|null); + + /** ListAttachmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListAttachmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAttachmentsRequest. */ + class ListAttachmentsRequest implements IListAttachmentsRequest { + + /** + * Constructs a new ListAttachmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IListAttachmentsRequest); + + /** ListAttachmentsRequest parent. */ + public parent: string; + + /** ListAttachmentsRequest pageSize. */ + public pageSize: number; + + /** ListAttachmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAttachmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttachmentsRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.IListAttachmentsRequest): google.cloud.support.v2beta.ListAttachmentsRequest; + + /** + * Encodes the specified ListAttachmentsRequest message. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsRequest.verify|verify} messages. + * @param message ListAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IListAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsRequest.verify|verify} messages. + * @param message ListAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IListAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttachmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ListAttachmentsRequest; + + /** + * Decodes a ListAttachmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ListAttachmentsRequest; + + /** + * Verifies a ListAttachmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttachmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ListAttachmentsRequest; + + /** + * Creates a plain object from a ListAttachmentsRequest message. Also converts values to other types if specified. + * @param message ListAttachmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.ListAttachmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttachmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttachmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAttachmentRequest. */ + interface IGetAttachmentRequest { + + /** GetAttachmentRequest name */ + name?: (string|null); + } + + /** Represents a GetAttachmentRequest. */ + class GetAttachmentRequest implements IGetAttachmentRequest { + + /** + * Constructs a new GetAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IGetAttachmentRequest); + + /** GetAttachmentRequest name. */ + public name: string; + + /** + * Creates a new GetAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAttachmentRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.IGetAttachmentRequest): google.cloud.support.v2beta.GetAttachmentRequest; + + /** + * Encodes the specified GetAttachmentRequest message. Does not implicitly {@link google.cloud.support.v2beta.GetAttachmentRequest.verify|verify} messages. + * @param message GetAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IGetAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.GetAttachmentRequest.verify|verify} messages. + * @param message GetAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IGetAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.GetAttachmentRequest; + + /** + * Decodes a GetAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.GetAttachmentRequest; + + /** + * Verifies a GetAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.GetAttachmentRequest; + + /** + * Creates a plain object from a GetAttachmentRequest message. Also converts values to other types if specified. + * @param message GetAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.GetAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAttachmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAttachmentsResponse. */ + interface IListAttachmentsResponse { + + /** ListAttachmentsResponse attachments */ + attachments?: (google.cloud.support.v2beta.IAttachment[]|null); + + /** ListAttachmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAttachmentsResponse. */ + class ListAttachmentsResponse implements IListAttachmentsResponse { + + /** + * Constructs a new ListAttachmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IListAttachmentsResponse); + + /** ListAttachmentsResponse attachments. */ + public attachments: google.cloud.support.v2beta.IAttachment[]; + + /** ListAttachmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAttachmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttachmentsResponse instance + */ + public static create(properties?: google.cloud.support.v2beta.IListAttachmentsResponse): google.cloud.support.v2beta.ListAttachmentsResponse; + + /** + * Encodes the specified ListAttachmentsResponse message. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsResponse.verify|verify} messages. + * @param message ListAttachmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IListAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsResponse.verify|verify} messages. + * @param message ListAttachmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IListAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttachmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ListAttachmentsResponse; + + /** + * Decodes a ListAttachmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ListAttachmentsResponse; + + /** + * Verifies a ListAttachmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttachmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttachmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ListAttachmentsResponse; + + /** + * Creates a plain object from a ListAttachmentsResponse message. Also converts values to other types if specified. + * @param message ListAttachmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.ListAttachmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttachmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttachmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ProductLine enum. */ + enum ProductLine { + PRODUCT_LINE_UNSPECIFIED = 0, + GOOGLE_CLOUD = 1, + GOOGLE_MAPS = 2 + } + + /** Properties of a Case. */ + interface ICase { + + /** Case name */ + name?: (string|null); + + /** Case displayName */ + displayName?: (string|null); + + /** Case description */ + description?: (string|null); + + /** Case classification */ + classification?: (google.cloud.support.v2beta.ICaseClassification|null); + + /** Case timeZone */ + timeZone?: (string|null); + + /** Case subscriberEmailAddresses */ + subscriberEmailAddresses?: (string[]|null); + + /** Case state */ + state?: (google.cloud.support.v2beta.Case.State|keyof typeof google.cloud.support.v2beta.Case.State|null); + + /** Case createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Case updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Case creator */ + creator?: (google.cloud.support.v2beta.IActor|null); + + /** Case contactEmail */ + contactEmail?: (string|null); + + /** Case escalated */ + escalated?: (boolean|null); + + /** Case testCase */ + testCase?: (boolean|null); + + /** Case languageCode */ + languageCode?: (string|null); + + /** Case priority */ + priority?: (google.cloud.support.v2beta.Case.Priority|keyof typeof google.cloud.support.v2beta.Case.Priority|null); + } + + /** Represents a Case. */ + class Case implements ICase { + + /** + * Constructs a new Case. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.ICase); + + /** Case name. */ + public name: string; + + /** Case displayName. */ + public displayName: string; + + /** Case description. */ + public description: string; + + /** Case classification. */ + public classification?: (google.cloud.support.v2beta.ICaseClassification|null); + + /** Case timeZone. */ + public timeZone: string; + + /** Case subscriberEmailAddresses. */ + public subscriberEmailAddresses: string[]; + + /** Case state. */ + public state: (google.cloud.support.v2beta.Case.State|keyof typeof google.cloud.support.v2beta.Case.State); + + /** Case createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Case updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Case creator. */ + public creator?: (google.cloud.support.v2beta.IActor|null); + + /** Case contactEmail. */ + public contactEmail: string; + + /** Case escalated. */ + public escalated: boolean; + + /** Case testCase. */ + public testCase: boolean; + + /** Case languageCode. */ + public languageCode: string; + + /** Case priority. */ + public priority: (google.cloud.support.v2beta.Case.Priority|keyof typeof google.cloud.support.v2beta.Case.Priority); + + /** + * Creates a new Case instance using the specified properties. + * @param [properties] Properties to set + * @returns Case instance + */ + public static create(properties?: google.cloud.support.v2beta.ICase): google.cloud.support.v2beta.Case; + + /** + * Encodes the specified Case message. Does not implicitly {@link google.cloud.support.v2beta.Case.verify|verify} messages. + * @param message Case message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.ICase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Case.verify|verify} messages. + * @param message Case message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.ICase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Case message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.Case; + + /** + * Decodes a Case message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.Case; + + /** + * Verifies a Case message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Case message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Case + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.Case; + + /** + * Creates a plain object from a Case message. Also converts values to other types if specified. + * @param message Case + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.Case, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Case to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Case + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Case { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + NEW = 1, + IN_PROGRESS_GOOGLE_SUPPORT = 2, + ACTION_REQUIRED = 3, + SOLUTION_PROVIDED = 4, + CLOSED = 5 + } + + /** Priority enum. */ + enum Priority { + PRIORITY_UNSPECIFIED = 0, + P0 = 1, + P1 = 2, + P2 = 3, + P3 = 4, + P4 = 5 + } + } + + /** Properties of a CaseClassification. */ + interface ICaseClassification { + + /** CaseClassification id */ + id?: (string|null); + + /** CaseClassification displayName */ + displayName?: (string|null); + + /** CaseClassification product */ + product?: (google.cloud.support.v2beta.IProduct|null); + } + + /** Represents a CaseClassification. */ + class CaseClassification implements ICaseClassification { + + /** + * Constructs a new CaseClassification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.ICaseClassification); + + /** CaseClassification id. */ + public id: string; + + /** CaseClassification displayName. */ + public displayName: string; + + /** CaseClassification product. */ + public product?: (google.cloud.support.v2beta.IProduct|null); + + /** + * Creates a new CaseClassification instance using the specified properties. + * @param [properties] Properties to set + * @returns CaseClassification instance + */ + public static create(properties?: google.cloud.support.v2beta.ICaseClassification): google.cloud.support.v2beta.CaseClassification; + + /** + * Encodes the specified CaseClassification message. Does not implicitly {@link google.cloud.support.v2beta.CaseClassification.verify|verify} messages. + * @param message CaseClassification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.ICaseClassification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaseClassification message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CaseClassification.verify|verify} messages. + * @param message CaseClassification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.ICaseClassification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaseClassification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaseClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.CaseClassification; + + /** + * Decodes a CaseClassification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaseClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.CaseClassification; + + /** + * Verifies a CaseClassification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CaseClassification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaseClassification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.CaseClassification; + + /** + * Creates a plain object from a CaseClassification message. Also converts values to other types if specified. + * @param message CaseClassification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.CaseClassification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaseClassification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaseClassification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Product. */ + interface IProduct { + + /** Product productLine */ + productLine?: (google.cloud.support.v2beta.ProductLine|keyof typeof google.cloud.support.v2beta.ProductLine|null); + } + + /** Represents a Product. */ + class Product implements IProduct { + + /** + * Constructs a new Product. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IProduct); + + /** Product productLine. */ + public productLine: (google.cloud.support.v2beta.ProductLine|keyof typeof google.cloud.support.v2beta.ProductLine); + + /** + * Creates a new Product instance using the specified properties. + * @param [properties] Properties to set + * @returns Product instance + */ + public static create(properties?: google.cloud.support.v2beta.IProduct): google.cloud.support.v2beta.Product; + + /** + * Encodes the specified Product message. Does not implicitly {@link google.cloud.support.v2beta.Product.verify|verify} messages. + * @param message Product message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Product.verify|verify} messages. + * @param message Product message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Product message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.Product; + + /** + * Decodes a Product message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.Product; + + /** + * Verifies a Product message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Product message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Product + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.Product; + + /** + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @param message Product + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Product to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Product + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CaseService */ + class CaseService extends $protobuf.rpc.Service { + + /** + * Constructs a new CaseService 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 CaseService 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): CaseService; + + /** + * Calls GetCase. + * @param request GetCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public getCase(request: google.cloud.support.v2beta.IGetCaseRequest, callback: google.cloud.support.v2beta.CaseService.GetCaseCallback): void; + + /** + * Calls GetCase. + * @param request GetCaseRequest message or plain object + * @returns Promise + */ + public getCase(request: google.cloud.support.v2beta.IGetCaseRequest): Promise; + + /** + * Calls ListCases. + * @param request ListCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCasesResponse + */ + public listCases(request: google.cloud.support.v2beta.IListCasesRequest, callback: google.cloud.support.v2beta.CaseService.ListCasesCallback): void; + + /** + * Calls ListCases. + * @param request ListCasesRequest message or plain object + * @returns Promise + */ + public listCases(request: google.cloud.support.v2beta.IListCasesRequest): Promise; + + /** + * Calls SearchCases. + * @param request SearchCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchCasesResponse + */ + public searchCases(request: google.cloud.support.v2beta.ISearchCasesRequest, callback: google.cloud.support.v2beta.CaseService.SearchCasesCallback): void; + + /** + * Calls SearchCases. + * @param request SearchCasesRequest message or plain object + * @returns Promise + */ + public searchCases(request: google.cloud.support.v2beta.ISearchCasesRequest): Promise; + + /** + * Calls CreateCase. + * @param request CreateCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public createCase(request: google.cloud.support.v2beta.ICreateCaseRequest, callback: google.cloud.support.v2beta.CaseService.CreateCaseCallback): void; + + /** + * Calls CreateCase. + * @param request CreateCaseRequest message or plain object + * @returns Promise + */ + public createCase(request: google.cloud.support.v2beta.ICreateCaseRequest): Promise; + + /** + * Calls UpdateCase. + * @param request UpdateCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public updateCase(request: google.cloud.support.v2beta.IUpdateCaseRequest, callback: google.cloud.support.v2beta.CaseService.UpdateCaseCallback): void; + + /** + * Calls UpdateCase. + * @param request UpdateCaseRequest message or plain object + * @returns Promise + */ + public updateCase(request: google.cloud.support.v2beta.IUpdateCaseRequest): Promise; + + /** + * Calls EscalateCase. + * @param request EscalateCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public escalateCase(request: google.cloud.support.v2beta.IEscalateCaseRequest, callback: google.cloud.support.v2beta.CaseService.EscalateCaseCallback): void; + + /** + * Calls EscalateCase. + * @param request EscalateCaseRequest message or plain object + * @returns Promise + */ + public escalateCase(request: google.cloud.support.v2beta.IEscalateCaseRequest): Promise; + + /** + * Calls CloseCase. + * @param request CloseCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public closeCase(request: google.cloud.support.v2beta.ICloseCaseRequest, callback: google.cloud.support.v2beta.CaseService.CloseCaseCallback): void; + + /** + * Calls CloseCase. + * @param request CloseCaseRequest message or plain object + * @returns Promise + */ + public closeCase(request: google.cloud.support.v2beta.ICloseCaseRequest): Promise; + + /** + * Calls SearchCaseClassifications. + * @param request SearchCaseClassificationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchCaseClassificationsResponse + */ + public searchCaseClassifications(request: google.cloud.support.v2beta.ISearchCaseClassificationsRequest, callback: google.cloud.support.v2beta.CaseService.SearchCaseClassificationsCallback): void; + + /** + * Calls SearchCaseClassifications. + * @param request SearchCaseClassificationsRequest message or plain object + * @returns Promise + */ + public searchCaseClassifications(request: google.cloud.support.v2beta.ISearchCaseClassificationsRequest): Promise; + } + + namespace CaseService { + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|getCase}. + * @param error Error, if any + * @param [response] Case + */ + type GetCaseCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|listCases}. + * @param error Error, if any + * @param [response] ListCasesResponse + */ + type ListCasesCallback = (error: (Error|null), response?: google.cloud.support.v2beta.ListCasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|searchCases}. + * @param error Error, if any + * @param [response] SearchCasesResponse + */ + type SearchCasesCallback = (error: (Error|null), response?: google.cloud.support.v2beta.SearchCasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|createCase}. + * @param error Error, if any + * @param [response] Case + */ + type CreateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|updateCase}. + * @param error Error, if any + * @param [response] Case + */ + type UpdateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|escalateCase}. + * @param error Error, if any + * @param [response] Case + */ + type EscalateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|closeCase}. + * @param error Error, if any + * @param [response] Case + */ + type CloseCaseCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|searchCaseClassifications}. + * @param error Error, if any + * @param [response] SearchCaseClassificationsResponse + */ + type SearchCaseClassificationsCallback = (error: (Error|null), response?: google.cloud.support.v2beta.SearchCaseClassificationsResponse) => void; + } + + /** Properties of a GetCaseRequest. */ + interface IGetCaseRequest { + + /** GetCaseRequest name */ + name?: (string|null); + } + + /** Represents a GetCaseRequest. */ + class GetCaseRequest implements IGetCaseRequest { + + /** + * Constructs a new GetCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IGetCaseRequest); + + /** GetCaseRequest name. */ + public name: string; + + /** + * Creates a new GetCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.IGetCaseRequest): google.cloud.support.v2beta.GetCaseRequest; + + /** + * Encodes the specified GetCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.GetCaseRequest.verify|verify} messages. + * @param message GetCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IGetCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.GetCaseRequest.verify|verify} messages. + * @param message GetCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IGetCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.GetCaseRequest; + + /** + * Decodes a GetCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.GetCaseRequest; + + /** + * Verifies a GetCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.GetCaseRequest; + + /** + * Creates a plain object from a GetCaseRequest message. Also converts values to other types if specified. + * @param message GetCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.GetCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCaseRequest. */ + interface ICreateCaseRequest { + + /** CreateCaseRequest parent */ + parent?: (string|null); + + /** CreateCaseRequest case */ + "case"?: (google.cloud.support.v2beta.ICase|null); + } + + /** Represents a CreateCaseRequest. */ + class CreateCaseRequest implements ICreateCaseRequest { + + /** + * Constructs a new CreateCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.ICreateCaseRequest); + + /** CreateCaseRequest parent. */ + public parent: string; + + /** CreateCaseRequest case. */ + public case?: (google.cloud.support.v2beta.ICase|null); + + /** + * Creates a new CreateCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.ICreateCaseRequest): google.cloud.support.v2beta.CreateCaseRequest; + + /** + * Encodes the specified CreateCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.CreateCaseRequest.verify|verify} messages. + * @param message CreateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.ICreateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CreateCaseRequest.verify|verify} messages. + * @param message CreateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.ICreateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.CreateCaseRequest; + + /** + * Decodes a CreateCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.CreateCaseRequest; + + /** + * Verifies a CreateCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.CreateCaseRequest; + + /** + * Creates a plain object from a CreateCaseRequest message. Also converts values to other types if specified. + * @param message CreateCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.CreateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCasesRequest. */ + interface IListCasesRequest { + + /** ListCasesRequest parent */ + parent?: (string|null); + + /** ListCasesRequest filter */ + filter?: (string|null); + + /** ListCasesRequest pageSize */ + pageSize?: (number|null); + + /** ListCasesRequest pageToken */ + pageToken?: (string|null); + + /** ListCasesRequest productLine */ + productLine?: (google.cloud.support.v2beta.ProductLine|keyof typeof google.cloud.support.v2beta.ProductLine|null); + } + + /** Represents a ListCasesRequest. */ + class ListCasesRequest implements IListCasesRequest { + + /** + * Constructs a new ListCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IListCasesRequest); + + /** ListCasesRequest parent. */ + public parent: string; + + /** ListCasesRequest filter. */ + public filter: string; + + /** ListCasesRequest pageSize. */ + public pageSize: number; + + /** ListCasesRequest pageToken. */ + public pageToken: string; + + /** ListCasesRequest productLine. */ + public productLine?: (google.cloud.support.v2beta.ProductLine|keyof typeof google.cloud.support.v2beta.ProductLine|null); + + /** + * Creates a new ListCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCasesRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.IListCasesRequest): google.cloud.support.v2beta.ListCasesRequest; + + /** + * Encodes the specified ListCasesRequest message. Does not implicitly {@link google.cloud.support.v2beta.ListCasesRequest.verify|verify} messages. + * @param message ListCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IListCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCasesRequest.verify|verify} messages. + * @param message ListCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IListCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ListCasesRequest; + + /** + * Decodes a ListCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ListCasesRequest; + + /** + * Verifies a ListCasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ListCasesRequest; + + /** + * Creates a plain object from a ListCasesRequest message. Also converts values to other types if specified. + * @param message ListCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.ListCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCasesResponse. */ + interface IListCasesResponse { + + /** ListCasesResponse cases */ + cases?: (google.cloud.support.v2beta.ICase[]|null); + + /** ListCasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCasesResponse. */ + class ListCasesResponse implements IListCasesResponse { + + /** + * Constructs a new ListCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IListCasesResponse); + + /** ListCasesResponse cases. */ + public cases: google.cloud.support.v2beta.ICase[]; + + /** ListCasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCasesResponse instance + */ + public static create(properties?: google.cloud.support.v2beta.IListCasesResponse): google.cloud.support.v2beta.ListCasesResponse; + + /** + * Encodes the specified ListCasesResponse message. Does not implicitly {@link google.cloud.support.v2beta.ListCasesResponse.verify|verify} messages. + * @param message ListCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IListCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCasesResponse.verify|verify} messages. + * @param message ListCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IListCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ListCasesResponse; + + /** + * Decodes a ListCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ListCasesResponse; + + /** + * Verifies a ListCasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ListCasesResponse; + + /** + * Creates a plain object from a ListCasesResponse message. Also converts values to other types if specified. + * @param message ListCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.ListCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchCasesRequest. */ + interface ISearchCasesRequest { + + /** SearchCasesRequest parent */ + parent?: (string|null); + + /** SearchCasesRequest query */ + query?: (string|null); + + /** SearchCasesRequest pageSize */ + pageSize?: (number|null); + + /** SearchCasesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchCasesRequest. */ + class SearchCasesRequest implements ISearchCasesRequest { + + /** + * Constructs a new SearchCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.ISearchCasesRequest); + + /** SearchCasesRequest parent. */ + public parent: string; + + /** SearchCasesRequest query. */ + public query: string; + + /** SearchCasesRequest pageSize. */ + public pageSize: number; + + /** SearchCasesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCasesRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.ISearchCasesRequest): google.cloud.support.v2beta.SearchCasesRequest; + + /** + * Encodes the specified SearchCasesRequest message. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesRequest.verify|verify} messages. + * @param message SearchCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.ISearchCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesRequest.verify|verify} messages. + * @param message SearchCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.ISearchCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.SearchCasesRequest; + + /** + * Decodes a SearchCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.SearchCasesRequest; + + /** + * Verifies a SearchCasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.SearchCasesRequest; + + /** + * Creates a plain object from a SearchCasesRequest message. Also converts values to other types if specified. + * @param message SearchCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.SearchCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchCasesResponse. */ + interface ISearchCasesResponse { + + /** SearchCasesResponse cases */ + cases?: (google.cloud.support.v2beta.ICase[]|null); + + /** SearchCasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchCasesResponse. */ + class SearchCasesResponse implements ISearchCasesResponse { + + /** + * Constructs a new SearchCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.ISearchCasesResponse); + + /** SearchCasesResponse cases. */ + public cases: google.cloud.support.v2beta.ICase[]; + + /** SearchCasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCasesResponse instance + */ + public static create(properties?: google.cloud.support.v2beta.ISearchCasesResponse): google.cloud.support.v2beta.SearchCasesResponse; + + /** + * Encodes the specified SearchCasesResponse message. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesResponse.verify|verify} messages. + * @param message SearchCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.ISearchCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesResponse.verify|verify} messages. + * @param message SearchCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.ISearchCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.SearchCasesResponse; + + /** + * Decodes a SearchCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.SearchCasesResponse; + + /** + * Verifies a SearchCasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.SearchCasesResponse; + + /** + * Creates a plain object from a SearchCasesResponse message. Also converts values to other types if specified. + * @param message SearchCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.SearchCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EscalateCaseRequest. */ + interface IEscalateCaseRequest { + + /** EscalateCaseRequest name */ + name?: (string|null); + + /** EscalateCaseRequest escalation */ + escalation?: (google.cloud.support.v2beta.IEscalation|null); + } + + /** Represents an EscalateCaseRequest. */ + class EscalateCaseRequest implements IEscalateCaseRequest { + + /** + * Constructs a new EscalateCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IEscalateCaseRequest); + + /** EscalateCaseRequest name. */ + public name: string; + + /** EscalateCaseRequest escalation. */ + public escalation?: (google.cloud.support.v2beta.IEscalation|null); + + /** + * Creates a new EscalateCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EscalateCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.IEscalateCaseRequest): google.cloud.support.v2beta.EscalateCaseRequest; + + /** + * Encodes the specified EscalateCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.EscalateCaseRequest.verify|verify} messages. + * @param message EscalateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IEscalateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EscalateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.EscalateCaseRequest.verify|verify} messages. + * @param message EscalateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IEscalateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EscalateCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EscalateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.EscalateCaseRequest; + + /** + * Decodes an EscalateCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EscalateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.EscalateCaseRequest; + + /** + * Verifies an EscalateCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EscalateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EscalateCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.EscalateCaseRequest; + + /** + * Creates a plain object from an EscalateCaseRequest message. Also converts values to other types if specified. + * @param message EscalateCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.EscalateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EscalateCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EscalateCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCaseRequest. */ + interface IUpdateCaseRequest { + + /** UpdateCaseRequest case */ + "case"?: (google.cloud.support.v2beta.ICase|null); + + /** UpdateCaseRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCaseRequest. */ + class UpdateCaseRequest implements IUpdateCaseRequest { + + /** + * Constructs a new UpdateCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IUpdateCaseRequest); + + /** UpdateCaseRequest case. */ + public case?: (google.cloud.support.v2beta.ICase|null); + + /** UpdateCaseRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.IUpdateCaseRequest): google.cloud.support.v2beta.UpdateCaseRequest; + + /** + * Encodes the specified UpdateCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.UpdateCaseRequest.verify|verify} messages. + * @param message UpdateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IUpdateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.UpdateCaseRequest.verify|verify} messages. + * @param message UpdateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IUpdateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.UpdateCaseRequest; + + /** + * Decodes an UpdateCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.UpdateCaseRequest; + + /** + * Verifies an UpdateCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.UpdateCaseRequest; + + /** + * Creates a plain object from an UpdateCaseRequest message. Also converts values to other types if specified. + * @param message UpdateCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.UpdateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloseCaseRequest. */ + interface ICloseCaseRequest { + + /** CloseCaseRequest name */ + name?: (string|null); + } + + /** Represents a CloseCaseRequest. */ + class CloseCaseRequest implements ICloseCaseRequest { + + /** + * Constructs a new CloseCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.ICloseCaseRequest); + + /** CloseCaseRequest name. */ + public name: string; + + /** + * Creates a new CloseCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CloseCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.ICloseCaseRequest): google.cloud.support.v2beta.CloseCaseRequest; + + /** + * Encodes the specified CloseCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.CloseCaseRequest.verify|verify} messages. + * @param message CloseCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.ICloseCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloseCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CloseCaseRequest.verify|verify} messages. + * @param message CloseCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.ICloseCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloseCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloseCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.CloseCaseRequest; + + /** + * Decodes a CloseCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloseCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.CloseCaseRequest; + + /** + * Verifies a CloseCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloseCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloseCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.CloseCaseRequest; + + /** + * Creates a plain object from a CloseCaseRequest message. Also converts values to other types if specified. + * @param message CloseCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.CloseCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloseCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloseCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchCaseClassificationsRequest. */ + interface ISearchCaseClassificationsRequest { + + /** SearchCaseClassificationsRequest query */ + query?: (string|null); + + /** SearchCaseClassificationsRequest pageSize */ + pageSize?: (number|null); + + /** SearchCaseClassificationsRequest pageToken */ + pageToken?: (string|null); + + /** SearchCaseClassificationsRequest product */ + product?: (google.cloud.support.v2beta.IProduct|null); + } + + /** Represents a SearchCaseClassificationsRequest. */ + class SearchCaseClassificationsRequest implements ISearchCaseClassificationsRequest { + + /** + * Constructs a new SearchCaseClassificationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.ISearchCaseClassificationsRequest); + + /** SearchCaseClassificationsRequest query. */ + public query: string; + + /** SearchCaseClassificationsRequest pageSize. */ + public pageSize: number; + + /** SearchCaseClassificationsRequest pageToken. */ + public pageToken: string; + + /** SearchCaseClassificationsRequest product. */ + public product?: (google.cloud.support.v2beta.IProduct|null); + + /** + * Creates a new SearchCaseClassificationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCaseClassificationsRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.ISearchCaseClassificationsRequest): google.cloud.support.v2beta.SearchCaseClassificationsRequest; + + /** + * Encodes the specified SearchCaseClassificationsRequest message. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsRequest.verify|verify} messages. + * @param message SearchCaseClassificationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.ISearchCaseClassificationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCaseClassificationsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsRequest.verify|verify} messages. + * @param message SearchCaseClassificationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.ISearchCaseClassificationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCaseClassificationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.SearchCaseClassificationsRequest; + + /** + * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCaseClassificationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.SearchCaseClassificationsRequest; + + /** + * Verifies a SearchCaseClassificationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCaseClassificationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCaseClassificationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.SearchCaseClassificationsRequest; + + /** + * Creates a plain object from a SearchCaseClassificationsRequest message. Also converts values to other types if specified. + * @param message SearchCaseClassificationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.SearchCaseClassificationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCaseClassificationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCaseClassificationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchCaseClassificationsResponse. */ + interface ISearchCaseClassificationsResponse { + + /** SearchCaseClassificationsResponse caseClassifications */ + caseClassifications?: (google.cloud.support.v2beta.ICaseClassification[]|null); + + /** SearchCaseClassificationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchCaseClassificationsResponse. */ + class SearchCaseClassificationsResponse implements ISearchCaseClassificationsResponse { + + /** + * Constructs a new SearchCaseClassificationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.ISearchCaseClassificationsResponse); + + /** SearchCaseClassificationsResponse caseClassifications. */ + public caseClassifications: google.cloud.support.v2beta.ICaseClassification[]; + + /** SearchCaseClassificationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchCaseClassificationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCaseClassificationsResponse instance + */ + public static create(properties?: google.cloud.support.v2beta.ISearchCaseClassificationsResponse): google.cloud.support.v2beta.SearchCaseClassificationsResponse; + + /** + * Encodes the specified SearchCaseClassificationsResponse message. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsResponse.verify|verify} messages. + * @param message SearchCaseClassificationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.ISearchCaseClassificationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCaseClassificationsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsResponse.verify|verify} messages. + * @param message SearchCaseClassificationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.ISearchCaseClassificationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCaseClassificationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.SearchCaseClassificationsResponse; + + /** + * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCaseClassificationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.SearchCaseClassificationsResponse; + + /** + * Verifies a SearchCaseClassificationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCaseClassificationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCaseClassificationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.SearchCaseClassificationsResponse; + + /** + * Creates a plain object from a SearchCaseClassificationsResponse message. Also converts values to other types if specified. + * @param message SearchCaseClassificationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.SearchCaseClassificationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCaseClassificationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCaseClassificationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Escalation. */ + interface IEscalation { + + /** Escalation reason */ + reason?: (google.cloud.support.v2beta.Escalation.Reason|keyof typeof google.cloud.support.v2beta.Escalation.Reason|null); + + /** Escalation justification */ + justification?: (string|null); + } + + /** Represents an Escalation. */ + class Escalation implements IEscalation { + + /** + * Constructs a new Escalation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IEscalation); + + /** Escalation reason. */ + public reason: (google.cloud.support.v2beta.Escalation.Reason|keyof typeof google.cloud.support.v2beta.Escalation.Reason); + + /** Escalation justification. */ + public justification: string; + + /** + * Creates a new Escalation instance using the specified properties. + * @param [properties] Properties to set + * @returns Escalation instance + */ + public static create(properties?: google.cloud.support.v2beta.IEscalation): google.cloud.support.v2beta.Escalation; + + /** + * Encodes the specified Escalation message. Does not implicitly {@link google.cloud.support.v2beta.Escalation.verify|verify} messages. + * @param message Escalation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IEscalation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Escalation message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Escalation.verify|verify} messages. + * @param message Escalation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IEscalation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Escalation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Escalation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.Escalation; + + /** + * Decodes an Escalation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Escalation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.Escalation; + + /** + * Verifies an Escalation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Escalation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Escalation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.Escalation; + + /** + * Creates a plain object from an Escalation message. Also converts values to other types if specified. + * @param message Escalation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.Escalation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Escalation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Escalation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Escalation { + + /** Reason enum. */ + enum Reason { + REASON_UNSPECIFIED = 0, + RESOLUTION_TIME = 1, + TECHNICAL_EXPERTISE = 2, + BUSINESS_IMPACT = 3 + } + } + + /** Properties of a Comment. */ + interface IComment { + + /** Comment name */ + name?: (string|null); + + /** Comment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Comment creator */ + creator?: (google.cloud.support.v2beta.IActor|null); + + /** Comment body */ + body?: (string|null); + + /** Comment plainTextBody */ + plainTextBody?: (string|null); + } + + /** Represents a Comment. */ + class Comment implements IComment { + + /** + * Constructs a new Comment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IComment); + + /** Comment name. */ + public name: string; + + /** Comment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Comment creator. */ + public creator?: (google.cloud.support.v2beta.IActor|null); + + /** Comment body. */ + public body: string; + + /** Comment plainTextBody. */ + public plainTextBody: string; + + /** + * Creates a new Comment instance using the specified properties. + * @param [properties] Properties to set + * @returns Comment instance + */ + public static create(properties?: google.cloud.support.v2beta.IComment): google.cloud.support.v2beta.Comment; + + /** + * Encodes the specified Comment message. Does not implicitly {@link google.cloud.support.v2beta.Comment.verify|verify} messages. + * @param message Comment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IComment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Comment message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Comment.verify|verify} messages. + * @param message Comment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IComment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Comment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Comment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.Comment; + + /** + * Decodes a Comment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Comment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.Comment; + + /** + * Verifies a Comment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Comment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Comment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.Comment; + + /** + * Creates a plain object from a Comment message. Also converts values to other types if specified. + * @param message Comment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.Comment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Comment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Comment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CommentService */ + class CommentService extends $protobuf.rpc.Service { + + /** + * Constructs a new CommentService 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 CommentService 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): CommentService; + + /** + * Calls ListComments. + * @param request ListCommentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCommentsResponse + */ + public listComments(request: google.cloud.support.v2beta.IListCommentsRequest, callback: google.cloud.support.v2beta.CommentService.ListCommentsCallback): void; + + /** + * Calls ListComments. + * @param request ListCommentsRequest message or plain object + * @returns Promise + */ + public listComments(request: google.cloud.support.v2beta.IListCommentsRequest): Promise; + + /** + * Calls CreateComment. + * @param request CreateCommentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Comment + */ + public createComment(request: google.cloud.support.v2beta.ICreateCommentRequest, callback: google.cloud.support.v2beta.CommentService.CreateCommentCallback): void; + + /** + * Calls CreateComment. + * @param request CreateCommentRequest message or plain object + * @returns Promise + */ + public createComment(request: google.cloud.support.v2beta.ICreateCommentRequest): Promise; + + /** + * Calls GetComment. + * @param request GetCommentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Comment + */ + public getComment(request: google.cloud.support.v2beta.IGetCommentRequest, callback: google.cloud.support.v2beta.CommentService.GetCommentCallback): void; + + /** + * Calls GetComment. + * @param request GetCommentRequest message or plain object + * @returns Promise + */ + public getComment(request: google.cloud.support.v2beta.IGetCommentRequest): Promise; + } + + namespace CommentService { + + /** + * Callback as used by {@link google.cloud.support.v2beta.CommentService|listComments}. + * @param error Error, if any + * @param [response] ListCommentsResponse + */ + type ListCommentsCallback = (error: (Error|null), response?: google.cloud.support.v2beta.ListCommentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CommentService|createComment}. + * @param error Error, if any + * @param [response] Comment + */ + type CreateCommentCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Comment) => void; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CommentService|getComment}. + * @param error Error, if any + * @param [response] Comment + */ + type GetCommentCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Comment) => void; + } + + /** Properties of a ListCommentsRequest. */ + interface IListCommentsRequest { + + /** ListCommentsRequest parent */ + parent?: (string|null); + + /** ListCommentsRequest pageSize */ + pageSize?: (number|null); + + /** ListCommentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCommentsRequest. */ + class ListCommentsRequest implements IListCommentsRequest { + + /** + * Constructs a new ListCommentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IListCommentsRequest); + + /** ListCommentsRequest parent. */ + public parent: string; + + /** ListCommentsRequest pageSize. */ + public pageSize: number; + + /** ListCommentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCommentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCommentsRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.IListCommentsRequest): google.cloud.support.v2beta.ListCommentsRequest; + + /** + * Encodes the specified ListCommentsRequest message. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsRequest.verify|verify} messages. + * @param message ListCommentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IListCommentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCommentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsRequest.verify|verify} messages. + * @param message ListCommentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IListCommentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCommentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCommentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ListCommentsRequest; + + /** + * Decodes a ListCommentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCommentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ListCommentsRequest; + + /** + * Verifies a ListCommentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCommentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCommentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ListCommentsRequest; + + /** + * Creates a plain object from a ListCommentsRequest message. Also converts values to other types if specified. + * @param message ListCommentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.ListCommentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCommentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCommentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCommentsResponse. */ + interface IListCommentsResponse { + + /** ListCommentsResponse comments */ + comments?: (google.cloud.support.v2beta.IComment[]|null); + + /** ListCommentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCommentsResponse. */ + class ListCommentsResponse implements IListCommentsResponse { + + /** + * Constructs a new ListCommentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IListCommentsResponse); + + /** ListCommentsResponse comments. */ + public comments: google.cloud.support.v2beta.IComment[]; + + /** ListCommentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCommentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCommentsResponse instance + */ + public static create(properties?: google.cloud.support.v2beta.IListCommentsResponse): google.cloud.support.v2beta.ListCommentsResponse; + + /** + * Encodes the specified ListCommentsResponse message. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsResponse.verify|verify} messages. + * @param message ListCommentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IListCommentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCommentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsResponse.verify|verify} messages. + * @param message ListCommentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IListCommentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCommentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCommentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ListCommentsResponse; + + /** + * Decodes a ListCommentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCommentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ListCommentsResponse; + + /** + * Verifies a ListCommentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCommentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCommentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ListCommentsResponse; + + /** + * Creates a plain object from a ListCommentsResponse message. Also converts values to other types if specified. + * @param message ListCommentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.ListCommentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCommentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCommentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCommentRequest. */ + interface ICreateCommentRequest { + + /** CreateCommentRequest parent */ + parent?: (string|null); + + /** CreateCommentRequest comment */ + comment?: (google.cloud.support.v2beta.IComment|null); + } + + /** Represents a CreateCommentRequest. */ + class CreateCommentRequest implements ICreateCommentRequest { + + /** + * Constructs a new CreateCommentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.ICreateCommentRequest); + + /** CreateCommentRequest parent. */ + public parent: string; + + /** CreateCommentRequest comment. */ + public comment?: (google.cloud.support.v2beta.IComment|null); + + /** + * Creates a new CreateCommentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCommentRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.ICreateCommentRequest): google.cloud.support.v2beta.CreateCommentRequest; + + /** + * Encodes the specified CreateCommentRequest message. Does not implicitly {@link google.cloud.support.v2beta.CreateCommentRequest.verify|verify} messages. + * @param message CreateCommentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.ICreateCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CreateCommentRequest.verify|verify} messages. + * @param message CreateCommentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.ICreateCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCommentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.CreateCommentRequest; + + /** + * Decodes a CreateCommentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.CreateCommentRequest; + + /** + * Verifies a CreateCommentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCommentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCommentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.CreateCommentRequest; + + /** + * Creates a plain object from a CreateCommentRequest message. Also converts values to other types if specified. + * @param message CreateCommentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.CreateCommentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCommentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCommentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCommentRequest. */ + interface IGetCommentRequest { + + /** GetCommentRequest name */ + name?: (string|null); + } + + /** Represents a GetCommentRequest. */ + class GetCommentRequest implements IGetCommentRequest { + + /** + * Constructs a new GetCommentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IGetCommentRequest); + + /** GetCommentRequest name. */ + public name: string; + + /** + * Creates a new GetCommentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCommentRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.IGetCommentRequest): google.cloud.support.v2beta.GetCommentRequest; + + /** + * Encodes the specified GetCommentRequest message. Does not implicitly {@link google.cloud.support.v2beta.GetCommentRequest.verify|verify} messages. + * @param message GetCommentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IGetCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.GetCommentRequest.verify|verify} messages. + * @param message GetCommentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IGetCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCommentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.GetCommentRequest; + + /** + * Decodes a GetCommentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.GetCommentRequest; + + /** + * Verifies a GetCommentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCommentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCommentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.GetCommentRequest; + + /** + * Creates a plain object from a GetCommentRequest message. Also converts values to other types if specified. + * @param message GetCommentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.GetCommentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCommentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCommentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextContent. */ + interface ITextContent { + + /** TextContent plainText */ + plainText?: (string|null); + } + + /** Represents a TextContent. */ + class TextContent implements ITextContent { + + /** + * Constructs a new TextContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.ITextContent); + + /** TextContent plainText. */ + public plainText: string; + + /** + * Creates a new TextContent instance using the specified properties. + * @param [properties] Properties to set + * @returns TextContent instance + */ + public static create(properties?: google.cloud.support.v2beta.ITextContent): google.cloud.support.v2beta.TextContent; + + /** + * Encodes the specified TextContent message. Does not implicitly {@link google.cloud.support.v2beta.TextContent.verify|verify} messages. + * @param message TextContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.ITextContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextContent message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.TextContent.verify|verify} messages. + * @param message TextContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.ITextContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.TextContent; + + /** + * Decodes a TextContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.TextContent; + + /** + * Verifies a TextContent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextContent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.TextContent; + + /** + * Creates a plain object from a TextContent message. Also converts values to other types if specified. + * @param message TextContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.TextContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextContent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EmailMessage. */ + interface IEmailMessage { + + /** EmailMessage name */ + name?: (string|null); + + /** EmailMessage createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** EmailMessage actor */ + actor?: (google.cloud.support.v2beta.IActor|null); + + /** EmailMessage subject */ + subject?: (string|null); + + /** EmailMessage recipientEmailAddresses */ + recipientEmailAddresses?: (string[]|null); + + /** EmailMessage ccEmailAddresses */ + ccEmailAddresses?: (string[]|null); + + /** EmailMessage bodyContent */ + bodyContent?: (google.cloud.support.v2beta.ITextContent|null); + } + + /** Represents an EmailMessage. */ + class EmailMessage implements IEmailMessage { + + /** + * Constructs a new EmailMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IEmailMessage); + + /** EmailMessage name. */ + public name: string; + + /** EmailMessage createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** EmailMessage actor. */ + public actor?: (google.cloud.support.v2beta.IActor|null); + + /** EmailMessage subject. */ + public subject: string; + + /** EmailMessage recipientEmailAddresses. */ + public recipientEmailAddresses: string[]; + + /** EmailMessage ccEmailAddresses. */ + public ccEmailAddresses: string[]; + + /** EmailMessage bodyContent. */ + public bodyContent?: (google.cloud.support.v2beta.ITextContent|null); + + /** + * Creates a new EmailMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns EmailMessage instance + */ + public static create(properties?: google.cloud.support.v2beta.IEmailMessage): google.cloud.support.v2beta.EmailMessage; + + /** + * Encodes the specified EmailMessage message. Does not implicitly {@link google.cloud.support.v2beta.EmailMessage.verify|verify} messages. + * @param message EmailMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IEmailMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmailMessage message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.EmailMessage.verify|verify} messages. + * @param message EmailMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IEmailMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmailMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmailMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.EmailMessage; + + /** + * Decodes an EmailMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmailMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.EmailMessage; + + /** + * Verifies an EmailMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EmailMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmailMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.EmailMessage; + + /** + * Creates a plain object from an EmailMessage message. Also converts values to other types if specified. + * @param message EmailMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.EmailMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmailMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmailMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeedItem. */ + interface IFeedItem { + + /** FeedItem comment */ + comment?: (google.cloud.support.v2beta.IComment|null); + + /** FeedItem attachment */ + attachment?: (google.cloud.support.v2beta.IAttachment|null); + + /** FeedItem emailMessage */ + emailMessage?: (google.cloud.support.v2beta.IEmailMessage|null); + + /** FeedItem deletedAttachment */ + deletedAttachment?: (google.cloud.support.v2beta.IAttachment|null); + + /** FeedItem eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a FeedItem. */ + class FeedItem implements IFeedItem { + + /** + * Constructs a new FeedItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IFeedItem); + + /** FeedItem comment. */ + public comment?: (google.cloud.support.v2beta.IComment|null); + + /** FeedItem attachment. */ + public attachment?: (google.cloud.support.v2beta.IAttachment|null); + + /** FeedItem emailMessage. */ + public emailMessage?: (google.cloud.support.v2beta.IEmailMessage|null); + + /** FeedItem deletedAttachment. */ + public deletedAttachment?: (google.cloud.support.v2beta.IAttachment|null); + + /** FeedItem eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** FeedItem eventObject. */ + public eventObject?: ("comment"|"attachment"|"emailMessage"|"deletedAttachment"); + + /** + * Creates a new FeedItem instance using the specified properties. + * @param [properties] Properties to set + * @returns FeedItem instance + */ + public static create(properties?: google.cloud.support.v2beta.IFeedItem): google.cloud.support.v2beta.FeedItem; + + /** + * Encodes the specified FeedItem message. Does not implicitly {@link google.cloud.support.v2beta.FeedItem.verify|verify} messages. + * @param message FeedItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IFeedItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeedItem message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.FeedItem.verify|verify} messages. + * @param message FeedItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IFeedItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeedItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeedItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.FeedItem; + + /** + * Decodes a FeedItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeedItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.FeedItem; + + /** + * Verifies a FeedItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeedItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeedItem + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.FeedItem; + + /** + * Creates a plain object from a FeedItem message. Also converts values to other types if specified. + * @param message FeedItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.FeedItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeedItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeedItem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a FeedService */ + class FeedService extends $protobuf.rpc.Service { + + /** + * Constructs a new FeedService 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 FeedService 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): FeedService; + + /** + * Calls ShowFeed. + * @param request ShowFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ShowFeedResponse + */ + public showFeed(request: google.cloud.support.v2beta.IShowFeedRequest, callback: google.cloud.support.v2beta.FeedService.ShowFeedCallback): void; + + /** + * Calls ShowFeed. + * @param request ShowFeedRequest message or plain object + * @returns Promise + */ + public showFeed(request: google.cloud.support.v2beta.IShowFeedRequest): Promise; + } + + namespace FeedService { + + /** + * Callback as used by {@link google.cloud.support.v2beta.FeedService|showFeed}. + * @param error Error, if any + * @param [response] ShowFeedResponse + */ + type ShowFeedCallback = (error: (Error|null), response?: google.cloud.support.v2beta.ShowFeedResponse) => void; + } + + /** Properties of a ShowFeedRequest. */ + interface IShowFeedRequest { + + /** ShowFeedRequest parent */ + parent?: (string|null); + + /** ShowFeedRequest orderBy */ + orderBy?: (string|null); + + /** ShowFeedRequest pageSize */ + pageSize?: (number|null); + + /** ShowFeedRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ShowFeedRequest. */ + class ShowFeedRequest implements IShowFeedRequest { + + /** + * Constructs a new ShowFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IShowFeedRequest); + + /** ShowFeedRequest parent. */ + public parent: string; + + /** ShowFeedRequest orderBy. */ + public orderBy: string; + + /** ShowFeedRequest pageSize. */ + public pageSize: number; + + /** ShowFeedRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ShowFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ShowFeedRequest instance + */ + public static create(properties?: google.cloud.support.v2beta.IShowFeedRequest): google.cloud.support.v2beta.ShowFeedRequest; + + /** + * Encodes the specified ShowFeedRequest message. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedRequest.verify|verify} messages. + * @param message ShowFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IShowFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShowFeedRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedRequest.verify|verify} messages. + * @param message ShowFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IShowFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShowFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShowFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ShowFeedRequest; + + /** + * Decodes a ShowFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShowFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ShowFeedRequest; + + /** + * Verifies a ShowFeedRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShowFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShowFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ShowFeedRequest; + + /** + * Creates a plain object from a ShowFeedRequest message. Also converts values to other types if specified. + * @param message ShowFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.ShowFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShowFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShowFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShowFeedResponse. */ + interface IShowFeedResponse { + + /** ShowFeedResponse feedItems */ + feedItems?: (google.cloud.support.v2beta.IFeedItem[]|null); + + /** ShowFeedResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ShowFeedResponse. */ + class ShowFeedResponse implements IShowFeedResponse { + + /** + * Constructs a new ShowFeedResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2beta.IShowFeedResponse); + + /** ShowFeedResponse feedItems. */ + public feedItems: google.cloud.support.v2beta.IFeedItem[]; + + /** ShowFeedResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ShowFeedResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ShowFeedResponse instance + */ + public static create(properties?: google.cloud.support.v2beta.IShowFeedResponse): google.cloud.support.v2beta.ShowFeedResponse; + + /** + * Encodes the specified ShowFeedResponse message. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedResponse.verify|verify} messages. + * @param message ShowFeedResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2beta.IShowFeedResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShowFeedResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedResponse.verify|verify} messages. + * @param message ShowFeedResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2beta.IShowFeedResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShowFeedResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShowFeedResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ShowFeedResponse; + + /** + * Decodes a ShowFeedResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShowFeedResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ShowFeedResponse; + + /** + * Verifies a ShowFeedResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShowFeedResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShowFeedResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ShowFeedResponse; + + /** + * Creates a plain object from a ShowFeedResponse message. Also converts values to other types if specified. + * @param message ShowFeedResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2beta.ShowFeedResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShowFeedResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShowFeedResponse + * @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); + } + + /** 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 Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a 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 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; + } + } +} diff --git a/owl-bot-staging/google-cloud-support/protos/protos.js b/owl-bot-staging/google-cloud-support/protos/protos.js new file mode 100644 index 00000000000..54c87cf8b68 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/protos.js @@ -0,0 +1,33942 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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_support_protos || ($protobuf.roots._google_cloud_support_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.support = (function() { + + /** + * Namespace support. + * @memberof google.cloud + * @namespace + */ + var support = {}; + + support.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.cloud.support + * @namespace + */ + var v2 = {}; + + v2.Actor = (function() { + + /** + * Properties of an Actor. + * @memberof google.cloud.support.v2 + * @interface IActor + * @property {string|null} [displayName] Actor displayName + * @property {string|null} [email] Actor email + * @property {boolean|null} [googleSupport] Actor googleSupport + * @property {string|null} [username] Actor username + */ + + /** + * Constructs a new Actor. + * @memberof google.cloud.support.v2 + * @classdesc Represents an Actor. + * @implements IActor + * @constructor + * @param {google.cloud.support.v2.IActor=} [properties] Properties to set + */ + function Actor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Actor displayName. + * @member {string} displayName + * @memberof google.cloud.support.v2.Actor + * @instance + */ + Actor.prototype.displayName = ""; + + /** + * Actor email. + * @member {string} email + * @memberof google.cloud.support.v2.Actor + * @instance + */ + Actor.prototype.email = ""; + + /** + * Actor googleSupport. + * @member {boolean} googleSupport + * @memberof google.cloud.support.v2.Actor + * @instance + */ + Actor.prototype.googleSupport = false; + + /** + * Actor username. + * @member {string} username + * @memberof google.cloud.support.v2.Actor + * @instance + */ + Actor.prototype.username = ""; + + /** + * Creates a new Actor instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.Actor + * @static + * @param {google.cloud.support.v2.IActor=} [properties] Properties to set + * @returns {google.cloud.support.v2.Actor} Actor instance + */ + Actor.create = function create(properties) { + return new Actor(properties); + }; + + /** + * Encodes the specified Actor message. Does not implicitly {@link google.cloud.support.v2.Actor.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.Actor + * @static + * @param {google.cloud.support.v2.IActor} message Actor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Actor.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.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); + if (message.googleSupport != null && Object.hasOwnProperty.call(message, "googleSupport")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.googleSupport); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.username); + return writer; + }; + + /** + * Encodes the specified Actor message, length delimited. Does not implicitly {@link google.cloud.support.v2.Actor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.Actor + * @static + * @param {google.cloud.support.v2.IActor} message Actor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Actor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Actor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.Actor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.Actor} Actor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Actor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Actor(); + 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.email = reader.string(); + break; + } + case 4: { + message.googleSupport = reader.bool(); + break; + } + case 5: { + message.username = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Actor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.Actor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.Actor} Actor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Actor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Actor message. + * @function verify + * @memberof google.cloud.support.v2.Actor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Actor.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.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.googleSupport != null && message.hasOwnProperty("googleSupport")) + if (typeof message.googleSupport !== "boolean") + return "googleSupport: boolean expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + return null; + }; + + /** + * Creates an Actor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.Actor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.Actor} Actor + */ + Actor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.Actor) + return object; + var message = new $root.google.cloud.support.v2.Actor(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.email != null) + message.email = String(object.email); + if (object.googleSupport != null) + message.googleSupport = Boolean(object.googleSupport); + if (object.username != null) + message.username = String(object.username); + return message; + }; + + /** + * Creates a plain object from an Actor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.Actor + * @static + * @param {google.cloud.support.v2.Actor} message Actor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Actor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.email = ""; + object.googleSupport = false; + object.username = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.googleSupport != null && message.hasOwnProperty("googleSupport")) + object.googleSupport = message.googleSupport; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + return object; + }; + + /** + * Converts this Actor to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.Actor + * @instance + * @returns {Object.} JSON object + */ + Actor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Actor + * @function getTypeUrl + * @memberof google.cloud.support.v2.Actor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Actor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.Actor"; + }; + + return Actor; + })(); + + v2.Attachment = (function() { + + /** + * Properties of an Attachment. + * @memberof google.cloud.support.v2 + * @interface IAttachment + * @property {string|null} [name] Attachment name + * @property {google.protobuf.ITimestamp|null} [createTime] Attachment createTime + * @property {google.cloud.support.v2.IActor|null} [creator] Attachment creator + * @property {string|null} [filename] Attachment filename + * @property {string|null} [mimeType] Attachment mimeType + * @property {number|Long|null} [sizeBytes] Attachment sizeBytes + */ + + /** + * Constructs a new Attachment. + * @memberof google.cloud.support.v2 + * @classdesc Represents an Attachment. + * @implements IAttachment + * @constructor + * @param {google.cloud.support.v2.IAttachment=} [properties] Properties to set + */ + function Attachment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Attachment name. + * @member {string} name + * @memberof google.cloud.support.v2.Attachment + * @instance + */ + Attachment.prototype.name = ""; + + /** + * Attachment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.support.v2.Attachment + * @instance + */ + Attachment.prototype.createTime = null; + + /** + * Attachment creator. + * @member {google.cloud.support.v2.IActor|null|undefined} creator + * @memberof google.cloud.support.v2.Attachment + * @instance + */ + Attachment.prototype.creator = null; + + /** + * Attachment filename. + * @member {string} filename + * @memberof google.cloud.support.v2.Attachment + * @instance + */ + Attachment.prototype.filename = ""; + + /** + * Attachment mimeType. + * @member {string} mimeType + * @memberof google.cloud.support.v2.Attachment + * @instance + */ + Attachment.prototype.mimeType = ""; + + /** + * Attachment sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.cloud.support.v2.Attachment + * @instance + */ + Attachment.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Attachment instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {google.cloud.support.v2.IAttachment=} [properties] Properties to set + * @returns {google.cloud.support.v2.Attachment} Attachment instance + */ + Attachment.create = function create(properties) { + return new Attachment(properties); + }; + + /** + * Encodes the specified Attachment message. Does not implicitly {@link google.cloud.support.v2.Attachment.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {google.cloud.support.v2.IAttachment} message Attachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attachment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + $root.google.cloud.support.v2.Actor.encode(message.creator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filename); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mimeType); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.sizeBytes); + return writer; + }; + + /** + * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.cloud.support.v2.Attachment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {google.cloud.support.v2.IAttachment} message Attachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attachment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Attachment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.Attachment} Attachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attachment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Attachment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.creator = $root.google.cloud.support.v2.Actor.decode(reader, reader.uint32()); + break; + } + case 4: { + message.filename = reader.string(); + break; + } + case 5: { + message.mimeType = reader.string(); + break; + } + case 6: { + message.sizeBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Attachment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.Attachment} Attachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attachment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Attachment message. + * @function verify + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Attachment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: 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.creator != null && message.hasOwnProperty("creator")) { + var error = $root.google.cloud.support.v2.Actor.verify(message.creator); + if (error) + return "creator." + error; + } + if (message.filename != null && message.hasOwnProperty("filename")) + if (!$util.isString(message.filename)) + return "filename: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + return null; + }; + + /** + * Creates an Attachment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.Attachment} Attachment + */ + Attachment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.Attachment) + return object; + var message = new $root.google.cloud.support.v2.Attachment(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.support.v2.Attachment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.creator != null) { + if (typeof object.creator !== "object") + throw TypeError(".google.cloud.support.v2.Attachment.creator: object expected"); + message.creator = $root.google.cloud.support.v2.Actor.fromObject(object.creator); + } + if (object.filename != null) + message.filename = String(object.filename); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Attachment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {google.cloud.support.v2.Attachment} message Attachment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Attachment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.creator = null; + object.filename = ""; + object.mimeType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = $root.google.cloud.support.v2.Actor.toObject(message.creator, options); + if (message.filename != null && message.hasOwnProperty("filename")) + object.filename = message.filename; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + return object; + }; + + /** + * Converts this Attachment to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.Attachment + * @instance + * @returns {Object.} JSON object + */ + Attachment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Attachment + * @function getTypeUrl + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Attachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.Attachment"; + }; + + return Attachment; + })(); + + v2.CaseAttachmentService = (function() { + + /** + * Constructs a new CaseAttachmentService service. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CaseAttachmentService + * @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 CaseAttachmentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CaseAttachmentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CaseAttachmentService; + + /** + * Creates new CaseAttachmentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.support.v2.CaseAttachmentService + * @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 {CaseAttachmentService} RPC service. Useful where requests and/or responses are streamed. + */ + CaseAttachmentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseAttachmentService|listAttachments}. + * @memberof google.cloud.support.v2.CaseAttachmentService + * @typedef ListAttachmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.ListAttachmentsResponse} [response] ListAttachmentsResponse + */ + + /** + * Calls ListAttachments. + * @function listAttachments + * @memberof google.cloud.support.v2.CaseAttachmentService + * @instance + * @param {google.cloud.support.v2.IListAttachmentsRequest} request ListAttachmentsRequest message or plain object + * @param {google.cloud.support.v2.CaseAttachmentService.ListAttachmentsCallback} callback Node-style callback called with the error, if any, and ListAttachmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseAttachmentService.prototype.listAttachments = function listAttachments(request, callback) { + return this.rpcCall(listAttachments, $root.google.cloud.support.v2.ListAttachmentsRequest, $root.google.cloud.support.v2.ListAttachmentsResponse, request, callback); + }, "name", { value: "ListAttachments" }); + + /** + * Calls ListAttachments. + * @function listAttachments + * @memberof google.cloud.support.v2.CaseAttachmentService + * @instance + * @param {google.cloud.support.v2.IListAttachmentsRequest} request ListAttachmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CaseAttachmentService; + })(); + + v2.ListAttachmentsRequest = (function() { + + /** + * Properties of a ListAttachmentsRequest. + * @memberof google.cloud.support.v2 + * @interface IListAttachmentsRequest + * @property {string|null} [parent] ListAttachmentsRequest parent + * @property {number|null} [pageSize] ListAttachmentsRequest pageSize + * @property {string|null} [pageToken] ListAttachmentsRequest pageToken + */ + + /** + * Constructs a new ListAttachmentsRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a ListAttachmentsRequest. + * @implements IListAttachmentsRequest + * @constructor + * @param {google.cloud.support.v2.IListAttachmentsRequest=} [properties] Properties to set + */ + function ListAttachmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAttachmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @instance + */ + ListAttachmentsRequest.prototype.parent = ""; + + /** + * ListAttachmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @instance + */ + ListAttachmentsRequest.prototype.pageSize = 0; + + /** + * ListAttachmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @instance + */ + ListAttachmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAttachmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {google.cloud.support.v2.IListAttachmentsRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.ListAttachmentsRequest} ListAttachmentsRequest instance + */ + ListAttachmentsRequest.create = function create(properties) { + return new ListAttachmentsRequest(properties); + }; + + /** + * Encodes the specified ListAttachmentsRequest message. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {google.cloud.support.v2.IListAttachmentsRequest} message ListAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttachmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {google.cloud.support.v2.IListAttachmentsRequest} message ListAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttachmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttachmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.ListAttachmentsRequest} ListAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttachmentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListAttachmentsRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttachmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.ListAttachmentsRequest} ListAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttachmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttachmentsRequest message. + * @function verify + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttachmentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.ListAttachmentsRequest} ListAttachmentsRequest + */ + ListAttachmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.ListAttachmentsRequest) + return object; + var message = new $root.google.cloud.support.v2.ListAttachmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAttachmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {google.cloud.support.v2.ListAttachmentsRequest} message ListAttachmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttachmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListAttachmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAttachmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttachmentsRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttachmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.ListAttachmentsRequest"; + }; + + return ListAttachmentsRequest; + })(); + + v2.ListAttachmentsResponse = (function() { + + /** + * Properties of a ListAttachmentsResponse. + * @memberof google.cloud.support.v2 + * @interface IListAttachmentsResponse + * @property {Array.|null} [attachments] ListAttachmentsResponse attachments + * @property {string|null} [nextPageToken] ListAttachmentsResponse nextPageToken + */ + + /** + * Constructs a new ListAttachmentsResponse. + * @memberof google.cloud.support.v2 + * @classdesc Represents a ListAttachmentsResponse. + * @implements IListAttachmentsResponse + * @constructor + * @param {google.cloud.support.v2.IListAttachmentsResponse=} [properties] Properties to set + */ + function ListAttachmentsResponse(properties) { + this.attachments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAttachmentsResponse attachments. + * @member {Array.} attachments + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @instance + */ + ListAttachmentsResponse.prototype.attachments = $util.emptyArray; + + /** + * ListAttachmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @instance + */ + ListAttachmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAttachmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {google.cloud.support.v2.IListAttachmentsResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2.ListAttachmentsResponse} ListAttachmentsResponse instance + */ + ListAttachmentsResponse.create = function create(properties) { + return new ListAttachmentsResponse(properties); + }; + + /** + * Encodes the specified ListAttachmentsResponse message. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {google.cloud.support.v2.IListAttachmentsResponse} message ListAttachmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttachmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachments != null && message.attachments.length) + for (var i = 0; i < message.attachments.length; ++i) + $root.google.cloud.support.v2.Attachment.encode(message.attachments[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 ListAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {google.cloud.support.v2.IListAttachmentsResponse} message ListAttachmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttachmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttachmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.ListAttachmentsResponse} ListAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttachmentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListAttachmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.attachments && message.attachments.length)) + message.attachments = []; + message.attachments.push($root.google.cloud.support.v2.Attachment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttachmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.ListAttachmentsResponse} ListAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttachmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttachmentsResponse message. + * @function verify + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttachmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachments != null && message.hasOwnProperty("attachments")) { + if (!Array.isArray(message.attachments)) + return "attachments: array expected"; + for (var i = 0; i < message.attachments.length; ++i) { + var error = $root.google.cloud.support.v2.Attachment.verify(message.attachments[i]); + if (error) + return "attachments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAttachmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.ListAttachmentsResponse} ListAttachmentsResponse + */ + ListAttachmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.ListAttachmentsResponse) + return object; + var message = new $root.google.cloud.support.v2.ListAttachmentsResponse(); + if (object.attachments) { + if (!Array.isArray(object.attachments)) + throw TypeError(".google.cloud.support.v2.ListAttachmentsResponse.attachments: array expected"); + message.attachments = []; + for (var i = 0; i < object.attachments.length; ++i) { + if (typeof object.attachments[i] !== "object") + throw TypeError(".google.cloud.support.v2.ListAttachmentsResponse.attachments: object expected"); + message.attachments[i] = $root.google.cloud.support.v2.Attachment.fromObject(object.attachments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAttachmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {google.cloud.support.v2.ListAttachmentsResponse} message ListAttachmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttachmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attachments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.attachments && message.attachments.length) { + object.attachments = []; + for (var j = 0; j < message.attachments.length; ++j) + object.attachments[j] = $root.google.cloud.support.v2.Attachment.toObject(message.attachments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAttachmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAttachmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttachmentsResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttachmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.ListAttachmentsResponse"; + }; + + return ListAttachmentsResponse; + })(); + + v2.Case = (function() { + + /** + * Properties of a Case. + * @memberof google.cloud.support.v2 + * @interface ICase + * @property {string|null} [name] Case name + * @property {string|null} [displayName] Case displayName + * @property {string|null} [description] Case description + * @property {google.cloud.support.v2.ICaseClassification|null} [classification] Case classification + * @property {string|null} [timeZone] Case timeZone + * @property {Array.|null} [subscriberEmailAddresses] Case subscriberEmailAddresses + * @property {google.cloud.support.v2.Case.State|null} [state] Case state + * @property {google.protobuf.ITimestamp|null} [createTime] Case createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Case updateTime + * @property {google.cloud.support.v2.IActor|null} [creator] Case creator + * @property {string|null} [contactEmail] Case contactEmail + * @property {boolean|null} [escalated] Case escalated + * @property {boolean|null} [testCase] Case testCase + * @property {string|null} [languageCode] Case languageCode + * @property {google.cloud.support.v2.Case.Priority|null} [priority] Case priority + */ + + /** + * Constructs a new Case. + * @memberof google.cloud.support.v2 + * @classdesc Represents a Case. + * @implements ICase + * @constructor + * @param {google.cloud.support.v2.ICase=} [properties] Properties to set + */ + function Case(properties) { + this.subscriberEmailAddresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Case name. + * @member {string} name + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.name = ""; + + /** + * Case displayName. + * @member {string} displayName + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.displayName = ""; + + /** + * Case description. + * @member {string} description + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.description = ""; + + /** + * Case classification. + * @member {google.cloud.support.v2.ICaseClassification|null|undefined} classification + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.classification = null; + + /** + * Case timeZone. + * @member {string} timeZone + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.timeZone = ""; + + /** + * Case subscriberEmailAddresses. + * @member {Array.} subscriberEmailAddresses + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.subscriberEmailAddresses = $util.emptyArray; + + /** + * Case state. + * @member {google.cloud.support.v2.Case.State} state + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.state = 0; + + /** + * Case createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.createTime = null; + + /** + * Case updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.updateTime = null; + + /** + * Case creator. + * @member {google.cloud.support.v2.IActor|null|undefined} creator + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.creator = null; + + /** + * Case contactEmail. + * @member {string} contactEmail + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.contactEmail = ""; + + /** + * Case escalated. + * @member {boolean} escalated + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.escalated = false; + + /** + * Case testCase. + * @member {boolean} testCase + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.testCase = false; + + /** + * Case languageCode. + * @member {string} languageCode + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.languageCode = ""; + + /** + * Case priority. + * @member {google.cloud.support.v2.Case.Priority} priority + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.priority = 0; + + /** + * Creates a new Case instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.Case + * @static + * @param {google.cloud.support.v2.ICase=} [properties] Properties to set + * @returns {google.cloud.support.v2.Case} Case instance + */ + Case.create = function create(properties) { + return new Case(properties); + }; + + /** + * Encodes the specified Case message. Does not implicitly {@link google.cloud.support.v2.Case.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.Case + * @static + * @param {google.cloud.support.v2.ICase} message Case message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Case.encode = function encode(message, writer) { + if (!writer) + 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.classification != null && Object.hasOwnProperty.call(message, "classification")) + $root.google.cloud.support.v2.CaseClassification.encode(message.classification, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.timeZone); + if (message.subscriberEmailAddresses != null && message.subscriberEmailAddresses.length) + for (var i = 0; i < message.subscriberEmailAddresses.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.subscriberEmailAddresses[i]); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + $root.google.cloud.support.v2.Actor.encode(message.creator, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.escalated != null && Object.hasOwnProperty.call(message, "escalated")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.escalated); + if (message.testCase != null && Object.hasOwnProperty.call(message, "testCase")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.testCase); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.languageCode); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 32, wireType 0 =*/256).int32(message.priority); + if (message.contactEmail != null && Object.hasOwnProperty.call(message, "contactEmail")) + writer.uint32(/* id 35, wireType 2 =*/282).string(message.contactEmail); + return writer; + }; + + /** + * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.support.v2.Case.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.Case + * @static + * @param {google.cloud.support.v2.ICase} message Case message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Case.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Case message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.Case + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.Case} Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Case.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Case(); + while (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.classification = $root.google.cloud.support.v2.CaseClassification.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeZone = reader.string(); + break; + } + case 9: { + if (!(message.subscriberEmailAddresses && message.subscriberEmailAddresses.length)) + message.subscriberEmailAddresses = []; + message.subscriberEmailAddresses.push(reader.string()); + break; + } + case 12: { + message.state = reader.int32(); + break; + } + case 13: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.creator = $root.google.cloud.support.v2.Actor.decode(reader, reader.uint32()); + break; + } + case 35: { + message.contactEmail = reader.string(); + break; + } + case 17: { + message.escalated = reader.bool(); + break; + } + case 19: { + message.testCase = reader.bool(); + break; + } + case 23: { + message.languageCode = reader.string(); + break; + } + case 32: { + message.priority = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Case message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.Case + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.Case} Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Case.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Case message. + * @function verify + * @memberof google.cloud.support.v2.Case + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Case.verify = function verify(message) { + if (typeof message !== "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.classification != null && message.hasOwnProperty("classification")) { + var error = $root.google.cloud.support.v2.CaseClassification.verify(message.classification); + if (error) + return "classification." + error; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.subscriberEmailAddresses != null && message.hasOwnProperty("subscriberEmailAddresses")) { + if (!Array.isArray(message.subscriberEmailAddresses)) + return "subscriberEmailAddresses: array expected"; + for (var i = 0; i < message.subscriberEmailAddresses.length; ++i) + if (!$util.isString(message.subscriberEmailAddresses[i])) + return "subscriberEmailAddresses: string[] expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + 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.creator != null && message.hasOwnProperty("creator")) { + var error = $root.google.cloud.support.v2.Actor.verify(message.creator); + if (error) + return "creator." + error; + } + if (message.contactEmail != null && message.hasOwnProperty("contactEmail")) + if (!$util.isString(message.contactEmail)) + return "contactEmail: string expected"; + if (message.escalated != null && message.hasOwnProperty("escalated")) + if (typeof message.escalated !== "boolean") + return "escalated: boolean expected"; + if (message.testCase != null && message.hasOwnProperty("testCase")) + if (typeof message.testCase !== "boolean") + return "testCase: boolean expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + switch (message.priority) { + default: + return "priority: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a Case message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.Case + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.Case} Case + */ + Case.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.Case) + return object; + var message = new $root.google.cloud.support.v2.Case(); + 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.classification != null) { + if (typeof object.classification !== "object") + throw TypeError(".google.cloud.support.v2.Case.classification: object expected"); + message.classification = $root.google.cloud.support.v2.CaseClassification.fromObject(object.classification); + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.subscriberEmailAddresses) { + if (!Array.isArray(object.subscriberEmailAddresses)) + throw TypeError(".google.cloud.support.v2.Case.subscriberEmailAddresses: array expected"); + message.subscriberEmailAddresses = []; + for (var i = 0; i < object.subscriberEmailAddresses.length; ++i) + message.subscriberEmailAddresses[i] = String(object.subscriberEmailAddresses[i]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "NEW": + case 1: + message.state = 1; + break; + case "IN_PROGRESS_GOOGLE_SUPPORT": + case 2: + message.state = 2; + break; + case "ACTION_REQUIRED": + case 3: + message.state = 3; + break; + case "SOLUTION_PROVIDED": + case 4: + message.state = 4; + break; + case "CLOSED": + case 5: + message.state = 5; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.support.v2.Case.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.support.v2.Case.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.creator != null) { + if (typeof object.creator !== "object") + throw TypeError(".google.cloud.support.v2.Case.creator: object expected"); + message.creator = $root.google.cloud.support.v2.Actor.fromObject(object.creator); + } + if (object.contactEmail != null) + message.contactEmail = String(object.contactEmail); + if (object.escalated != null) + message.escalated = Boolean(object.escalated); + if (object.testCase != null) + message.testCase = Boolean(object.testCase); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; + case "PRIORITY_UNSPECIFIED": + case 0: + message.priority = 0; + break; + case "P0": + case 1: + message.priority = 1; + break; + case "P1": + case 2: + message.priority = 2; + break; + case "P2": + case 3: + message.priority = 3; + break; + case "P3": + case 4: + message.priority = 4; + break; + case "P4": + case 5: + message.priority = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a Case message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.Case + * @static + * @param {google.cloud.support.v2.Case} message Case + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Case.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subscriberEmailAddresses = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.classification = null; + object.timeZone = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.creator = null; + object.escalated = false; + object.testCase = false; + object.languageCode = ""; + object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; + object.contactEmail = ""; + } + 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.classification != null && message.hasOwnProperty("classification")) + object.classification = $root.google.cloud.support.v2.CaseClassification.toObject(message.classification, options); + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.subscriberEmailAddresses && message.subscriberEmailAddresses.length) { + object.subscriberEmailAddresses = []; + for (var j = 0; j < message.subscriberEmailAddresses.length; ++j) + object.subscriberEmailAddresses[j] = message.subscriberEmailAddresses[j]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.support.v2.Case.State[message.state] === undefined ? message.state : $root.google.cloud.support.v2.Case.State[message.state] : message.state; + 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.creator != null && message.hasOwnProperty("creator")) + object.creator = $root.google.cloud.support.v2.Actor.toObject(message.creator, options); + if (message.escalated != null && message.hasOwnProperty("escalated")) + object.escalated = message.escalated; + if (message.testCase != null && message.hasOwnProperty("testCase")) + object.testCase = message.testCase; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = options.enums === String ? $root.google.cloud.support.v2.Case.Priority[message.priority] === undefined ? message.priority : $root.google.cloud.support.v2.Case.Priority[message.priority] : message.priority; + if (message.contactEmail != null && message.hasOwnProperty("contactEmail")) + object.contactEmail = message.contactEmail; + return object; + }; + + /** + * Converts this Case to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.Case + * @instance + * @returns {Object.} JSON object + */ + Case.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Case + * @function getTypeUrl + * @memberof google.cloud.support.v2.Case + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Case.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.Case"; + }; + + /** + * State enum. + * @name google.cloud.support.v2.Case.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} NEW=1 NEW value + * @property {number} IN_PROGRESS_GOOGLE_SUPPORT=2 IN_PROGRESS_GOOGLE_SUPPORT value + * @property {number} ACTION_REQUIRED=3 ACTION_REQUIRED value + * @property {number} SOLUTION_PROVIDED=4 SOLUTION_PROVIDED value + * @property {number} CLOSED=5 CLOSED value + */ + Case.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEW"] = 1; + values[valuesById[2] = "IN_PROGRESS_GOOGLE_SUPPORT"] = 2; + values[valuesById[3] = "ACTION_REQUIRED"] = 3; + values[valuesById[4] = "SOLUTION_PROVIDED"] = 4; + values[valuesById[5] = "CLOSED"] = 5; + return values; + })(); + + /** + * Priority enum. + * @name google.cloud.support.v2.Case.Priority + * @enum {number} + * @property {number} PRIORITY_UNSPECIFIED=0 PRIORITY_UNSPECIFIED value + * @property {number} P0=1 P0 value + * @property {number} P1=2 P1 value + * @property {number} P2=3 P2 value + * @property {number} P3=4 P3 value + * @property {number} P4=5 P4 value + */ + Case.Priority = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIORITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "P0"] = 1; + values[valuesById[2] = "P1"] = 2; + values[valuesById[3] = "P2"] = 3; + values[valuesById[4] = "P3"] = 4; + values[valuesById[5] = "P4"] = 5; + return values; + })(); + + return Case; + })(); + + v2.CaseClassification = (function() { + + /** + * Properties of a CaseClassification. + * @memberof google.cloud.support.v2 + * @interface ICaseClassification + * @property {string|null} [id] CaseClassification id + * @property {string|null} [displayName] CaseClassification displayName + */ + + /** + * Constructs a new CaseClassification. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CaseClassification. + * @implements ICaseClassification + * @constructor + * @param {google.cloud.support.v2.ICaseClassification=} [properties] Properties to set + */ + function CaseClassification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CaseClassification id. + * @member {string} id + * @memberof google.cloud.support.v2.CaseClassification + * @instance + */ + CaseClassification.prototype.id = ""; + + /** + * CaseClassification displayName. + * @member {string} displayName + * @memberof google.cloud.support.v2.CaseClassification + * @instance + */ + CaseClassification.prototype.displayName = ""; + + /** + * Creates a new CaseClassification instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {google.cloud.support.v2.ICaseClassification=} [properties] Properties to set + * @returns {google.cloud.support.v2.CaseClassification} CaseClassification instance + */ + CaseClassification.create = function create(properties) { + return new CaseClassification(properties); + }; + + /** + * Encodes the specified CaseClassification message. Does not implicitly {@link google.cloud.support.v2.CaseClassification.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {google.cloud.support.v2.ICaseClassification} message CaseClassification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseClassification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified CaseClassification message, length delimited. Does not implicitly {@link google.cloud.support.v2.CaseClassification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {google.cloud.support.v2.ICaseClassification} message CaseClassification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseClassification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaseClassification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.CaseClassification} CaseClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseClassification.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.CaseClassification(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.id = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CaseClassification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.CaseClassification} CaseClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseClassification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaseClassification message. + * @function verify + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaseClassification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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"; + return null; + }; + + /** + * Creates a CaseClassification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.CaseClassification} CaseClassification + */ + CaseClassification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.CaseClassification) + return object; + var message = new $root.google.cloud.support.v2.CaseClassification(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a CaseClassification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {google.cloud.support.v2.CaseClassification} message CaseClassification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaseClassification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this CaseClassification to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.CaseClassification + * @instance + * @returns {Object.} JSON object + */ + CaseClassification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaseClassification + * @function getTypeUrl + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaseClassification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.CaseClassification"; + }; + + return CaseClassification; + })(); + + v2.CaseService = (function() { + + /** + * Constructs a new CaseService service. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CaseService + * @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 CaseService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CaseService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CaseService; + + /** + * Creates new CaseService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.support.v2.CaseService + * @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 {CaseService} RPC service. Useful where requests and/or responses are streamed. + */ + CaseService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|getCase}. + * @memberof google.cloud.support.v2.CaseService + * @typedef GetCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.Case} [response] Case + */ + + /** + * Calls GetCase. + * @function getCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IGetCaseRequest} request GetCaseRequest message or plain object + * @param {google.cloud.support.v2.CaseService.GetCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.getCase = function getCase(request, callback) { + return this.rpcCall(getCase, $root.google.cloud.support.v2.GetCaseRequest, $root.google.cloud.support.v2.Case, request, callback); + }, "name", { value: "GetCase" }); + + /** + * Calls GetCase. + * @function getCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IGetCaseRequest} request GetCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|listCases}. + * @memberof google.cloud.support.v2.CaseService + * @typedef ListCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.ListCasesResponse} [response] ListCasesResponse + */ + + /** + * Calls ListCases. + * @function listCases + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IListCasesRequest} request ListCasesRequest message or plain object + * @param {google.cloud.support.v2.CaseService.ListCasesCallback} callback Node-style callback called with the error, if any, and ListCasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.listCases = function listCases(request, callback) { + return this.rpcCall(listCases, $root.google.cloud.support.v2.ListCasesRequest, $root.google.cloud.support.v2.ListCasesResponse, request, callback); + }, "name", { value: "ListCases" }); + + /** + * Calls ListCases. + * @function listCases + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IListCasesRequest} request ListCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|searchCases}. + * @memberof google.cloud.support.v2.CaseService + * @typedef SearchCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.SearchCasesResponse} [response] SearchCasesResponse + */ + + /** + * Calls SearchCases. + * @function searchCases + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ISearchCasesRequest} request SearchCasesRequest message or plain object + * @param {google.cloud.support.v2.CaseService.SearchCasesCallback} callback Node-style callback called with the error, if any, and SearchCasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.searchCases = function searchCases(request, callback) { + return this.rpcCall(searchCases, $root.google.cloud.support.v2.SearchCasesRequest, $root.google.cloud.support.v2.SearchCasesResponse, request, callback); + }, "name", { value: "SearchCases" }); + + /** + * Calls SearchCases. + * @function searchCases + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ISearchCasesRequest} request SearchCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|createCase}. + * @memberof google.cloud.support.v2.CaseService + * @typedef CreateCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.Case} [response] Case + */ + + /** + * Calls CreateCase. + * @function createCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ICreateCaseRequest} request CreateCaseRequest message or plain object + * @param {google.cloud.support.v2.CaseService.CreateCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.createCase = function createCase(request, callback) { + return this.rpcCall(createCase, $root.google.cloud.support.v2.CreateCaseRequest, $root.google.cloud.support.v2.Case, request, callback); + }, "name", { value: "CreateCase" }); + + /** + * Calls CreateCase. + * @function createCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ICreateCaseRequest} request CreateCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|updateCase}. + * @memberof google.cloud.support.v2.CaseService + * @typedef UpdateCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.Case} [response] Case + */ + + /** + * Calls UpdateCase. + * @function updateCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IUpdateCaseRequest} request UpdateCaseRequest message or plain object + * @param {google.cloud.support.v2.CaseService.UpdateCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.updateCase = function updateCase(request, callback) { + return this.rpcCall(updateCase, $root.google.cloud.support.v2.UpdateCaseRequest, $root.google.cloud.support.v2.Case, request, callback); + }, "name", { value: "UpdateCase" }); + + /** + * Calls UpdateCase. + * @function updateCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IUpdateCaseRequest} request UpdateCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|escalateCase}. + * @memberof google.cloud.support.v2.CaseService + * @typedef EscalateCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.Case} [response] Case + */ + + /** + * Calls EscalateCase. + * @function escalateCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IEscalateCaseRequest} request EscalateCaseRequest message or plain object + * @param {google.cloud.support.v2.CaseService.EscalateCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.escalateCase = function escalateCase(request, callback) { + return this.rpcCall(escalateCase, $root.google.cloud.support.v2.EscalateCaseRequest, $root.google.cloud.support.v2.Case, request, callback); + }, "name", { value: "EscalateCase" }); + + /** + * Calls EscalateCase. + * @function escalateCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IEscalateCaseRequest} request EscalateCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|closeCase}. + * @memberof google.cloud.support.v2.CaseService + * @typedef CloseCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.Case} [response] Case + */ + + /** + * Calls CloseCase. + * @function closeCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ICloseCaseRequest} request CloseCaseRequest message or plain object + * @param {google.cloud.support.v2.CaseService.CloseCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.closeCase = function closeCase(request, callback) { + return this.rpcCall(closeCase, $root.google.cloud.support.v2.CloseCaseRequest, $root.google.cloud.support.v2.Case, request, callback); + }, "name", { value: "CloseCase" }); + + /** + * Calls CloseCase. + * @function closeCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ICloseCaseRequest} request CloseCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|searchCaseClassifications}. + * @memberof google.cloud.support.v2.CaseService + * @typedef SearchCaseClassificationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.SearchCaseClassificationsResponse} [response] SearchCaseClassificationsResponse + */ + + /** + * Calls SearchCaseClassifications. + * @function searchCaseClassifications + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest} request SearchCaseClassificationsRequest message or plain object + * @param {google.cloud.support.v2.CaseService.SearchCaseClassificationsCallback} callback Node-style callback called with the error, if any, and SearchCaseClassificationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.searchCaseClassifications = function searchCaseClassifications(request, callback) { + return this.rpcCall(searchCaseClassifications, $root.google.cloud.support.v2.SearchCaseClassificationsRequest, $root.google.cloud.support.v2.SearchCaseClassificationsResponse, request, callback); + }, "name", { value: "SearchCaseClassifications" }); + + /** + * Calls SearchCaseClassifications. + * @function searchCaseClassifications + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest} request SearchCaseClassificationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CaseService; + })(); + + v2.GetCaseRequest = (function() { + + /** + * Properties of a GetCaseRequest. + * @memberof google.cloud.support.v2 + * @interface IGetCaseRequest + * @property {string|null} [name] GetCaseRequest name + */ + + /** + * Constructs a new GetCaseRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a GetCaseRequest. + * @implements IGetCaseRequest + * @constructor + * @param {google.cloud.support.v2.IGetCaseRequest=} [properties] Properties to set + */ + function GetCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCaseRequest name. + * @member {string} name + * @memberof google.cloud.support.v2.GetCaseRequest + * @instance + */ + GetCaseRequest.prototype.name = ""; + + /** + * Creates a new GetCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {google.cloud.support.v2.IGetCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.GetCaseRequest} GetCaseRequest instance + */ + GetCaseRequest.create = function create(properties) { + return new GetCaseRequest(properties); + }; + + /** + * Encodes the specified GetCaseRequest message. Does not implicitly {@link google.cloud.support.v2.GetCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {google.cloud.support.v2.IGetCaseRequest} message GetCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCaseRequest.encode = function encode(message, writer) { + 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 GetCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.GetCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {google.cloud.support.v2.IGetCaseRequest} message GetCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.GetCaseRequest} GetCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.GetCaseRequest(); + 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 GetCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.GetCaseRequest} GetCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCaseRequest.verify = function verify(message) { + if (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 GetCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.GetCaseRequest} GetCaseRequest + */ + GetCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.GetCaseRequest) + return object; + var message = new $root.google.cloud.support.v2.GetCaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {google.cloud.support.v2.GetCaseRequest} message GetCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCaseRequest.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 GetCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.GetCaseRequest + * @instance + * @returns {Object.} JSON object + */ + GetCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.GetCaseRequest"; + }; + + return GetCaseRequest; + })(); + + v2.CreateCaseRequest = (function() { + + /** + * Properties of a CreateCaseRequest. + * @memberof google.cloud.support.v2 + * @interface ICreateCaseRequest + * @property {string|null} [parent] CreateCaseRequest parent + * @property {google.cloud.support.v2.ICase|null} ["case"] CreateCaseRequest case + */ + + /** + * Constructs a new CreateCaseRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CreateCaseRequest. + * @implements ICreateCaseRequest + * @constructor + * @param {google.cloud.support.v2.ICreateCaseRequest=} [properties] Properties to set + */ + function CreateCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCaseRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2.CreateCaseRequest + * @instance + */ + CreateCaseRequest.prototype.parent = ""; + + /** + * CreateCaseRequest case. + * @member {google.cloud.support.v2.ICase|null|undefined} case + * @memberof google.cloud.support.v2.CreateCaseRequest + * @instance + */ + CreateCaseRequest.prototype["case"] = null; + + /** + * Creates a new CreateCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {google.cloud.support.v2.ICreateCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.CreateCaseRequest} CreateCaseRequest instance + */ + CreateCaseRequest.create = function create(properties) { + return new CreateCaseRequest(properties); + }; + + /** + * Encodes the specified CreateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.CreateCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {google.cloud.support.v2.ICreateCaseRequest} message CreateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) + $root.google.cloud.support.v2.Case.encode(message["case"], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CreateCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {google.cloud.support.v2.ICreateCaseRequest} message CreateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.CreateCaseRequest} CreateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.CreateCaseRequest(); + 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["case"] = $root.google.cloud.support.v2.Case.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.CreateCaseRequest} CreateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message["case"] != null && message.hasOwnProperty("case")) { + var error = $root.google.cloud.support.v2.Case.verify(message["case"]); + if (error) + return "case." + error; + } + return null; + }; + + /** + * Creates a CreateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.CreateCaseRequest} CreateCaseRequest + */ + CreateCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.CreateCaseRequest) + return object; + var message = new $root.google.cloud.support.v2.CreateCaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object["case"] != null) { + if (typeof object["case"] !== "object") + throw TypeError(".google.cloud.support.v2.CreateCaseRequest.case: object expected"); + message["case"] = $root.google.cloud.support.v2.Case.fromObject(object["case"]); + } + return message; + }; + + /** + * Creates a plain object from a CreateCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {google.cloud.support.v2.CreateCaseRequest} message CreateCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object["case"] = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message["case"] != null && message.hasOwnProperty("case")) + object["case"] = $root.google.cloud.support.v2.Case.toObject(message["case"], options); + return object; + }; + + /** + * Converts this CreateCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.CreateCaseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.CreateCaseRequest"; + }; + + return CreateCaseRequest; + })(); + + v2.ListCasesRequest = (function() { + + /** + * Properties of a ListCasesRequest. + * @memberof google.cloud.support.v2 + * @interface IListCasesRequest + * @property {string|null} [parent] ListCasesRequest parent + * @property {string|null} [filter] ListCasesRequest filter + * @property {number|null} [pageSize] ListCasesRequest pageSize + * @property {string|null} [pageToken] ListCasesRequest pageToken + */ + + /** + * Constructs a new ListCasesRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a ListCasesRequest. + * @implements IListCasesRequest + * @constructor + * @param {google.cloud.support.v2.IListCasesRequest=} [properties] Properties to set + */ + function ListCasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.parent = ""; + + /** + * ListCasesRequest filter. + * @member {string} filter + * @memberof google.cloud.support.v2.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.filter = ""; + + /** + * ListCasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.pageSize = 0; + + /** + * ListCasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {google.cloud.support.v2.IListCasesRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.ListCasesRequest} ListCasesRequest instance + */ + ListCasesRequest.create = function create(properties) { + return new ListCasesRequest(properties); + }; + + /** + * Encodes the specified ListCasesRequest message. Does not implicitly {@link google.cloud.support.v2.ListCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {google.cloud.support.v2.IListCasesRequest} message ListCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCasesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {google.cloud.support.v2.IListCasesRequest} message ListCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.ListCasesRequest} ListCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCasesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListCasesRequest(); + 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.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.ListCasesRequest} ListCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCasesRequest message. + * @function verify + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCasesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: 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 ListCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.ListCasesRequest} ListCasesRequest + */ + ListCasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.ListCasesRequest) + return object; + var message = new $root.google.cloud.support.v2.ListCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {google.cloud.support.v2.ListCasesRequest} message ListCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.ListCasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCasesRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.ListCasesRequest"; + }; + + return ListCasesRequest; + })(); + + v2.ListCasesResponse = (function() { + + /** + * Properties of a ListCasesResponse. + * @memberof google.cloud.support.v2 + * @interface IListCasesResponse + * @property {Array.|null} [cases] ListCasesResponse cases + * @property {string|null} [nextPageToken] ListCasesResponse nextPageToken + */ + + /** + * Constructs a new ListCasesResponse. + * @memberof google.cloud.support.v2 + * @classdesc Represents a ListCasesResponse. + * @implements IListCasesResponse + * @constructor + * @param {google.cloud.support.v2.IListCasesResponse=} [properties] Properties to set + */ + function ListCasesResponse(properties) { + this.cases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCasesResponse cases. + * @member {Array.} cases + * @memberof google.cloud.support.v2.ListCasesResponse + * @instance + */ + ListCasesResponse.prototype.cases = $util.emptyArray; + + /** + * ListCasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2.ListCasesResponse + * @instance + */ + ListCasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {google.cloud.support.v2.IListCasesResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2.ListCasesResponse} ListCasesResponse instance + */ + ListCasesResponse.create = function create(properties) { + return new ListCasesResponse(properties); + }; + + /** + * Encodes the specified ListCasesResponse message. Does not implicitly {@link google.cloud.support.v2.ListCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {google.cloud.support.v2.IListCasesResponse} message ListCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cases != null && message.cases.length) + for (var i = 0; i < message.cases.length; ++i) + $root.google.cloud.support.v2.Case.encode(message.cases[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 ListCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {google.cloud.support.v2.IListCasesResponse} message ListCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.ListCasesResponse} ListCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCasesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.cases && message.cases.length)) + message.cases = []; + message.cases.push($root.google.cloud.support.v2.Case.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.ListCasesResponse} ListCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCasesResponse message. + * @function verify + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cases != null && message.hasOwnProperty("cases")) { + if (!Array.isArray(message.cases)) + return "cases: array expected"; + for (var i = 0; i < message.cases.length; ++i) { + var error = $root.google.cloud.support.v2.Case.verify(message.cases[i]); + if (error) + return "cases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.ListCasesResponse} ListCasesResponse + */ + ListCasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.ListCasesResponse) + return object; + var message = new $root.google.cloud.support.v2.ListCasesResponse(); + if (object.cases) { + if (!Array.isArray(object.cases)) + throw TypeError(".google.cloud.support.v2.ListCasesResponse.cases: array expected"); + message.cases = []; + for (var i = 0; i < object.cases.length; ++i) { + if (typeof object.cases[i] !== "object") + throw TypeError(".google.cloud.support.v2.ListCasesResponse.cases: object expected"); + message.cases[i] = $root.google.cloud.support.v2.Case.fromObject(object.cases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {google.cloud.support.v2.ListCasesResponse} message ListCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.cases && message.cases.length) { + object.cases = []; + for (var j = 0; j < message.cases.length; ++j) + object.cases[j] = $root.google.cloud.support.v2.Case.toObject(message.cases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.ListCasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCasesResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.ListCasesResponse"; + }; + + return ListCasesResponse; + })(); + + v2.SearchCasesRequest = (function() { + + /** + * Properties of a SearchCasesRequest. + * @memberof google.cloud.support.v2 + * @interface ISearchCasesRequest + * @property {string|null} [parent] SearchCasesRequest parent + * @property {string|null} [query] SearchCasesRequest query + * @property {number|null} [pageSize] SearchCasesRequest pageSize + * @property {string|null} [pageToken] SearchCasesRequest pageToken + */ + + /** + * Constructs a new SearchCasesRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a SearchCasesRequest. + * @implements ISearchCasesRequest + * @constructor + * @param {google.cloud.support.v2.ISearchCasesRequest=} [properties] Properties to set + */ + function SearchCasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2.SearchCasesRequest + * @instance + */ + SearchCasesRequest.prototype.parent = ""; + + /** + * SearchCasesRequest query. + * @member {string} query + * @memberof google.cloud.support.v2.SearchCasesRequest + * @instance + */ + SearchCasesRequest.prototype.query = ""; + + /** + * SearchCasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2.SearchCasesRequest + * @instance + */ + SearchCasesRequest.prototype.pageSize = 0; + + /** + * SearchCasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2.SearchCasesRequest + * @instance + */ + SearchCasesRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {google.cloud.support.v2.ISearchCasesRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.SearchCasesRequest} SearchCasesRequest instance + */ + SearchCasesRequest.create = function create(properties) { + return new SearchCasesRequest(properties); + }; + + /** + * Encodes the specified SearchCasesRequest message. Does not implicitly {@link google.cloud.support.v2.SearchCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {google.cloud.support.v2.ISearchCasesRequest} message SearchCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCasesRequest.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.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified SearchCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {google.cloud.support.v2.ISearchCasesRequest} message SearchCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.SearchCasesRequest} SearchCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCasesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.SearchCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.parent = reader.string(); + break; + } + case 1: { + message.query = 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 SearchCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.SearchCasesRequest} SearchCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCasesRequest message. + * @function verify + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCasesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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 SearchCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.SearchCasesRequest} SearchCasesRequest + */ + SearchCasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.SearchCasesRequest) + return object; + var message = new $root.google.cloud.support.v2.SearchCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.query != null) + message.query = String(object.query); + 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 SearchCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {google.cloud.support.v2.SearchCasesRequest} message SearchCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + object.parent = ""; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this SearchCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.SearchCasesRequest + * @instance + * @returns {Object.} JSON object + */ + SearchCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCasesRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.SearchCasesRequest"; + }; + + return SearchCasesRequest; + })(); + + v2.SearchCasesResponse = (function() { + + /** + * Properties of a SearchCasesResponse. + * @memberof google.cloud.support.v2 + * @interface ISearchCasesResponse + * @property {Array.|null} [cases] SearchCasesResponse cases + * @property {string|null} [nextPageToken] SearchCasesResponse nextPageToken + */ + + /** + * Constructs a new SearchCasesResponse. + * @memberof google.cloud.support.v2 + * @classdesc Represents a SearchCasesResponse. + * @implements ISearchCasesResponse + * @constructor + * @param {google.cloud.support.v2.ISearchCasesResponse=} [properties] Properties to set + */ + function SearchCasesResponse(properties) { + this.cases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCasesResponse cases. + * @member {Array.} cases + * @memberof google.cloud.support.v2.SearchCasesResponse + * @instance + */ + SearchCasesResponse.prototype.cases = $util.emptyArray; + + /** + * SearchCasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2.SearchCasesResponse + * @instance + */ + SearchCasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {google.cloud.support.v2.ISearchCasesResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2.SearchCasesResponse} SearchCasesResponse instance + */ + SearchCasesResponse.create = function create(properties) { + return new SearchCasesResponse(properties); + }; + + /** + * Encodes the specified SearchCasesResponse message. Does not implicitly {@link google.cloud.support.v2.SearchCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {google.cloud.support.v2.ISearchCasesResponse} message SearchCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cases != null && message.cases.length) + for (var i = 0; i < message.cases.length; ++i) + $root.google.cloud.support.v2.Case.encode(message.cases[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 SearchCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {google.cloud.support.v2.ISearchCasesResponse} message SearchCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.SearchCasesResponse} SearchCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCasesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.SearchCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.cases && message.cases.length)) + message.cases = []; + message.cases.push($root.google.cloud.support.v2.Case.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.SearchCasesResponse} SearchCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCasesResponse message. + * @function verify + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cases != null && message.hasOwnProperty("cases")) { + if (!Array.isArray(message.cases)) + return "cases: array expected"; + for (var i = 0; i < message.cases.length; ++i) { + var error = $root.google.cloud.support.v2.Case.verify(message.cases[i]); + if (error) + return "cases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.SearchCasesResponse} SearchCasesResponse + */ + SearchCasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.SearchCasesResponse) + return object; + var message = new $root.google.cloud.support.v2.SearchCasesResponse(); + if (object.cases) { + if (!Array.isArray(object.cases)) + throw TypeError(".google.cloud.support.v2.SearchCasesResponse.cases: array expected"); + message.cases = []; + for (var i = 0; i < object.cases.length; ++i) { + if (typeof object.cases[i] !== "object") + throw TypeError(".google.cloud.support.v2.SearchCasesResponse.cases: object expected"); + message.cases[i] = $root.google.cloud.support.v2.Case.fromObject(object.cases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {google.cloud.support.v2.SearchCasesResponse} message SearchCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.cases && message.cases.length) { + object.cases = []; + for (var j = 0; j < message.cases.length; ++j) + object.cases[j] = $root.google.cloud.support.v2.Case.toObject(message.cases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.SearchCasesResponse + * @instance + * @returns {Object.} JSON object + */ + SearchCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCasesResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.SearchCasesResponse"; + }; + + return SearchCasesResponse; + })(); + + v2.EscalateCaseRequest = (function() { + + /** + * Properties of an EscalateCaseRequest. + * @memberof google.cloud.support.v2 + * @interface IEscalateCaseRequest + * @property {string|null} [name] EscalateCaseRequest name + * @property {google.cloud.support.v2.IEscalation|null} [escalation] EscalateCaseRequest escalation + */ + + /** + * Constructs a new EscalateCaseRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents an EscalateCaseRequest. + * @implements IEscalateCaseRequest + * @constructor + * @param {google.cloud.support.v2.IEscalateCaseRequest=} [properties] Properties to set + */ + function EscalateCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EscalateCaseRequest name. + * @member {string} name + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @instance + */ + EscalateCaseRequest.prototype.name = ""; + + /** + * EscalateCaseRequest escalation. + * @member {google.cloud.support.v2.IEscalation|null|undefined} escalation + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @instance + */ + EscalateCaseRequest.prototype.escalation = null; + + /** + * Creates a new EscalateCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {google.cloud.support.v2.IEscalateCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.EscalateCaseRequest} EscalateCaseRequest instance + */ + EscalateCaseRequest.create = function create(properties) { + return new EscalateCaseRequest(properties); + }; + + /** + * Encodes the specified EscalateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.EscalateCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {google.cloud.support.v2.IEscalateCaseRequest} message EscalateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EscalateCaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.escalation != null && Object.hasOwnProperty.call(message, "escalation")) + $root.google.cloud.support.v2.Escalation.encode(message.escalation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EscalateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.EscalateCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {google.cloud.support.v2.IEscalateCaseRequest} message EscalateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EscalateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EscalateCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.EscalateCaseRequest} EscalateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EscalateCaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.EscalateCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.escalation = $root.google.cloud.support.v2.Escalation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EscalateCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.EscalateCaseRequest} EscalateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EscalateCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EscalateCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EscalateCaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.escalation != null && message.hasOwnProperty("escalation")) { + var error = $root.google.cloud.support.v2.Escalation.verify(message.escalation); + if (error) + return "escalation." + error; + } + return null; + }; + + /** + * Creates an EscalateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.EscalateCaseRequest} EscalateCaseRequest + */ + EscalateCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.EscalateCaseRequest) + return object; + var message = new $root.google.cloud.support.v2.EscalateCaseRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.escalation != null) { + if (typeof object.escalation !== "object") + throw TypeError(".google.cloud.support.v2.EscalateCaseRequest.escalation: object expected"); + message.escalation = $root.google.cloud.support.v2.Escalation.fromObject(object.escalation); + } + return message; + }; + + /** + * Creates a plain object from an EscalateCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {google.cloud.support.v2.EscalateCaseRequest} message EscalateCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EscalateCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.escalation = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.escalation != null && message.hasOwnProperty("escalation")) + object.escalation = $root.google.cloud.support.v2.Escalation.toObject(message.escalation, options); + return object; + }; + + /** + * Converts this EscalateCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @instance + * @returns {Object.} JSON object + */ + EscalateCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EscalateCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EscalateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.EscalateCaseRequest"; + }; + + return EscalateCaseRequest; + })(); + + v2.UpdateCaseRequest = (function() { + + /** + * Properties of an UpdateCaseRequest. + * @memberof google.cloud.support.v2 + * @interface IUpdateCaseRequest + * @property {google.cloud.support.v2.ICase|null} ["case"] UpdateCaseRequest case + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCaseRequest updateMask + */ + + /** + * Constructs a new UpdateCaseRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents an UpdateCaseRequest. + * @implements IUpdateCaseRequest + * @constructor + * @param {google.cloud.support.v2.IUpdateCaseRequest=} [properties] Properties to set + */ + function UpdateCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCaseRequest case. + * @member {google.cloud.support.v2.ICase|null|undefined} case + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @instance + */ + UpdateCaseRequest.prototype["case"] = null; + + /** + * UpdateCaseRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @instance + */ + UpdateCaseRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {google.cloud.support.v2.IUpdateCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.UpdateCaseRequest} UpdateCaseRequest instance + */ + UpdateCaseRequest.create = function create(properties) { + return new UpdateCaseRequest(properties); + }; + + /** + * Encodes the specified UpdateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.UpdateCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {google.cloud.support.v2.IUpdateCaseRequest} message UpdateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) + $root.google.cloud.support.v2.Case.encode(message["case"], 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 UpdateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.UpdateCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {google.cloud.support.v2.IUpdateCaseRequest} message UpdateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.UpdateCaseRequest} UpdateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.UpdateCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message["case"] = $root.google.cloud.support.v2.Case.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 UpdateCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.UpdateCaseRequest} UpdateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message["case"] != null && message.hasOwnProperty("case")) { + var error = $root.google.cloud.support.v2.Case.verify(message["case"]); + if (error) + return "case." + 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 UpdateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.UpdateCaseRequest} UpdateCaseRequest + */ + UpdateCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.UpdateCaseRequest) + return object; + var message = new $root.google.cloud.support.v2.UpdateCaseRequest(); + if (object["case"] != null) { + if (typeof object["case"] !== "object") + throw TypeError(".google.cloud.support.v2.UpdateCaseRequest.case: object expected"); + message["case"] = $root.google.cloud.support.v2.Case.fromObject(object["case"]); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.support.v2.UpdateCaseRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {google.cloud.support.v2.UpdateCaseRequest} message UpdateCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object["case"] = null; + object.updateMask = null; + } + if (message["case"] != null && message.hasOwnProperty("case")) + object["case"] = $root.google.cloud.support.v2.Case.toObject(message["case"], options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.UpdateCaseRequest"; + }; + + return UpdateCaseRequest; + })(); + + v2.CloseCaseRequest = (function() { + + /** + * Properties of a CloseCaseRequest. + * @memberof google.cloud.support.v2 + * @interface ICloseCaseRequest + * @property {string|null} [name] CloseCaseRequest name + */ + + /** + * Constructs a new CloseCaseRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CloseCaseRequest. + * @implements ICloseCaseRequest + * @constructor + * @param {google.cloud.support.v2.ICloseCaseRequest=} [properties] Properties to set + */ + function CloseCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloseCaseRequest name. + * @member {string} name + * @memberof google.cloud.support.v2.CloseCaseRequest + * @instance + */ + CloseCaseRequest.prototype.name = ""; + + /** + * Creates a new CloseCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {google.cloud.support.v2.ICloseCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.CloseCaseRequest} CloseCaseRequest instance + */ + CloseCaseRequest.create = function create(properties) { + return new CloseCaseRequest(properties); + }; + + /** + * Encodes the specified CloseCaseRequest message. Does not implicitly {@link google.cloud.support.v2.CloseCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {google.cloud.support.v2.ICloseCaseRequest} message CloseCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseCaseRequest.encode = function encode(message, writer) { + 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 CloseCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CloseCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {google.cloud.support.v2.ICloseCaseRequest} message CloseCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloseCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.CloseCaseRequest} CloseCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseCaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.CloseCaseRequest(); + 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 CloseCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.CloseCaseRequest} CloseCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloseCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloseCaseRequest.verify = function verify(message) { + if (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 CloseCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.CloseCaseRequest} CloseCaseRequest + */ + CloseCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.CloseCaseRequest) + return object; + var message = new $root.google.cloud.support.v2.CloseCaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CloseCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {google.cloud.support.v2.CloseCaseRequest} message CloseCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloseCaseRequest.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 CloseCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.CloseCaseRequest + * @instance + * @returns {Object.} JSON object + */ + CloseCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloseCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.CloseCaseRequest"; + }; + + return CloseCaseRequest; + })(); + + v2.SearchCaseClassificationsRequest = (function() { + + /** + * Properties of a SearchCaseClassificationsRequest. + * @memberof google.cloud.support.v2 + * @interface ISearchCaseClassificationsRequest + * @property {string|null} [query] SearchCaseClassificationsRequest query + * @property {number|null} [pageSize] SearchCaseClassificationsRequest pageSize + * @property {string|null} [pageToken] SearchCaseClassificationsRequest pageToken + */ + + /** + * Constructs a new SearchCaseClassificationsRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a SearchCaseClassificationsRequest. + * @implements ISearchCaseClassificationsRequest + * @constructor + * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest=} [properties] Properties to set + */ + function SearchCaseClassificationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCaseClassificationsRequest query. + * @member {string} query + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @instance + */ + SearchCaseClassificationsRequest.prototype.query = ""; + + /** + * SearchCaseClassificationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @instance + */ + SearchCaseClassificationsRequest.prototype.pageSize = 0; + + /** + * SearchCaseClassificationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @instance + */ + SearchCaseClassificationsRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchCaseClassificationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest instance + */ + SearchCaseClassificationsRequest.create = function create(properties) { + return new SearchCaseClassificationsRequest(properties); + }; + + /** + * Encodes the specified SearchCaseClassificationsRequest message. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest} message SearchCaseClassificationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCaseClassificationsRequest.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.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified SearchCaseClassificationsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest} message SearchCaseClassificationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCaseClassificationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCaseClassificationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.SearchCaseClassificationsRequest(); + 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.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCaseClassificationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCaseClassificationsRequest message. + * @function verify + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCaseClassificationsRequest.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.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 SearchCaseClassificationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest + */ + SearchCaseClassificationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.SearchCaseClassificationsRequest) + return object; + var message = new $root.google.cloud.support.v2.SearchCaseClassificationsRequest(); + if (object.query != null) + message.query = String(object.query); + 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 SearchCaseClassificationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {google.cloud.support.v2.SearchCaseClassificationsRequest} message SearchCaseClassificationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCaseClassificationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this SearchCaseClassificationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchCaseClassificationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCaseClassificationsRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCaseClassificationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.SearchCaseClassificationsRequest"; + }; + + return SearchCaseClassificationsRequest; + })(); + + v2.SearchCaseClassificationsResponse = (function() { + + /** + * Properties of a SearchCaseClassificationsResponse. + * @memberof google.cloud.support.v2 + * @interface ISearchCaseClassificationsResponse + * @property {Array.|null} [caseClassifications] SearchCaseClassificationsResponse caseClassifications + * @property {string|null} [nextPageToken] SearchCaseClassificationsResponse nextPageToken + */ + + /** + * Constructs a new SearchCaseClassificationsResponse. + * @memberof google.cloud.support.v2 + * @classdesc Represents a SearchCaseClassificationsResponse. + * @implements ISearchCaseClassificationsResponse + * @constructor + * @param {google.cloud.support.v2.ISearchCaseClassificationsResponse=} [properties] Properties to set + */ + function SearchCaseClassificationsResponse(properties) { + this.caseClassifications = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCaseClassificationsResponse caseClassifications. + * @member {Array.} caseClassifications + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @instance + */ + SearchCaseClassificationsResponse.prototype.caseClassifications = $util.emptyArray; + + /** + * SearchCaseClassificationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @instance + */ + SearchCaseClassificationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchCaseClassificationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {google.cloud.support.v2.ISearchCaseClassificationsResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse instance + */ + SearchCaseClassificationsResponse.create = function create(properties) { + return new SearchCaseClassificationsResponse(properties); + }; + + /** + * Encodes the specified SearchCaseClassificationsResponse message. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {google.cloud.support.v2.ISearchCaseClassificationsResponse} message SearchCaseClassificationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCaseClassificationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caseClassifications != null && message.caseClassifications.length) + for (var i = 0; i < message.caseClassifications.length; ++i) + $root.google.cloud.support.v2.CaseClassification.encode(message.caseClassifications[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 SearchCaseClassificationsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {google.cloud.support.v2.ISearchCaseClassificationsResponse} message SearchCaseClassificationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCaseClassificationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCaseClassificationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.SearchCaseClassificationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.caseClassifications && message.caseClassifications.length)) + message.caseClassifications = []; + message.caseClassifications.push($root.google.cloud.support.v2.CaseClassification.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCaseClassificationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCaseClassificationsResponse message. + * @function verify + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCaseClassificationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caseClassifications != null && message.hasOwnProperty("caseClassifications")) { + if (!Array.isArray(message.caseClassifications)) + return "caseClassifications: array expected"; + for (var i = 0; i < message.caseClassifications.length; ++i) { + var error = $root.google.cloud.support.v2.CaseClassification.verify(message.caseClassifications[i]); + if (error) + return "caseClassifications." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchCaseClassificationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse + */ + SearchCaseClassificationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.SearchCaseClassificationsResponse) + return object; + var message = new $root.google.cloud.support.v2.SearchCaseClassificationsResponse(); + if (object.caseClassifications) { + if (!Array.isArray(object.caseClassifications)) + throw TypeError(".google.cloud.support.v2.SearchCaseClassificationsResponse.caseClassifications: array expected"); + message.caseClassifications = []; + for (var i = 0; i < object.caseClassifications.length; ++i) { + if (typeof object.caseClassifications[i] !== "object") + throw TypeError(".google.cloud.support.v2.SearchCaseClassificationsResponse.caseClassifications: object expected"); + message.caseClassifications[i] = $root.google.cloud.support.v2.CaseClassification.fromObject(object.caseClassifications[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchCaseClassificationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {google.cloud.support.v2.SearchCaseClassificationsResponse} message SearchCaseClassificationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCaseClassificationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.caseClassifications = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.caseClassifications && message.caseClassifications.length) { + object.caseClassifications = []; + for (var j = 0; j < message.caseClassifications.length; ++j) + object.caseClassifications[j] = $root.google.cloud.support.v2.CaseClassification.toObject(message.caseClassifications[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchCaseClassificationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchCaseClassificationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCaseClassificationsResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCaseClassificationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.SearchCaseClassificationsResponse"; + }; + + return SearchCaseClassificationsResponse; + })(); + + v2.Escalation = (function() { + + /** + * Properties of an Escalation. + * @memberof google.cloud.support.v2 + * @interface IEscalation + * @property {google.cloud.support.v2.Escalation.Reason|null} [reason] Escalation reason + * @property {string|null} [justification] Escalation justification + */ + + /** + * Constructs a new Escalation. + * @memberof google.cloud.support.v2 + * @classdesc Represents an Escalation. + * @implements IEscalation + * @constructor + * @param {google.cloud.support.v2.IEscalation=} [properties] Properties to set + */ + function Escalation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Escalation reason. + * @member {google.cloud.support.v2.Escalation.Reason} reason + * @memberof google.cloud.support.v2.Escalation + * @instance + */ + Escalation.prototype.reason = 0; + + /** + * Escalation justification. + * @member {string} justification + * @memberof google.cloud.support.v2.Escalation + * @instance + */ + Escalation.prototype.justification = ""; + + /** + * Creates a new Escalation instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {google.cloud.support.v2.IEscalation=} [properties] Properties to set + * @returns {google.cloud.support.v2.Escalation} Escalation instance + */ + Escalation.create = function create(properties) { + return new Escalation(properties); + }; + + /** + * Encodes the specified Escalation message. Does not implicitly {@link google.cloud.support.v2.Escalation.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {google.cloud.support.v2.IEscalation} message Escalation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Escalation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.reason); + if (message.justification != null && Object.hasOwnProperty.call(message, "justification")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.justification); + return writer; + }; + + /** + * Encodes the specified Escalation message, length delimited. Does not implicitly {@link google.cloud.support.v2.Escalation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {google.cloud.support.v2.IEscalation} message Escalation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Escalation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Escalation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.Escalation} Escalation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Escalation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Escalation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.reason = reader.int32(); + break; + } + case 5: { + message.justification = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Escalation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.Escalation} Escalation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Escalation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Escalation message. + * @function verify + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Escalation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.justification != null && message.hasOwnProperty("justification")) + if (!$util.isString(message.justification)) + return "justification: string expected"; + return null; + }; + + /** + * Creates an Escalation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.Escalation} Escalation + */ + Escalation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.Escalation) + return object; + var message = new $root.google.cloud.support.v2.Escalation(); + switch (object.reason) { + default: + if (typeof object.reason === "number") { + message.reason = object.reason; + break; + } + break; + case "REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "RESOLUTION_TIME": + case 1: + message.reason = 1; + break; + case "TECHNICAL_EXPERTISE": + case 2: + message.reason = 2; + break; + case "BUSINESS_IMPACT": + case 3: + message.reason = 3; + break; + } + if (object.justification != null) + message.justification = String(object.justification); + return message; + }; + + /** + * Creates a plain object from an Escalation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {google.cloud.support.v2.Escalation} message Escalation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Escalation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.reason = options.enums === String ? "REASON_UNSPECIFIED" : 0; + object.justification = ""; + } + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = options.enums === String ? $root.google.cloud.support.v2.Escalation.Reason[message.reason] === undefined ? message.reason : $root.google.cloud.support.v2.Escalation.Reason[message.reason] : message.reason; + if (message.justification != null && message.hasOwnProperty("justification")) + object.justification = message.justification; + return object; + }; + + /** + * Converts this Escalation to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.Escalation + * @instance + * @returns {Object.} JSON object + */ + Escalation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Escalation + * @function getTypeUrl + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Escalation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.Escalation"; + }; + + /** + * Reason enum. + * @name google.cloud.support.v2.Escalation.Reason + * @enum {number} + * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value + * @property {number} RESOLUTION_TIME=1 RESOLUTION_TIME value + * @property {number} TECHNICAL_EXPERTISE=2 TECHNICAL_EXPERTISE value + * @property {number} BUSINESS_IMPACT=3 BUSINESS_IMPACT value + */ + Escalation.Reason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOLUTION_TIME"] = 1; + values[valuesById[2] = "TECHNICAL_EXPERTISE"] = 2; + values[valuesById[3] = "BUSINESS_IMPACT"] = 3; + return values; + })(); + + return Escalation; + })(); + + v2.Comment = (function() { + + /** + * Properties of a Comment. + * @memberof google.cloud.support.v2 + * @interface IComment + * @property {string|null} [name] Comment name + * @property {google.protobuf.ITimestamp|null} [createTime] Comment createTime + * @property {google.cloud.support.v2.IActor|null} [creator] Comment creator + * @property {string|null} [body] Comment body + * @property {string|null} [plainTextBody] Comment plainTextBody + */ + + /** + * Constructs a new Comment. + * @memberof google.cloud.support.v2 + * @classdesc Represents a Comment. + * @implements IComment + * @constructor + * @param {google.cloud.support.v2.IComment=} [properties] Properties to set + */ + function Comment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Comment name. + * @member {string} name + * @memberof google.cloud.support.v2.Comment + * @instance + */ + Comment.prototype.name = ""; + + /** + * Comment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.support.v2.Comment + * @instance + */ + Comment.prototype.createTime = null; + + /** + * Comment creator. + * @member {google.cloud.support.v2.IActor|null|undefined} creator + * @memberof google.cloud.support.v2.Comment + * @instance + */ + Comment.prototype.creator = null; + + /** + * Comment body. + * @member {string} body + * @memberof google.cloud.support.v2.Comment + * @instance + */ + Comment.prototype.body = ""; + + /** + * Comment plainTextBody. + * @member {string} plainTextBody + * @memberof google.cloud.support.v2.Comment + * @instance + */ + Comment.prototype.plainTextBody = ""; + + /** + * Creates a new Comment instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.Comment + * @static + * @param {google.cloud.support.v2.IComment=} [properties] Properties to set + * @returns {google.cloud.support.v2.Comment} Comment instance + */ + Comment.create = function create(properties) { + return new Comment(properties); + }; + + /** + * Encodes the specified Comment message. Does not implicitly {@link google.cloud.support.v2.Comment.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.Comment + * @static + * @param {google.cloud.support.v2.IComment} message Comment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Comment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + $root.google.cloud.support.v2.Actor.encode(message.creator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.body); + if (message.plainTextBody != null && Object.hasOwnProperty.call(message, "plainTextBody")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plainTextBody); + return writer; + }; + + /** + * Encodes the specified Comment message, length delimited. Does not implicitly {@link google.cloud.support.v2.Comment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.Comment + * @static + * @param {google.cloud.support.v2.IComment} message Comment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Comment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Comment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.Comment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.Comment} Comment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Comment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Comment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.creator = $root.google.cloud.support.v2.Actor.decode(reader, reader.uint32()); + break; + } + case 4: { + message.body = reader.string(); + break; + } + case 5: { + message.plainTextBody = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Comment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.Comment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.Comment} Comment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Comment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Comment message. + * @function verify + * @memberof google.cloud.support.v2.Comment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Comment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: 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.creator != null && message.hasOwnProperty("creator")) { + var error = $root.google.cloud.support.v2.Actor.verify(message.creator); + if (error) + return "creator." + error; + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.plainTextBody != null && message.hasOwnProperty("plainTextBody")) + if (!$util.isString(message.plainTextBody)) + return "plainTextBody: string expected"; + return null; + }; + + /** + * Creates a Comment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.Comment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.Comment} Comment + */ + Comment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.Comment) + return object; + var message = new $root.google.cloud.support.v2.Comment(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.support.v2.Comment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.creator != null) { + if (typeof object.creator !== "object") + throw TypeError(".google.cloud.support.v2.Comment.creator: object expected"); + message.creator = $root.google.cloud.support.v2.Actor.fromObject(object.creator); + } + if (object.body != null) + message.body = String(object.body); + if (object.plainTextBody != null) + message.plainTextBody = String(object.plainTextBody); + return message; + }; + + /** + * Creates a plain object from a Comment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.Comment + * @static + * @param {google.cloud.support.v2.Comment} message Comment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Comment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.creator = null; + object.body = ""; + object.plainTextBody = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = $root.google.cloud.support.v2.Actor.toObject(message.creator, options); + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.plainTextBody != null && message.hasOwnProperty("plainTextBody")) + object.plainTextBody = message.plainTextBody; + return object; + }; + + /** + * Converts this Comment to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.Comment + * @instance + * @returns {Object.} JSON object + */ + Comment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Comment + * @function getTypeUrl + * @memberof google.cloud.support.v2.Comment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Comment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.Comment"; + }; + + return Comment; + })(); + + v2.CommentService = (function() { + + /** + * Constructs a new CommentService service. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CommentService + * @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 CommentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CommentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CommentService; + + /** + * Creates new CommentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.support.v2.CommentService + * @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 {CommentService} RPC service. Useful where requests and/or responses are streamed. + */ + CommentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.support.v2.CommentService|listComments}. + * @memberof google.cloud.support.v2.CommentService + * @typedef ListCommentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.ListCommentsResponse} [response] ListCommentsResponse + */ + + /** + * Calls ListComments. + * @function listComments + * @memberof google.cloud.support.v2.CommentService + * @instance + * @param {google.cloud.support.v2.IListCommentsRequest} request ListCommentsRequest message or plain object + * @param {google.cloud.support.v2.CommentService.ListCommentsCallback} callback Node-style callback called with the error, if any, and ListCommentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CommentService.prototype.listComments = function listComments(request, callback) { + return this.rpcCall(listComments, $root.google.cloud.support.v2.ListCommentsRequest, $root.google.cloud.support.v2.ListCommentsResponse, request, callback); + }, "name", { value: "ListComments" }); + + /** + * Calls ListComments. + * @function listComments + * @memberof google.cloud.support.v2.CommentService + * @instance + * @param {google.cloud.support.v2.IListCommentsRequest} request ListCommentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CommentService|createComment}. + * @memberof google.cloud.support.v2.CommentService + * @typedef CreateCommentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.Comment} [response] Comment + */ + + /** + * Calls CreateComment. + * @function createComment + * @memberof google.cloud.support.v2.CommentService + * @instance + * @param {google.cloud.support.v2.ICreateCommentRequest} request CreateCommentRequest message or plain object + * @param {google.cloud.support.v2.CommentService.CreateCommentCallback} callback Node-style callback called with the error, if any, and Comment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CommentService.prototype.createComment = function createComment(request, callback) { + return this.rpcCall(createComment, $root.google.cloud.support.v2.CreateCommentRequest, $root.google.cloud.support.v2.Comment, request, callback); + }, "name", { value: "CreateComment" }); + + /** + * Calls CreateComment. + * @function createComment + * @memberof google.cloud.support.v2.CommentService + * @instance + * @param {google.cloud.support.v2.ICreateCommentRequest} request CreateCommentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CommentService; + })(); + + v2.ListCommentsRequest = (function() { + + /** + * Properties of a ListCommentsRequest. + * @memberof google.cloud.support.v2 + * @interface IListCommentsRequest + * @property {string|null} [parent] ListCommentsRequest parent + * @property {number|null} [pageSize] ListCommentsRequest pageSize + * @property {string|null} [pageToken] ListCommentsRequest pageToken + */ + + /** + * Constructs a new ListCommentsRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a ListCommentsRequest. + * @implements IListCommentsRequest + * @constructor + * @param {google.cloud.support.v2.IListCommentsRequest=} [properties] Properties to set + */ + function ListCommentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCommentsRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2.ListCommentsRequest + * @instance + */ + ListCommentsRequest.prototype.parent = ""; + + /** + * ListCommentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2.ListCommentsRequest + * @instance + */ + ListCommentsRequest.prototype.pageSize = 0; + + /** + * ListCommentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2.ListCommentsRequest + * @instance + */ + ListCommentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCommentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {google.cloud.support.v2.IListCommentsRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.ListCommentsRequest} ListCommentsRequest instance + */ + ListCommentsRequest.create = function create(properties) { + return new ListCommentsRequest(properties); + }; + + /** + * Encodes the specified ListCommentsRequest message. Does not implicitly {@link google.cloud.support.v2.ListCommentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {google.cloud.support.v2.IListCommentsRequest} message ListCommentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCommentsRequest.encode = function encode(message, writer) { + if (!writer) + 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 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCommentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCommentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {google.cloud.support.v2.IListCommentsRequest} message ListCommentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCommentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCommentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.ListCommentsRequest} ListCommentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCommentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListCommentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCommentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.ListCommentsRequest} ListCommentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCommentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCommentsRequest message. + * @function verify + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCommentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCommentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.ListCommentsRequest} ListCommentsRequest + */ + ListCommentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.ListCommentsRequest) + return object; + var message = new $root.google.cloud.support.v2.ListCommentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCommentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {google.cloud.support.v2.ListCommentsRequest} message ListCommentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCommentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListCommentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.ListCommentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCommentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCommentsRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCommentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.ListCommentsRequest"; + }; + + return ListCommentsRequest; + })(); + + v2.ListCommentsResponse = (function() { + + /** + * Properties of a ListCommentsResponse. + * @memberof google.cloud.support.v2 + * @interface IListCommentsResponse + * @property {Array.|null} [comments] ListCommentsResponse comments + * @property {string|null} [nextPageToken] ListCommentsResponse nextPageToken + */ + + /** + * Constructs a new ListCommentsResponse. + * @memberof google.cloud.support.v2 + * @classdesc Represents a ListCommentsResponse. + * @implements IListCommentsResponse + * @constructor + * @param {google.cloud.support.v2.IListCommentsResponse=} [properties] Properties to set + */ + function ListCommentsResponse(properties) { + this.comments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCommentsResponse comments. + * @member {Array.} comments + * @memberof google.cloud.support.v2.ListCommentsResponse + * @instance + */ + ListCommentsResponse.prototype.comments = $util.emptyArray; + + /** + * ListCommentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2.ListCommentsResponse + * @instance + */ + ListCommentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCommentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {google.cloud.support.v2.IListCommentsResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2.ListCommentsResponse} ListCommentsResponse instance + */ + ListCommentsResponse.create = function create(properties) { + return new ListCommentsResponse(properties); + }; + + /** + * Encodes the specified ListCommentsResponse message. Does not implicitly {@link google.cloud.support.v2.ListCommentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {google.cloud.support.v2.IListCommentsResponse} message ListCommentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCommentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.comments != null && message.comments.length) + for (var i = 0; i < message.comments.length; ++i) + $root.google.cloud.support.v2.Comment.encode(message.comments[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 ListCommentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCommentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {google.cloud.support.v2.IListCommentsResponse} message ListCommentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCommentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCommentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.ListCommentsResponse} ListCommentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCommentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListCommentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.comments && message.comments.length)) + message.comments = []; + message.comments.push($root.google.cloud.support.v2.Comment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCommentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.ListCommentsResponse} ListCommentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCommentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCommentsResponse message. + * @function verify + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCommentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.comments != null && message.hasOwnProperty("comments")) { + if (!Array.isArray(message.comments)) + return "comments: array expected"; + for (var i = 0; i < message.comments.length; ++i) { + var error = $root.google.cloud.support.v2.Comment.verify(message.comments[i]); + if (error) + return "comments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCommentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.ListCommentsResponse} ListCommentsResponse + */ + ListCommentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.ListCommentsResponse) + return object; + var message = new $root.google.cloud.support.v2.ListCommentsResponse(); + if (object.comments) { + if (!Array.isArray(object.comments)) + throw TypeError(".google.cloud.support.v2.ListCommentsResponse.comments: array expected"); + message.comments = []; + for (var i = 0; i < object.comments.length; ++i) { + if (typeof object.comments[i] !== "object") + throw TypeError(".google.cloud.support.v2.ListCommentsResponse.comments: object expected"); + message.comments[i] = $root.google.cloud.support.v2.Comment.fromObject(object.comments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCommentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {google.cloud.support.v2.ListCommentsResponse} message ListCommentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCommentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.comments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.comments && message.comments.length) { + object.comments = []; + for (var j = 0; j < message.comments.length; ++j) + object.comments[j] = $root.google.cloud.support.v2.Comment.toObject(message.comments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCommentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.ListCommentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCommentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCommentsResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCommentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.ListCommentsResponse"; + }; + + return ListCommentsResponse; + })(); + + v2.CreateCommentRequest = (function() { + + /** + * Properties of a CreateCommentRequest. + * @memberof google.cloud.support.v2 + * @interface ICreateCommentRequest + * @property {string|null} [parent] CreateCommentRequest parent + * @property {google.cloud.support.v2.IComment|null} [comment] CreateCommentRequest comment + */ + + /** + * Constructs a new CreateCommentRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CreateCommentRequest. + * @implements ICreateCommentRequest + * @constructor + * @param {google.cloud.support.v2.ICreateCommentRequest=} [properties] Properties to set + */ + function CreateCommentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCommentRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2.CreateCommentRequest + * @instance + */ + CreateCommentRequest.prototype.parent = ""; + + /** + * CreateCommentRequest comment. + * @member {google.cloud.support.v2.IComment|null|undefined} comment + * @memberof google.cloud.support.v2.CreateCommentRequest + * @instance + */ + CreateCommentRequest.prototype.comment = null; + + /** + * Creates a new CreateCommentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {google.cloud.support.v2.ICreateCommentRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.CreateCommentRequest} CreateCommentRequest instance + */ + CreateCommentRequest.create = function create(properties) { + return new CreateCommentRequest(properties); + }; + + /** + * Encodes the specified CreateCommentRequest message. Does not implicitly {@link google.cloud.support.v2.CreateCommentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {google.cloud.support.v2.ICreateCommentRequest} message CreateCommentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCommentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) + $root.google.cloud.support.v2.Comment.encode(message.comment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CreateCommentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {google.cloud.support.v2.ICreateCommentRequest} message CreateCommentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCommentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCommentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.CreateCommentRequest} CreateCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCommentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.CreateCommentRequest(); + 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.comment = $root.google.cloud.support.v2.Comment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCommentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.CreateCommentRequest} CreateCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCommentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCommentRequest message. + * @function verify + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCommentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.comment != null && message.hasOwnProperty("comment")) { + var error = $root.google.cloud.support.v2.Comment.verify(message.comment); + if (error) + return "comment." + error; + } + return null; + }; + + /** + * Creates a CreateCommentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.CreateCommentRequest} CreateCommentRequest + */ + CreateCommentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.CreateCommentRequest) + return object; + var message = new $root.google.cloud.support.v2.CreateCommentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.comment != null) { + if (typeof object.comment !== "object") + throw TypeError(".google.cloud.support.v2.CreateCommentRequest.comment: object expected"); + message.comment = $root.google.cloud.support.v2.Comment.fromObject(object.comment); + } + return message; + }; + + /** + * Creates a plain object from a CreateCommentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {google.cloud.support.v2.CreateCommentRequest} message CreateCommentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCommentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.comment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.comment != null && message.hasOwnProperty("comment")) + object.comment = $root.google.cloud.support.v2.Comment.toObject(message.comment, options); + return object; + }; + + /** + * Converts this CreateCommentRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.CreateCommentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCommentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCommentRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCommentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.CreateCommentRequest"; + }; + + return CreateCommentRequest; + })(); + + return v2; + })(); + + support.v2beta = (function() { + + /** + * Namespace v2beta. + * @memberof google.cloud.support + * @namespace + */ + var v2beta = {}; + + v2beta.Actor = (function() { + + /** + * Properties of an Actor. + * @memberof google.cloud.support.v2beta + * @interface IActor + * @property {string|null} [displayName] Actor displayName + * @property {string|null} [email] Actor email + * @property {boolean|null} [googleSupport] Actor googleSupport + * @property {string|null} [username] Actor username + */ + + /** + * Constructs a new Actor. + * @memberof google.cloud.support.v2beta + * @classdesc Represents an Actor. + * @implements IActor + * @constructor + * @param {google.cloud.support.v2beta.IActor=} [properties] Properties to set + */ + function Actor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Actor displayName. + * @member {string} displayName + * @memberof google.cloud.support.v2beta.Actor + * @instance + */ + Actor.prototype.displayName = ""; + + /** + * Actor email. + * @member {string} email + * @memberof google.cloud.support.v2beta.Actor + * @instance + */ + Actor.prototype.email = ""; + + /** + * Actor googleSupport. + * @member {boolean} googleSupport + * @memberof google.cloud.support.v2beta.Actor + * @instance + */ + Actor.prototype.googleSupport = false; + + /** + * Actor username. + * @member {string} username + * @memberof google.cloud.support.v2beta.Actor + * @instance + */ + Actor.prototype.username = ""; + + /** + * Creates a new Actor instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.Actor + * @static + * @param {google.cloud.support.v2beta.IActor=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.Actor} Actor instance + */ + Actor.create = function create(properties) { + return new Actor(properties); + }; + + /** + * Encodes the specified Actor message. Does not implicitly {@link google.cloud.support.v2beta.Actor.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.Actor + * @static + * @param {google.cloud.support.v2beta.IActor} message Actor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Actor.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.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); + if (message.googleSupport != null && Object.hasOwnProperty.call(message, "googleSupport")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.googleSupport); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.username); + return writer; + }; + + /** + * Encodes the specified Actor message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Actor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.Actor + * @static + * @param {google.cloud.support.v2beta.IActor} message Actor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Actor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Actor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.Actor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.Actor} Actor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Actor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.Actor(); + 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.email = reader.string(); + break; + } + case 4: { + message.googleSupport = reader.bool(); + break; + } + case 5: { + message.username = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Actor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.Actor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.Actor} Actor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Actor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Actor message. + * @function verify + * @memberof google.cloud.support.v2beta.Actor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Actor.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.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.googleSupport != null && message.hasOwnProperty("googleSupport")) + if (typeof message.googleSupport !== "boolean") + return "googleSupport: boolean expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + return null; + }; + + /** + * Creates an Actor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.Actor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.Actor} Actor + */ + Actor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.Actor) + return object; + var message = new $root.google.cloud.support.v2beta.Actor(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.email != null) + message.email = String(object.email); + if (object.googleSupport != null) + message.googleSupport = Boolean(object.googleSupport); + if (object.username != null) + message.username = String(object.username); + return message; + }; + + /** + * Creates a plain object from an Actor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.Actor + * @static + * @param {google.cloud.support.v2beta.Actor} message Actor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Actor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.email = ""; + object.googleSupport = false; + object.username = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.googleSupport != null && message.hasOwnProperty("googleSupport")) + object.googleSupport = message.googleSupport; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + return object; + }; + + /** + * Converts this Actor to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.Actor + * @instance + * @returns {Object.} JSON object + */ + Actor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Actor + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.Actor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Actor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.Actor"; + }; + + return Actor; + })(); + + v2beta.Attachment = (function() { + + /** + * Properties of an Attachment. + * @memberof google.cloud.support.v2beta + * @interface IAttachment + * @property {string|null} [name] Attachment name + * @property {google.protobuf.ITimestamp|null} [createTime] Attachment createTime + * @property {google.cloud.support.v2beta.IActor|null} [creator] Attachment creator + * @property {string|null} [filename] Attachment filename + * @property {string|null} [mimeType] Attachment mimeType + * @property {number|Long|null} [sizeBytes] Attachment sizeBytes + */ + + /** + * Constructs a new Attachment. + * @memberof google.cloud.support.v2beta + * @classdesc Represents an Attachment. + * @implements IAttachment + * @constructor + * @param {google.cloud.support.v2beta.IAttachment=} [properties] Properties to set + */ + function Attachment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Attachment name. + * @member {string} name + * @memberof google.cloud.support.v2beta.Attachment + * @instance + */ + Attachment.prototype.name = ""; + + /** + * Attachment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.support.v2beta.Attachment + * @instance + */ + Attachment.prototype.createTime = null; + + /** + * Attachment creator. + * @member {google.cloud.support.v2beta.IActor|null|undefined} creator + * @memberof google.cloud.support.v2beta.Attachment + * @instance + */ + Attachment.prototype.creator = null; + + /** + * Attachment filename. + * @member {string} filename + * @memberof google.cloud.support.v2beta.Attachment + * @instance + */ + Attachment.prototype.filename = ""; + + /** + * Attachment mimeType. + * @member {string} mimeType + * @memberof google.cloud.support.v2beta.Attachment + * @instance + */ + Attachment.prototype.mimeType = ""; + + /** + * Attachment sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.cloud.support.v2beta.Attachment + * @instance + */ + Attachment.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Attachment instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.Attachment + * @static + * @param {google.cloud.support.v2beta.IAttachment=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.Attachment} Attachment instance + */ + Attachment.create = function create(properties) { + return new Attachment(properties); + }; + + /** + * Encodes the specified Attachment message. Does not implicitly {@link google.cloud.support.v2beta.Attachment.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.Attachment + * @static + * @param {google.cloud.support.v2beta.IAttachment} message Attachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attachment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + $root.google.cloud.support.v2beta.Actor.encode(message.creator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filename); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mimeType); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.sizeBytes); + return writer; + }; + + /** + * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Attachment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.Attachment + * @static + * @param {google.cloud.support.v2beta.IAttachment} message Attachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attachment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Attachment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.Attachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.Attachment} Attachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attachment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.Attachment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.creator = $root.google.cloud.support.v2beta.Actor.decode(reader, reader.uint32()); + break; + } + case 4: { + message.filename = reader.string(); + break; + } + case 5: { + message.mimeType = reader.string(); + break; + } + case 6: { + message.sizeBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Attachment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.Attachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.Attachment} Attachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attachment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Attachment message. + * @function verify + * @memberof google.cloud.support.v2beta.Attachment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Attachment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: 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.creator != null && message.hasOwnProperty("creator")) { + var error = $root.google.cloud.support.v2beta.Actor.verify(message.creator); + if (error) + return "creator." + error; + } + if (message.filename != null && message.hasOwnProperty("filename")) + if (!$util.isString(message.filename)) + return "filename: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + return null; + }; + + /** + * Creates an Attachment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.Attachment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.Attachment} Attachment + */ + Attachment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.Attachment) + return object; + var message = new $root.google.cloud.support.v2beta.Attachment(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.support.v2beta.Attachment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.creator != null) { + if (typeof object.creator !== "object") + throw TypeError(".google.cloud.support.v2beta.Attachment.creator: object expected"); + message.creator = $root.google.cloud.support.v2beta.Actor.fromObject(object.creator); + } + if (object.filename != null) + message.filename = String(object.filename); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Attachment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.Attachment + * @static + * @param {google.cloud.support.v2beta.Attachment} message Attachment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Attachment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.creator = null; + object.filename = ""; + object.mimeType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = $root.google.cloud.support.v2beta.Actor.toObject(message.creator, options); + if (message.filename != null && message.hasOwnProperty("filename")) + object.filename = message.filename; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + return object; + }; + + /** + * Converts this Attachment to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.Attachment + * @instance + * @returns {Object.} JSON object + */ + Attachment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Attachment + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.Attachment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Attachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.Attachment"; + }; + + return Attachment; + })(); + + v2beta.CaseAttachmentService = (function() { + + /** + * Constructs a new CaseAttachmentService service. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a CaseAttachmentService + * @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 CaseAttachmentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CaseAttachmentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CaseAttachmentService; + + /** + * Creates new CaseAttachmentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.support.v2beta.CaseAttachmentService + * @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 {CaseAttachmentService} RPC service. Useful where requests and/or responses are streamed. + */ + CaseAttachmentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseAttachmentService|listAttachments}. + * @memberof google.cloud.support.v2beta.CaseAttachmentService + * @typedef ListAttachmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.ListAttachmentsResponse} [response] ListAttachmentsResponse + */ + + /** + * Calls ListAttachments. + * @function listAttachments + * @memberof google.cloud.support.v2beta.CaseAttachmentService + * @instance + * @param {google.cloud.support.v2beta.IListAttachmentsRequest} request ListAttachmentsRequest message or plain object + * @param {google.cloud.support.v2beta.CaseAttachmentService.ListAttachmentsCallback} callback Node-style callback called with the error, if any, and ListAttachmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseAttachmentService.prototype.listAttachments = function listAttachments(request, callback) { + return this.rpcCall(listAttachments, $root.google.cloud.support.v2beta.ListAttachmentsRequest, $root.google.cloud.support.v2beta.ListAttachmentsResponse, request, callback); + }, "name", { value: "ListAttachments" }); + + /** + * Calls ListAttachments. + * @function listAttachments + * @memberof google.cloud.support.v2beta.CaseAttachmentService + * @instance + * @param {google.cloud.support.v2beta.IListAttachmentsRequest} request ListAttachmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseAttachmentService|getAttachment}. + * @memberof google.cloud.support.v2beta.CaseAttachmentService + * @typedef GetAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.Attachment} [response] Attachment + */ + + /** + * Calls GetAttachment. + * @function getAttachment + * @memberof google.cloud.support.v2beta.CaseAttachmentService + * @instance + * @param {google.cloud.support.v2beta.IGetAttachmentRequest} request GetAttachmentRequest message or plain object + * @param {google.cloud.support.v2beta.CaseAttachmentService.GetAttachmentCallback} callback Node-style callback called with the error, if any, and Attachment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseAttachmentService.prototype.getAttachment = function getAttachment(request, callback) { + return this.rpcCall(getAttachment, $root.google.cloud.support.v2beta.GetAttachmentRequest, $root.google.cloud.support.v2beta.Attachment, request, callback); + }, "name", { value: "GetAttachment" }); + + /** + * Calls GetAttachment. + * @function getAttachment + * @memberof google.cloud.support.v2beta.CaseAttachmentService + * @instance + * @param {google.cloud.support.v2beta.IGetAttachmentRequest} request GetAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CaseAttachmentService; + })(); + + v2beta.ListAttachmentsRequest = (function() { + + /** + * Properties of a ListAttachmentsRequest. + * @memberof google.cloud.support.v2beta + * @interface IListAttachmentsRequest + * @property {string|null} [parent] ListAttachmentsRequest parent + * @property {number|null} [pageSize] ListAttachmentsRequest pageSize + * @property {string|null} [pageToken] ListAttachmentsRequest pageToken + */ + + /** + * Constructs a new ListAttachmentsRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a ListAttachmentsRequest. + * @implements IListAttachmentsRequest + * @constructor + * @param {google.cloud.support.v2beta.IListAttachmentsRequest=} [properties] Properties to set + */ + function ListAttachmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAttachmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @instance + */ + ListAttachmentsRequest.prototype.parent = ""; + + /** + * ListAttachmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @instance + */ + ListAttachmentsRequest.prototype.pageSize = 0; + + /** + * ListAttachmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @instance + */ + ListAttachmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAttachmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @static + * @param {google.cloud.support.v2beta.IListAttachmentsRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.ListAttachmentsRequest} ListAttachmentsRequest instance + */ + ListAttachmentsRequest.create = function create(properties) { + return new ListAttachmentsRequest(properties); + }; + + /** + * Encodes the specified ListAttachmentsRequest message. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @static + * @param {google.cloud.support.v2beta.IListAttachmentsRequest} message ListAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttachmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @static + * @param {google.cloud.support.v2beta.IListAttachmentsRequest} message ListAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttachmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttachmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.ListAttachmentsRequest} ListAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttachmentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ListAttachmentsRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttachmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.ListAttachmentsRequest} ListAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttachmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttachmentsRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttachmentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.ListAttachmentsRequest} ListAttachmentsRequest + */ + ListAttachmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.ListAttachmentsRequest) + return object; + var message = new $root.google.cloud.support.v2beta.ListAttachmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAttachmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @static + * @param {google.cloud.support.v2beta.ListAttachmentsRequest} message ListAttachmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttachmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListAttachmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAttachmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttachmentsRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.ListAttachmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttachmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.ListAttachmentsRequest"; + }; + + return ListAttachmentsRequest; + })(); + + v2beta.GetAttachmentRequest = (function() { + + /** + * Properties of a GetAttachmentRequest. + * @memberof google.cloud.support.v2beta + * @interface IGetAttachmentRequest + * @property {string|null} [name] GetAttachmentRequest name + */ + + /** + * Constructs a new GetAttachmentRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a GetAttachmentRequest. + * @implements IGetAttachmentRequest + * @constructor + * @param {google.cloud.support.v2beta.IGetAttachmentRequest=} [properties] Properties to set + */ + function GetAttachmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAttachmentRequest name. + * @member {string} name + * @memberof google.cloud.support.v2beta.GetAttachmentRequest + * @instance + */ + GetAttachmentRequest.prototype.name = ""; + + /** + * Creates a new GetAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.GetAttachmentRequest + * @static + * @param {google.cloud.support.v2beta.IGetAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.GetAttachmentRequest} GetAttachmentRequest instance + */ + GetAttachmentRequest.create = function create(properties) { + return new GetAttachmentRequest(properties); + }; + + /** + * Encodes the specified GetAttachmentRequest message. Does not implicitly {@link google.cloud.support.v2beta.GetAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.GetAttachmentRequest + * @static + * @param {google.cloud.support.v2beta.IGetAttachmentRequest} message GetAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAttachmentRequest.encode = function encode(message, writer) { + 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 GetAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.GetAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.GetAttachmentRequest + * @static + * @param {google.cloud.support.v2beta.IGetAttachmentRequest} message GetAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.GetAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.GetAttachmentRequest} GetAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAttachmentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.GetAttachmentRequest(); + 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 GetAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.GetAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.GetAttachmentRequest} GetAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAttachmentRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.GetAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAttachmentRequest.verify = function verify(message) { + if (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 GetAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.GetAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.GetAttachmentRequest} GetAttachmentRequest + */ + GetAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.GetAttachmentRequest) + return object; + var message = new $root.google.cloud.support.v2beta.GetAttachmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.GetAttachmentRequest + * @static + * @param {google.cloud.support.v2beta.GetAttachmentRequest} message GetAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAttachmentRequest.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 GetAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.GetAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAttachmentRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.GetAttachmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.GetAttachmentRequest"; + }; + + return GetAttachmentRequest; + })(); + + v2beta.ListAttachmentsResponse = (function() { + + /** + * Properties of a ListAttachmentsResponse. + * @memberof google.cloud.support.v2beta + * @interface IListAttachmentsResponse + * @property {Array.|null} [attachments] ListAttachmentsResponse attachments + * @property {string|null} [nextPageToken] ListAttachmentsResponse nextPageToken + */ + + /** + * Constructs a new ListAttachmentsResponse. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a ListAttachmentsResponse. + * @implements IListAttachmentsResponse + * @constructor + * @param {google.cloud.support.v2beta.IListAttachmentsResponse=} [properties] Properties to set + */ + function ListAttachmentsResponse(properties) { + this.attachments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAttachmentsResponse attachments. + * @member {Array.} attachments + * @memberof google.cloud.support.v2beta.ListAttachmentsResponse + * @instance + */ + ListAttachmentsResponse.prototype.attachments = $util.emptyArray; + + /** + * ListAttachmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2beta.ListAttachmentsResponse + * @instance + */ + ListAttachmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAttachmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.ListAttachmentsResponse + * @static + * @param {google.cloud.support.v2beta.IListAttachmentsResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.ListAttachmentsResponse} ListAttachmentsResponse instance + */ + ListAttachmentsResponse.create = function create(properties) { + return new ListAttachmentsResponse(properties); + }; + + /** + * Encodes the specified ListAttachmentsResponse message. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.ListAttachmentsResponse + * @static + * @param {google.cloud.support.v2beta.IListAttachmentsResponse} message ListAttachmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttachmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachments != null && message.attachments.length) + for (var i = 0; i < message.attachments.length; ++i) + $root.google.cloud.support.v2beta.Attachment.encode(message.attachments[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 ListAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.ListAttachmentsResponse + * @static + * @param {google.cloud.support.v2beta.IListAttachmentsResponse} message ListAttachmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttachmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttachmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.ListAttachmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.ListAttachmentsResponse} ListAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttachmentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ListAttachmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.attachments && message.attachments.length)) + message.attachments = []; + message.attachments.push($root.google.cloud.support.v2beta.Attachment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttachmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.ListAttachmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.ListAttachmentsResponse} ListAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttachmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttachmentsResponse message. + * @function verify + * @memberof google.cloud.support.v2beta.ListAttachmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttachmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachments != null && message.hasOwnProperty("attachments")) { + if (!Array.isArray(message.attachments)) + return "attachments: array expected"; + for (var i = 0; i < message.attachments.length; ++i) { + var error = $root.google.cloud.support.v2beta.Attachment.verify(message.attachments[i]); + if (error) + return "attachments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAttachmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.ListAttachmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.ListAttachmentsResponse} ListAttachmentsResponse + */ + ListAttachmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.ListAttachmentsResponse) + return object; + var message = new $root.google.cloud.support.v2beta.ListAttachmentsResponse(); + if (object.attachments) { + if (!Array.isArray(object.attachments)) + throw TypeError(".google.cloud.support.v2beta.ListAttachmentsResponse.attachments: array expected"); + message.attachments = []; + for (var i = 0; i < object.attachments.length; ++i) { + if (typeof object.attachments[i] !== "object") + throw TypeError(".google.cloud.support.v2beta.ListAttachmentsResponse.attachments: object expected"); + message.attachments[i] = $root.google.cloud.support.v2beta.Attachment.fromObject(object.attachments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAttachmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.ListAttachmentsResponse + * @static + * @param {google.cloud.support.v2beta.ListAttachmentsResponse} message ListAttachmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttachmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attachments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.attachments && message.attachments.length) { + object.attachments = []; + for (var j = 0; j < message.attachments.length; ++j) + object.attachments[j] = $root.google.cloud.support.v2beta.Attachment.toObject(message.attachments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAttachmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.ListAttachmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAttachmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttachmentsResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.ListAttachmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttachmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.ListAttachmentsResponse"; + }; + + return ListAttachmentsResponse; + })(); + + /** + * ProductLine enum. + * @name google.cloud.support.v2beta.ProductLine + * @enum {number} + * @property {number} PRODUCT_LINE_UNSPECIFIED=0 PRODUCT_LINE_UNSPECIFIED value + * @property {number} GOOGLE_CLOUD=1 GOOGLE_CLOUD value + * @property {number} GOOGLE_MAPS=2 GOOGLE_MAPS value + */ + v2beta.ProductLine = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRODUCT_LINE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_CLOUD"] = 1; + values[valuesById[2] = "GOOGLE_MAPS"] = 2; + return values; + })(); + + v2beta.Case = (function() { + + /** + * Properties of a Case. + * @memberof google.cloud.support.v2beta + * @interface ICase + * @property {string|null} [name] Case name + * @property {string|null} [displayName] Case displayName + * @property {string|null} [description] Case description + * @property {google.cloud.support.v2beta.ICaseClassification|null} [classification] Case classification + * @property {string|null} [timeZone] Case timeZone + * @property {Array.|null} [subscriberEmailAddresses] Case subscriberEmailAddresses + * @property {google.cloud.support.v2beta.Case.State|null} [state] Case state + * @property {google.protobuf.ITimestamp|null} [createTime] Case createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Case updateTime + * @property {google.cloud.support.v2beta.IActor|null} [creator] Case creator + * @property {string|null} [contactEmail] Case contactEmail + * @property {boolean|null} [escalated] Case escalated + * @property {boolean|null} [testCase] Case testCase + * @property {string|null} [languageCode] Case languageCode + * @property {google.cloud.support.v2beta.Case.Priority|null} [priority] Case priority + */ + + /** + * Constructs a new Case. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a Case. + * @implements ICase + * @constructor + * @param {google.cloud.support.v2beta.ICase=} [properties] Properties to set + */ + function Case(properties) { + this.subscriberEmailAddresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Case name. + * @member {string} name + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.name = ""; + + /** + * Case displayName. + * @member {string} displayName + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.displayName = ""; + + /** + * Case description. + * @member {string} description + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.description = ""; + + /** + * Case classification. + * @member {google.cloud.support.v2beta.ICaseClassification|null|undefined} classification + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.classification = null; + + /** + * Case timeZone. + * @member {string} timeZone + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.timeZone = ""; + + /** + * Case subscriberEmailAddresses. + * @member {Array.} subscriberEmailAddresses + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.subscriberEmailAddresses = $util.emptyArray; + + /** + * Case state. + * @member {google.cloud.support.v2beta.Case.State} state + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.state = 0; + + /** + * Case createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.createTime = null; + + /** + * Case updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.updateTime = null; + + /** + * Case creator. + * @member {google.cloud.support.v2beta.IActor|null|undefined} creator + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.creator = null; + + /** + * Case contactEmail. + * @member {string} contactEmail + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.contactEmail = ""; + + /** + * Case escalated. + * @member {boolean} escalated + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.escalated = false; + + /** + * Case testCase. + * @member {boolean} testCase + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.testCase = false; + + /** + * Case languageCode. + * @member {string} languageCode + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.languageCode = ""; + + /** + * Case priority. + * @member {google.cloud.support.v2beta.Case.Priority} priority + * @memberof google.cloud.support.v2beta.Case + * @instance + */ + Case.prototype.priority = 0; + + /** + * Creates a new Case instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.Case + * @static + * @param {google.cloud.support.v2beta.ICase=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.Case} Case instance + */ + Case.create = function create(properties) { + return new Case(properties); + }; + + /** + * Encodes the specified Case message. Does not implicitly {@link google.cloud.support.v2beta.Case.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.Case + * @static + * @param {google.cloud.support.v2beta.ICase} message Case message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Case.encode = function encode(message, writer) { + if (!writer) + 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.classification != null && Object.hasOwnProperty.call(message, "classification")) + $root.google.cloud.support.v2beta.CaseClassification.encode(message.classification, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.timeZone); + if (message.subscriberEmailAddresses != null && message.subscriberEmailAddresses.length) + for (var i = 0; i < message.subscriberEmailAddresses.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.subscriberEmailAddresses[i]); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + $root.google.cloud.support.v2beta.Actor.encode(message.creator, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.escalated != null && Object.hasOwnProperty.call(message, "escalated")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.escalated); + if (message.testCase != null && Object.hasOwnProperty.call(message, "testCase")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.testCase); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.languageCode); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 32, wireType 0 =*/256).int32(message.priority); + if (message.contactEmail != null && Object.hasOwnProperty.call(message, "contactEmail")) + writer.uint32(/* id 35, wireType 2 =*/282).string(message.contactEmail); + return writer; + }; + + /** + * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Case.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.Case + * @static + * @param {google.cloud.support.v2beta.ICase} message Case message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Case.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Case message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.Case + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.Case} Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Case.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.Case(); + while (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.classification = $root.google.cloud.support.v2beta.CaseClassification.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeZone = reader.string(); + break; + } + case 9: { + if (!(message.subscriberEmailAddresses && message.subscriberEmailAddresses.length)) + message.subscriberEmailAddresses = []; + message.subscriberEmailAddresses.push(reader.string()); + break; + } + case 12: { + message.state = reader.int32(); + break; + } + case 13: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.creator = $root.google.cloud.support.v2beta.Actor.decode(reader, reader.uint32()); + break; + } + case 35: { + message.contactEmail = reader.string(); + break; + } + case 17: { + message.escalated = reader.bool(); + break; + } + case 19: { + message.testCase = reader.bool(); + break; + } + case 23: { + message.languageCode = reader.string(); + break; + } + case 32: { + message.priority = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Case message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.Case + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.Case} Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Case.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Case message. + * @function verify + * @memberof google.cloud.support.v2beta.Case + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Case.verify = function verify(message) { + if (typeof message !== "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.classification != null && message.hasOwnProperty("classification")) { + var error = $root.google.cloud.support.v2beta.CaseClassification.verify(message.classification); + if (error) + return "classification." + error; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.subscriberEmailAddresses != null && message.hasOwnProperty("subscriberEmailAddresses")) { + if (!Array.isArray(message.subscriberEmailAddresses)) + return "subscriberEmailAddresses: array expected"; + for (var i = 0; i < message.subscriberEmailAddresses.length; ++i) + if (!$util.isString(message.subscriberEmailAddresses[i])) + return "subscriberEmailAddresses: string[] expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + 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.creator != null && message.hasOwnProperty("creator")) { + var error = $root.google.cloud.support.v2beta.Actor.verify(message.creator); + if (error) + return "creator." + error; + } + if (message.contactEmail != null && message.hasOwnProperty("contactEmail")) + if (!$util.isString(message.contactEmail)) + return "contactEmail: string expected"; + if (message.escalated != null && message.hasOwnProperty("escalated")) + if (typeof message.escalated !== "boolean") + return "escalated: boolean expected"; + if (message.testCase != null && message.hasOwnProperty("testCase")) + if (typeof message.testCase !== "boolean") + return "testCase: boolean expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + switch (message.priority) { + default: + return "priority: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a Case message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.Case + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.Case} Case + */ + Case.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.Case) + return object; + var message = new $root.google.cloud.support.v2beta.Case(); + 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.classification != null) { + if (typeof object.classification !== "object") + throw TypeError(".google.cloud.support.v2beta.Case.classification: object expected"); + message.classification = $root.google.cloud.support.v2beta.CaseClassification.fromObject(object.classification); + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.subscriberEmailAddresses) { + if (!Array.isArray(object.subscriberEmailAddresses)) + throw TypeError(".google.cloud.support.v2beta.Case.subscriberEmailAddresses: array expected"); + message.subscriberEmailAddresses = []; + for (var i = 0; i < object.subscriberEmailAddresses.length; ++i) + message.subscriberEmailAddresses[i] = String(object.subscriberEmailAddresses[i]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "NEW": + case 1: + message.state = 1; + break; + case "IN_PROGRESS_GOOGLE_SUPPORT": + case 2: + message.state = 2; + break; + case "ACTION_REQUIRED": + case 3: + message.state = 3; + break; + case "SOLUTION_PROVIDED": + case 4: + message.state = 4; + break; + case "CLOSED": + case 5: + message.state = 5; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.support.v2beta.Case.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.support.v2beta.Case.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.creator != null) { + if (typeof object.creator !== "object") + throw TypeError(".google.cloud.support.v2beta.Case.creator: object expected"); + message.creator = $root.google.cloud.support.v2beta.Actor.fromObject(object.creator); + } + if (object.contactEmail != null) + message.contactEmail = String(object.contactEmail); + if (object.escalated != null) + message.escalated = Boolean(object.escalated); + if (object.testCase != null) + message.testCase = Boolean(object.testCase); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; + case "PRIORITY_UNSPECIFIED": + case 0: + message.priority = 0; + break; + case "P0": + case 1: + message.priority = 1; + break; + case "P1": + case 2: + message.priority = 2; + break; + case "P2": + case 3: + message.priority = 3; + break; + case "P3": + case 4: + message.priority = 4; + break; + case "P4": + case 5: + message.priority = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a Case message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.Case + * @static + * @param {google.cloud.support.v2beta.Case} message Case + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Case.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subscriberEmailAddresses = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.classification = null; + object.timeZone = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.creator = null; + object.escalated = false; + object.testCase = false; + object.languageCode = ""; + object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; + object.contactEmail = ""; + } + 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.classification != null && message.hasOwnProperty("classification")) + object.classification = $root.google.cloud.support.v2beta.CaseClassification.toObject(message.classification, options); + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.subscriberEmailAddresses && message.subscriberEmailAddresses.length) { + object.subscriberEmailAddresses = []; + for (var j = 0; j < message.subscriberEmailAddresses.length; ++j) + object.subscriberEmailAddresses[j] = message.subscriberEmailAddresses[j]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.support.v2beta.Case.State[message.state] === undefined ? message.state : $root.google.cloud.support.v2beta.Case.State[message.state] : message.state; + 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.creator != null && message.hasOwnProperty("creator")) + object.creator = $root.google.cloud.support.v2beta.Actor.toObject(message.creator, options); + if (message.escalated != null && message.hasOwnProperty("escalated")) + object.escalated = message.escalated; + if (message.testCase != null && message.hasOwnProperty("testCase")) + object.testCase = message.testCase; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = options.enums === String ? $root.google.cloud.support.v2beta.Case.Priority[message.priority] === undefined ? message.priority : $root.google.cloud.support.v2beta.Case.Priority[message.priority] : message.priority; + if (message.contactEmail != null && message.hasOwnProperty("contactEmail")) + object.contactEmail = message.contactEmail; + return object; + }; + + /** + * Converts this Case to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.Case + * @instance + * @returns {Object.} JSON object + */ + Case.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Case + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.Case + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Case.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.Case"; + }; + + /** + * State enum. + * @name google.cloud.support.v2beta.Case.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} NEW=1 NEW value + * @property {number} IN_PROGRESS_GOOGLE_SUPPORT=2 IN_PROGRESS_GOOGLE_SUPPORT value + * @property {number} ACTION_REQUIRED=3 ACTION_REQUIRED value + * @property {number} SOLUTION_PROVIDED=4 SOLUTION_PROVIDED value + * @property {number} CLOSED=5 CLOSED value + */ + Case.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEW"] = 1; + values[valuesById[2] = "IN_PROGRESS_GOOGLE_SUPPORT"] = 2; + values[valuesById[3] = "ACTION_REQUIRED"] = 3; + values[valuesById[4] = "SOLUTION_PROVIDED"] = 4; + values[valuesById[5] = "CLOSED"] = 5; + return values; + })(); + + /** + * Priority enum. + * @name google.cloud.support.v2beta.Case.Priority + * @enum {number} + * @property {number} PRIORITY_UNSPECIFIED=0 PRIORITY_UNSPECIFIED value + * @property {number} P0=1 P0 value + * @property {number} P1=2 P1 value + * @property {number} P2=3 P2 value + * @property {number} P3=4 P3 value + * @property {number} P4=5 P4 value + */ + Case.Priority = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIORITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "P0"] = 1; + values[valuesById[2] = "P1"] = 2; + values[valuesById[3] = "P2"] = 3; + values[valuesById[4] = "P3"] = 4; + values[valuesById[5] = "P4"] = 5; + return values; + })(); + + return Case; + })(); + + v2beta.CaseClassification = (function() { + + /** + * Properties of a CaseClassification. + * @memberof google.cloud.support.v2beta + * @interface ICaseClassification + * @property {string|null} [id] CaseClassification id + * @property {string|null} [displayName] CaseClassification displayName + * @property {google.cloud.support.v2beta.IProduct|null} [product] CaseClassification product + */ + + /** + * Constructs a new CaseClassification. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a CaseClassification. + * @implements ICaseClassification + * @constructor + * @param {google.cloud.support.v2beta.ICaseClassification=} [properties] Properties to set + */ + function CaseClassification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CaseClassification id. + * @member {string} id + * @memberof google.cloud.support.v2beta.CaseClassification + * @instance + */ + CaseClassification.prototype.id = ""; + + /** + * CaseClassification displayName. + * @member {string} displayName + * @memberof google.cloud.support.v2beta.CaseClassification + * @instance + */ + CaseClassification.prototype.displayName = ""; + + /** + * CaseClassification product. + * @member {google.cloud.support.v2beta.IProduct|null|undefined} product + * @memberof google.cloud.support.v2beta.CaseClassification + * @instance + */ + CaseClassification.prototype.product = null; + + /** + * Creates a new CaseClassification instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.CaseClassification + * @static + * @param {google.cloud.support.v2beta.ICaseClassification=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.CaseClassification} CaseClassification instance + */ + CaseClassification.create = function create(properties) { + return new CaseClassification(properties); + }; + + /** + * Encodes the specified CaseClassification message. Does not implicitly {@link google.cloud.support.v2beta.CaseClassification.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.CaseClassification + * @static + * @param {google.cloud.support.v2beta.ICaseClassification} message CaseClassification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseClassification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.support.v2beta.Product.encode(message.product, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CaseClassification message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CaseClassification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.CaseClassification + * @static + * @param {google.cloud.support.v2beta.ICaseClassification} message CaseClassification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseClassification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaseClassification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.CaseClassification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.CaseClassification} CaseClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseClassification.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.CaseClassification(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.id = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 10: { + message.product = $root.google.cloud.support.v2beta.Product.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CaseClassification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.CaseClassification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.CaseClassification} CaseClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseClassification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaseClassification message. + * @function verify + * @memberof google.cloud.support.v2beta.CaseClassification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaseClassification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.support.v2beta.Product.verify(message.product); + if (error) + return "product." + error; + } + return null; + }; + + /** + * Creates a CaseClassification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.CaseClassification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.CaseClassification} CaseClassification + */ + CaseClassification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.CaseClassification) + return object; + var message = new $root.google.cloud.support.v2beta.CaseClassification(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.support.v2beta.CaseClassification.product: object expected"); + message.product = $root.google.cloud.support.v2beta.Product.fromObject(object.product); + } + return message; + }; + + /** + * Creates a plain object from a CaseClassification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.CaseClassification + * @static + * @param {google.cloud.support.v2beta.CaseClassification} message CaseClassification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaseClassification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + object.product = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.support.v2beta.Product.toObject(message.product, options); + return object; + }; + + /** + * Converts this CaseClassification to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.CaseClassification + * @instance + * @returns {Object.} JSON object + */ + CaseClassification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaseClassification + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.CaseClassification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaseClassification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.CaseClassification"; + }; + + return CaseClassification; + })(); + + v2beta.Product = (function() { + + /** + * Properties of a Product. + * @memberof google.cloud.support.v2beta + * @interface IProduct + * @property {google.cloud.support.v2beta.ProductLine|null} [productLine] Product productLine + */ + + /** + * Constructs a new Product. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a Product. + * @implements IProduct + * @constructor + * @param {google.cloud.support.v2beta.IProduct=} [properties] Properties to set + */ + function Product(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Product productLine. + * @member {google.cloud.support.v2beta.ProductLine} productLine + * @memberof google.cloud.support.v2beta.Product + * @instance + */ + Product.prototype.productLine = 0; + + /** + * Creates a new Product instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.Product + * @static + * @param {google.cloud.support.v2beta.IProduct=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.Product} Product instance + */ + Product.create = function create(properties) { + return new Product(properties); + }; + + /** + * Encodes the specified Product message. Does not implicitly {@link google.cloud.support.v2beta.Product.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.Product + * @static + * @param {google.cloud.support.v2beta.IProduct} message Product message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Product.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productLine != null && Object.hasOwnProperty.call(message, "productLine")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.productLine); + return writer; + }; + + /** + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Product.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.Product + * @static + * @param {google.cloud.support.v2beta.IProduct} message Product message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Product.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Product message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.Product + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.Product} Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Product.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.Product(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.productLine = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Product message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.Product + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.Product} Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Product.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Product message. + * @function verify + * @memberof google.cloud.support.v2beta.Product + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Product.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.productLine != null && message.hasOwnProperty("productLine")) + switch (message.productLine) { + default: + return "productLine: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Product message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.Product + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.Product} Product + */ + Product.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.Product) + return object; + var message = new $root.google.cloud.support.v2beta.Product(); + switch (object.productLine) { + default: + if (typeof object.productLine === "number") { + message.productLine = object.productLine; + break; + } + break; + case "PRODUCT_LINE_UNSPECIFIED": + case 0: + message.productLine = 0; + break; + case "GOOGLE_CLOUD": + case 1: + message.productLine = 1; + break; + case "GOOGLE_MAPS": + case 2: + message.productLine = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.Product + * @static + * @param {google.cloud.support.v2beta.Product} message Product + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Product.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.productLine = options.enums === String ? "PRODUCT_LINE_UNSPECIFIED" : 0; + if (message.productLine != null && message.hasOwnProperty("productLine")) + object.productLine = options.enums === String ? $root.google.cloud.support.v2beta.ProductLine[message.productLine] === undefined ? message.productLine : $root.google.cloud.support.v2beta.ProductLine[message.productLine] : message.productLine; + return object; + }; + + /** + * Converts this Product to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.Product + * @instance + * @returns {Object.} JSON object + */ + Product.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Product + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.Product + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Product.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.Product"; + }; + + return Product; + })(); + + v2beta.CaseService = (function() { + + /** + * Constructs a new CaseService service. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a CaseService + * @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 CaseService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CaseService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CaseService; + + /** + * Creates new CaseService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.support.v2beta.CaseService + * @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 {CaseService} RPC service. Useful where requests and/or responses are streamed. + */ + CaseService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|getCase}. + * @memberof google.cloud.support.v2beta.CaseService + * @typedef GetCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.Case} [response] Case + */ + + /** + * Calls GetCase. + * @function getCase + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.IGetCaseRequest} request GetCaseRequest message or plain object + * @param {google.cloud.support.v2beta.CaseService.GetCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.getCase = function getCase(request, callback) { + return this.rpcCall(getCase, $root.google.cloud.support.v2beta.GetCaseRequest, $root.google.cloud.support.v2beta.Case, request, callback); + }, "name", { value: "GetCase" }); + + /** + * Calls GetCase. + * @function getCase + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.IGetCaseRequest} request GetCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|listCases}. + * @memberof google.cloud.support.v2beta.CaseService + * @typedef ListCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.ListCasesResponse} [response] ListCasesResponse + */ + + /** + * Calls ListCases. + * @function listCases + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.IListCasesRequest} request ListCasesRequest message or plain object + * @param {google.cloud.support.v2beta.CaseService.ListCasesCallback} callback Node-style callback called with the error, if any, and ListCasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.listCases = function listCases(request, callback) { + return this.rpcCall(listCases, $root.google.cloud.support.v2beta.ListCasesRequest, $root.google.cloud.support.v2beta.ListCasesResponse, request, callback); + }, "name", { value: "ListCases" }); + + /** + * Calls ListCases. + * @function listCases + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.IListCasesRequest} request ListCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|searchCases}. + * @memberof google.cloud.support.v2beta.CaseService + * @typedef SearchCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.SearchCasesResponse} [response] SearchCasesResponse + */ + + /** + * Calls SearchCases. + * @function searchCases + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.ISearchCasesRequest} request SearchCasesRequest message or plain object + * @param {google.cloud.support.v2beta.CaseService.SearchCasesCallback} callback Node-style callback called with the error, if any, and SearchCasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.searchCases = function searchCases(request, callback) { + return this.rpcCall(searchCases, $root.google.cloud.support.v2beta.SearchCasesRequest, $root.google.cloud.support.v2beta.SearchCasesResponse, request, callback); + }, "name", { value: "SearchCases" }); + + /** + * Calls SearchCases. + * @function searchCases + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.ISearchCasesRequest} request SearchCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|createCase}. + * @memberof google.cloud.support.v2beta.CaseService + * @typedef CreateCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.Case} [response] Case + */ + + /** + * Calls CreateCase. + * @function createCase + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.ICreateCaseRequest} request CreateCaseRequest message or plain object + * @param {google.cloud.support.v2beta.CaseService.CreateCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.createCase = function createCase(request, callback) { + return this.rpcCall(createCase, $root.google.cloud.support.v2beta.CreateCaseRequest, $root.google.cloud.support.v2beta.Case, request, callback); + }, "name", { value: "CreateCase" }); + + /** + * Calls CreateCase. + * @function createCase + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.ICreateCaseRequest} request CreateCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|updateCase}. + * @memberof google.cloud.support.v2beta.CaseService + * @typedef UpdateCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.Case} [response] Case + */ + + /** + * Calls UpdateCase. + * @function updateCase + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.IUpdateCaseRequest} request UpdateCaseRequest message or plain object + * @param {google.cloud.support.v2beta.CaseService.UpdateCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.updateCase = function updateCase(request, callback) { + return this.rpcCall(updateCase, $root.google.cloud.support.v2beta.UpdateCaseRequest, $root.google.cloud.support.v2beta.Case, request, callback); + }, "name", { value: "UpdateCase" }); + + /** + * Calls UpdateCase. + * @function updateCase + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.IUpdateCaseRequest} request UpdateCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|escalateCase}. + * @memberof google.cloud.support.v2beta.CaseService + * @typedef EscalateCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.Case} [response] Case + */ + + /** + * Calls EscalateCase. + * @function escalateCase + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.IEscalateCaseRequest} request EscalateCaseRequest message or plain object + * @param {google.cloud.support.v2beta.CaseService.EscalateCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.escalateCase = function escalateCase(request, callback) { + return this.rpcCall(escalateCase, $root.google.cloud.support.v2beta.EscalateCaseRequest, $root.google.cloud.support.v2beta.Case, request, callback); + }, "name", { value: "EscalateCase" }); + + /** + * Calls EscalateCase. + * @function escalateCase + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.IEscalateCaseRequest} request EscalateCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|closeCase}. + * @memberof google.cloud.support.v2beta.CaseService + * @typedef CloseCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.Case} [response] Case + */ + + /** + * Calls CloseCase. + * @function closeCase + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.ICloseCaseRequest} request CloseCaseRequest message or plain object + * @param {google.cloud.support.v2beta.CaseService.CloseCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.closeCase = function closeCase(request, callback) { + return this.rpcCall(closeCase, $root.google.cloud.support.v2beta.CloseCaseRequest, $root.google.cloud.support.v2beta.Case, request, callback); + }, "name", { value: "CloseCase" }); + + /** + * Calls CloseCase. + * @function closeCase + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.ICloseCaseRequest} request CloseCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2beta.CaseService|searchCaseClassifications}. + * @memberof google.cloud.support.v2beta.CaseService + * @typedef SearchCaseClassificationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.SearchCaseClassificationsResponse} [response] SearchCaseClassificationsResponse + */ + + /** + * Calls SearchCaseClassifications. + * @function searchCaseClassifications + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.ISearchCaseClassificationsRequest} request SearchCaseClassificationsRequest message or plain object + * @param {google.cloud.support.v2beta.CaseService.SearchCaseClassificationsCallback} callback Node-style callback called with the error, if any, and SearchCaseClassificationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.searchCaseClassifications = function searchCaseClassifications(request, callback) { + return this.rpcCall(searchCaseClassifications, $root.google.cloud.support.v2beta.SearchCaseClassificationsRequest, $root.google.cloud.support.v2beta.SearchCaseClassificationsResponse, request, callback); + }, "name", { value: "SearchCaseClassifications" }); + + /** + * Calls SearchCaseClassifications. + * @function searchCaseClassifications + * @memberof google.cloud.support.v2beta.CaseService + * @instance + * @param {google.cloud.support.v2beta.ISearchCaseClassificationsRequest} request SearchCaseClassificationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CaseService; + })(); + + v2beta.GetCaseRequest = (function() { + + /** + * Properties of a GetCaseRequest. + * @memberof google.cloud.support.v2beta + * @interface IGetCaseRequest + * @property {string|null} [name] GetCaseRequest name + */ + + /** + * Constructs a new GetCaseRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a GetCaseRequest. + * @implements IGetCaseRequest + * @constructor + * @param {google.cloud.support.v2beta.IGetCaseRequest=} [properties] Properties to set + */ + function GetCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCaseRequest name. + * @member {string} name + * @memberof google.cloud.support.v2beta.GetCaseRequest + * @instance + */ + GetCaseRequest.prototype.name = ""; + + /** + * Creates a new GetCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.GetCaseRequest + * @static + * @param {google.cloud.support.v2beta.IGetCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.GetCaseRequest} GetCaseRequest instance + */ + GetCaseRequest.create = function create(properties) { + return new GetCaseRequest(properties); + }; + + /** + * Encodes the specified GetCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.GetCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.GetCaseRequest + * @static + * @param {google.cloud.support.v2beta.IGetCaseRequest} message GetCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCaseRequest.encode = function encode(message, writer) { + 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 GetCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.GetCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.GetCaseRequest + * @static + * @param {google.cloud.support.v2beta.IGetCaseRequest} message GetCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.GetCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.GetCaseRequest} GetCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.GetCaseRequest(); + 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 GetCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.GetCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.GetCaseRequest} GetCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.GetCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCaseRequest.verify = function verify(message) { + if (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 GetCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.GetCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.GetCaseRequest} GetCaseRequest + */ + GetCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.GetCaseRequest) + return object; + var message = new $root.google.cloud.support.v2beta.GetCaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.GetCaseRequest + * @static + * @param {google.cloud.support.v2beta.GetCaseRequest} message GetCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCaseRequest.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 GetCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.GetCaseRequest + * @instance + * @returns {Object.} JSON object + */ + GetCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.GetCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.GetCaseRequest"; + }; + + return GetCaseRequest; + })(); + + v2beta.CreateCaseRequest = (function() { + + /** + * Properties of a CreateCaseRequest. + * @memberof google.cloud.support.v2beta + * @interface ICreateCaseRequest + * @property {string|null} [parent] CreateCaseRequest parent + * @property {google.cloud.support.v2beta.ICase|null} ["case"] CreateCaseRequest case + */ + + /** + * Constructs a new CreateCaseRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a CreateCaseRequest. + * @implements ICreateCaseRequest + * @constructor + * @param {google.cloud.support.v2beta.ICreateCaseRequest=} [properties] Properties to set + */ + function CreateCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCaseRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2beta.CreateCaseRequest + * @instance + */ + CreateCaseRequest.prototype.parent = ""; + + /** + * CreateCaseRequest case. + * @member {google.cloud.support.v2beta.ICase|null|undefined} case + * @memberof google.cloud.support.v2beta.CreateCaseRequest + * @instance + */ + CreateCaseRequest.prototype["case"] = null; + + /** + * Creates a new CreateCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.CreateCaseRequest + * @static + * @param {google.cloud.support.v2beta.ICreateCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.CreateCaseRequest} CreateCaseRequest instance + */ + CreateCaseRequest.create = function create(properties) { + return new CreateCaseRequest(properties); + }; + + /** + * Encodes the specified CreateCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.CreateCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.CreateCaseRequest + * @static + * @param {google.cloud.support.v2beta.ICreateCaseRequest} message CreateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) + $root.google.cloud.support.v2beta.Case.encode(message["case"], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CreateCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.CreateCaseRequest + * @static + * @param {google.cloud.support.v2beta.ICreateCaseRequest} message CreateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.CreateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.CreateCaseRequest} CreateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.CreateCaseRequest(); + 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["case"] = $root.google.cloud.support.v2beta.Case.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.CreateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.CreateCaseRequest} CreateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.CreateCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message["case"] != null && message.hasOwnProperty("case")) { + var error = $root.google.cloud.support.v2beta.Case.verify(message["case"]); + if (error) + return "case." + error; + } + return null; + }; + + /** + * Creates a CreateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.CreateCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.CreateCaseRequest} CreateCaseRequest + */ + CreateCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.CreateCaseRequest) + return object; + var message = new $root.google.cloud.support.v2beta.CreateCaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object["case"] != null) { + if (typeof object["case"] !== "object") + throw TypeError(".google.cloud.support.v2beta.CreateCaseRequest.case: object expected"); + message["case"] = $root.google.cloud.support.v2beta.Case.fromObject(object["case"]); + } + return message; + }; + + /** + * Creates a plain object from a CreateCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.CreateCaseRequest + * @static + * @param {google.cloud.support.v2beta.CreateCaseRequest} message CreateCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object["case"] = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message["case"] != null && message.hasOwnProperty("case")) + object["case"] = $root.google.cloud.support.v2beta.Case.toObject(message["case"], options); + return object; + }; + + /** + * Converts this CreateCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.CreateCaseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.CreateCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.CreateCaseRequest"; + }; + + return CreateCaseRequest; + })(); + + v2beta.ListCasesRequest = (function() { + + /** + * Properties of a ListCasesRequest. + * @memberof google.cloud.support.v2beta + * @interface IListCasesRequest + * @property {string|null} [parent] ListCasesRequest parent + * @property {string|null} [filter] ListCasesRequest filter + * @property {number|null} [pageSize] ListCasesRequest pageSize + * @property {string|null} [pageToken] ListCasesRequest pageToken + * @property {google.cloud.support.v2beta.ProductLine|null} [productLine] ListCasesRequest productLine + */ + + /** + * Constructs a new ListCasesRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a ListCasesRequest. + * @implements IListCasesRequest + * @constructor + * @param {google.cloud.support.v2beta.IListCasesRequest=} [properties] Properties to set + */ + function ListCasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.parent = ""; + + /** + * ListCasesRequest filter. + * @member {string} filter + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.filter = ""; + + /** + * ListCasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.pageSize = 0; + + /** + * ListCasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.pageToken = ""; + + /** + * ListCasesRequest productLine. + * @member {google.cloud.support.v2beta.ProductLine|null|undefined} productLine + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.productLine = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListCasesRequest.prototype, "_productLine", { + get: $util.oneOfGetter($oneOfFields = ["productLine"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @static + * @param {google.cloud.support.v2beta.IListCasesRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.ListCasesRequest} ListCasesRequest instance + */ + ListCasesRequest.create = function create(properties) { + return new ListCasesRequest(properties); + }; + + /** + * Encodes the specified ListCasesRequest message. Does not implicitly {@link google.cloud.support.v2beta.ListCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @static + * @param {google.cloud.support.v2beta.IListCasesRequest} message ListCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCasesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.productLine != null && Object.hasOwnProperty.call(message, "productLine")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.productLine); + return writer; + }; + + /** + * Encodes the specified ListCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @static + * @param {google.cloud.support.v2beta.IListCasesRequest} message ListCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.ListCasesRequest} ListCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCasesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ListCasesRequest(); + 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.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.productLine = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.ListCasesRequest} ListCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCasesRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCasesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: 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"; + if (message.productLine != null && message.hasOwnProperty("productLine")) { + properties._productLine = 1; + switch (message.productLine) { + default: + return "productLine: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a ListCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.ListCasesRequest} ListCasesRequest + */ + ListCasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.ListCasesRequest) + return object; + var message = new $root.google.cloud.support.v2beta.ListCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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); + switch (object.productLine) { + default: + if (typeof object.productLine === "number") { + message.productLine = object.productLine; + break; + } + break; + case "PRODUCT_LINE_UNSPECIFIED": + case 0: + message.productLine = 0; + break; + case "GOOGLE_CLOUD": + case 1: + message.productLine = 1; + break; + case "GOOGLE_MAPS": + case 2: + message.productLine = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @static + * @param {google.cloud.support.v2beta.ListCasesRequest} message ListCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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.productLine != null && message.hasOwnProperty("productLine")) { + object.productLine = options.enums === String ? $root.google.cloud.support.v2beta.ProductLine[message.productLine] === undefined ? message.productLine : $root.google.cloud.support.v2beta.ProductLine[message.productLine] : message.productLine; + if (options.oneofs) + object._productLine = "productLine"; + } + return object; + }; + + /** + * Converts this ListCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCasesRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.ListCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.ListCasesRequest"; + }; + + return ListCasesRequest; + })(); + + v2beta.ListCasesResponse = (function() { + + /** + * Properties of a ListCasesResponse. + * @memberof google.cloud.support.v2beta + * @interface IListCasesResponse + * @property {Array.|null} [cases] ListCasesResponse cases + * @property {string|null} [nextPageToken] ListCasesResponse nextPageToken + */ + + /** + * Constructs a new ListCasesResponse. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a ListCasesResponse. + * @implements IListCasesResponse + * @constructor + * @param {google.cloud.support.v2beta.IListCasesResponse=} [properties] Properties to set + */ + function ListCasesResponse(properties) { + this.cases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCasesResponse cases. + * @member {Array.} cases + * @memberof google.cloud.support.v2beta.ListCasesResponse + * @instance + */ + ListCasesResponse.prototype.cases = $util.emptyArray; + + /** + * ListCasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2beta.ListCasesResponse + * @instance + */ + ListCasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.ListCasesResponse + * @static + * @param {google.cloud.support.v2beta.IListCasesResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.ListCasesResponse} ListCasesResponse instance + */ + ListCasesResponse.create = function create(properties) { + return new ListCasesResponse(properties); + }; + + /** + * Encodes the specified ListCasesResponse message. Does not implicitly {@link google.cloud.support.v2beta.ListCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.ListCasesResponse + * @static + * @param {google.cloud.support.v2beta.IListCasesResponse} message ListCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cases != null && message.cases.length) + for (var i = 0; i < message.cases.length; ++i) + $root.google.cloud.support.v2beta.Case.encode(message.cases[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 ListCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.ListCasesResponse + * @static + * @param {google.cloud.support.v2beta.IListCasesResponse} message ListCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.ListCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.ListCasesResponse} ListCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCasesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ListCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.cases && message.cases.length)) + message.cases = []; + message.cases.push($root.google.cloud.support.v2beta.Case.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.ListCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.ListCasesResponse} ListCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCasesResponse message. + * @function verify + * @memberof google.cloud.support.v2beta.ListCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cases != null && message.hasOwnProperty("cases")) { + if (!Array.isArray(message.cases)) + return "cases: array expected"; + for (var i = 0; i < message.cases.length; ++i) { + var error = $root.google.cloud.support.v2beta.Case.verify(message.cases[i]); + if (error) + return "cases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.ListCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.ListCasesResponse} ListCasesResponse + */ + ListCasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.ListCasesResponse) + return object; + var message = new $root.google.cloud.support.v2beta.ListCasesResponse(); + if (object.cases) { + if (!Array.isArray(object.cases)) + throw TypeError(".google.cloud.support.v2beta.ListCasesResponse.cases: array expected"); + message.cases = []; + for (var i = 0; i < object.cases.length; ++i) { + if (typeof object.cases[i] !== "object") + throw TypeError(".google.cloud.support.v2beta.ListCasesResponse.cases: object expected"); + message.cases[i] = $root.google.cloud.support.v2beta.Case.fromObject(object.cases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.ListCasesResponse + * @static + * @param {google.cloud.support.v2beta.ListCasesResponse} message ListCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.cases && message.cases.length) { + object.cases = []; + for (var j = 0; j < message.cases.length; ++j) + object.cases[j] = $root.google.cloud.support.v2beta.Case.toObject(message.cases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.ListCasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCasesResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.ListCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.ListCasesResponse"; + }; + + return ListCasesResponse; + })(); + + v2beta.SearchCasesRequest = (function() { + + /** + * Properties of a SearchCasesRequest. + * @memberof google.cloud.support.v2beta + * @interface ISearchCasesRequest + * @property {string|null} [parent] SearchCasesRequest parent + * @property {string|null} [query] SearchCasesRequest query + * @property {number|null} [pageSize] SearchCasesRequest pageSize + * @property {string|null} [pageToken] SearchCasesRequest pageToken + */ + + /** + * Constructs a new SearchCasesRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a SearchCasesRequest. + * @implements ISearchCasesRequest + * @constructor + * @param {google.cloud.support.v2beta.ISearchCasesRequest=} [properties] Properties to set + */ + function SearchCasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @instance + */ + SearchCasesRequest.prototype.parent = ""; + + /** + * SearchCasesRequest query. + * @member {string} query + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @instance + */ + SearchCasesRequest.prototype.query = ""; + + /** + * SearchCasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @instance + */ + SearchCasesRequest.prototype.pageSize = 0; + + /** + * SearchCasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @instance + */ + SearchCasesRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @static + * @param {google.cloud.support.v2beta.ISearchCasesRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.SearchCasesRequest} SearchCasesRequest instance + */ + SearchCasesRequest.create = function create(properties) { + return new SearchCasesRequest(properties); + }; + + /** + * Encodes the specified SearchCasesRequest message. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @static + * @param {google.cloud.support.v2beta.ISearchCasesRequest} message SearchCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCasesRequest.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.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified SearchCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @static + * @param {google.cloud.support.v2beta.ISearchCasesRequest} message SearchCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.SearchCasesRequest} SearchCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCasesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.SearchCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.parent = reader.string(); + break; + } + case 1: { + message.query = 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 SearchCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.SearchCasesRequest} SearchCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCasesRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCasesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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 SearchCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.SearchCasesRequest} SearchCasesRequest + */ + SearchCasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.SearchCasesRequest) + return object; + var message = new $root.google.cloud.support.v2beta.SearchCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.query != null) + message.query = String(object.query); + 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 SearchCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @static + * @param {google.cloud.support.v2beta.SearchCasesRequest} message SearchCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + object.parent = ""; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this SearchCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @instance + * @returns {Object.} JSON object + */ + SearchCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCasesRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.SearchCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.SearchCasesRequest"; + }; + + return SearchCasesRequest; + })(); + + v2beta.SearchCasesResponse = (function() { + + /** + * Properties of a SearchCasesResponse. + * @memberof google.cloud.support.v2beta + * @interface ISearchCasesResponse + * @property {Array.|null} [cases] SearchCasesResponse cases + * @property {string|null} [nextPageToken] SearchCasesResponse nextPageToken + */ + + /** + * Constructs a new SearchCasesResponse. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a SearchCasesResponse. + * @implements ISearchCasesResponse + * @constructor + * @param {google.cloud.support.v2beta.ISearchCasesResponse=} [properties] Properties to set + */ + function SearchCasesResponse(properties) { + this.cases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCasesResponse cases. + * @member {Array.} cases + * @memberof google.cloud.support.v2beta.SearchCasesResponse + * @instance + */ + SearchCasesResponse.prototype.cases = $util.emptyArray; + + /** + * SearchCasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2beta.SearchCasesResponse + * @instance + */ + SearchCasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.SearchCasesResponse + * @static + * @param {google.cloud.support.v2beta.ISearchCasesResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.SearchCasesResponse} SearchCasesResponse instance + */ + SearchCasesResponse.create = function create(properties) { + return new SearchCasesResponse(properties); + }; + + /** + * Encodes the specified SearchCasesResponse message. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.SearchCasesResponse + * @static + * @param {google.cloud.support.v2beta.ISearchCasesResponse} message SearchCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cases != null && message.cases.length) + for (var i = 0; i < message.cases.length; ++i) + $root.google.cloud.support.v2beta.Case.encode(message.cases[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 SearchCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.SearchCasesResponse + * @static + * @param {google.cloud.support.v2beta.ISearchCasesResponse} message SearchCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.SearchCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.SearchCasesResponse} SearchCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCasesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.SearchCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.cases && message.cases.length)) + message.cases = []; + message.cases.push($root.google.cloud.support.v2beta.Case.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.SearchCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.SearchCasesResponse} SearchCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCasesResponse message. + * @function verify + * @memberof google.cloud.support.v2beta.SearchCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cases != null && message.hasOwnProperty("cases")) { + if (!Array.isArray(message.cases)) + return "cases: array expected"; + for (var i = 0; i < message.cases.length; ++i) { + var error = $root.google.cloud.support.v2beta.Case.verify(message.cases[i]); + if (error) + return "cases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.SearchCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.SearchCasesResponse} SearchCasesResponse + */ + SearchCasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.SearchCasesResponse) + return object; + var message = new $root.google.cloud.support.v2beta.SearchCasesResponse(); + if (object.cases) { + if (!Array.isArray(object.cases)) + throw TypeError(".google.cloud.support.v2beta.SearchCasesResponse.cases: array expected"); + message.cases = []; + for (var i = 0; i < object.cases.length; ++i) { + if (typeof object.cases[i] !== "object") + throw TypeError(".google.cloud.support.v2beta.SearchCasesResponse.cases: object expected"); + message.cases[i] = $root.google.cloud.support.v2beta.Case.fromObject(object.cases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.SearchCasesResponse + * @static + * @param {google.cloud.support.v2beta.SearchCasesResponse} message SearchCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.cases && message.cases.length) { + object.cases = []; + for (var j = 0; j < message.cases.length; ++j) + object.cases[j] = $root.google.cloud.support.v2beta.Case.toObject(message.cases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.SearchCasesResponse + * @instance + * @returns {Object.} JSON object + */ + SearchCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCasesResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.SearchCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.SearchCasesResponse"; + }; + + return SearchCasesResponse; + })(); + + v2beta.EscalateCaseRequest = (function() { + + /** + * Properties of an EscalateCaseRequest. + * @memberof google.cloud.support.v2beta + * @interface IEscalateCaseRequest + * @property {string|null} [name] EscalateCaseRequest name + * @property {google.cloud.support.v2beta.IEscalation|null} [escalation] EscalateCaseRequest escalation + */ + + /** + * Constructs a new EscalateCaseRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents an EscalateCaseRequest. + * @implements IEscalateCaseRequest + * @constructor + * @param {google.cloud.support.v2beta.IEscalateCaseRequest=} [properties] Properties to set + */ + function EscalateCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EscalateCaseRequest name. + * @member {string} name + * @memberof google.cloud.support.v2beta.EscalateCaseRequest + * @instance + */ + EscalateCaseRequest.prototype.name = ""; + + /** + * EscalateCaseRequest escalation. + * @member {google.cloud.support.v2beta.IEscalation|null|undefined} escalation + * @memberof google.cloud.support.v2beta.EscalateCaseRequest + * @instance + */ + EscalateCaseRequest.prototype.escalation = null; + + /** + * Creates a new EscalateCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.EscalateCaseRequest + * @static + * @param {google.cloud.support.v2beta.IEscalateCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.EscalateCaseRequest} EscalateCaseRequest instance + */ + EscalateCaseRequest.create = function create(properties) { + return new EscalateCaseRequest(properties); + }; + + /** + * Encodes the specified EscalateCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.EscalateCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.EscalateCaseRequest + * @static + * @param {google.cloud.support.v2beta.IEscalateCaseRequest} message EscalateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EscalateCaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.escalation != null && Object.hasOwnProperty.call(message, "escalation")) + $root.google.cloud.support.v2beta.Escalation.encode(message.escalation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EscalateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.EscalateCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.EscalateCaseRequest + * @static + * @param {google.cloud.support.v2beta.IEscalateCaseRequest} message EscalateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EscalateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EscalateCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.EscalateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.EscalateCaseRequest} EscalateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EscalateCaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.EscalateCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.escalation = $root.google.cloud.support.v2beta.Escalation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EscalateCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.EscalateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.EscalateCaseRequest} EscalateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EscalateCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EscalateCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.EscalateCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EscalateCaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.escalation != null && message.hasOwnProperty("escalation")) { + var error = $root.google.cloud.support.v2beta.Escalation.verify(message.escalation); + if (error) + return "escalation." + error; + } + return null; + }; + + /** + * Creates an EscalateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.EscalateCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.EscalateCaseRequest} EscalateCaseRequest + */ + EscalateCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.EscalateCaseRequest) + return object; + var message = new $root.google.cloud.support.v2beta.EscalateCaseRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.escalation != null) { + if (typeof object.escalation !== "object") + throw TypeError(".google.cloud.support.v2beta.EscalateCaseRequest.escalation: object expected"); + message.escalation = $root.google.cloud.support.v2beta.Escalation.fromObject(object.escalation); + } + return message; + }; + + /** + * Creates a plain object from an EscalateCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.EscalateCaseRequest + * @static + * @param {google.cloud.support.v2beta.EscalateCaseRequest} message EscalateCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EscalateCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.escalation = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.escalation != null && message.hasOwnProperty("escalation")) + object.escalation = $root.google.cloud.support.v2beta.Escalation.toObject(message.escalation, options); + return object; + }; + + /** + * Converts this EscalateCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.EscalateCaseRequest + * @instance + * @returns {Object.} JSON object + */ + EscalateCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EscalateCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.EscalateCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EscalateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.EscalateCaseRequest"; + }; + + return EscalateCaseRequest; + })(); + + v2beta.UpdateCaseRequest = (function() { + + /** + * Properties of an UpdateCaseRequest. + * @memberof google.cloud.support.v2beta + * @interface IUpdateCaseRequest + * @property {google.cloud.support.v2beta.ICase|null} ["case"] UpdateCaseRequest case + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCaseRequest updateMask + */ + + /** + * Constructs a new UpdateCaseRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents an UpdateCaseRequest. + * @implements IUpdateCaseRequest + * @constructor + * @param {google.cloud.support.v2beta.IUpdateCaseRequest=} [properties] Properties to set + */ + function UpdateCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCaseRequest case. + * @member {google.cloud.support.v2beta.ICase|null|undefined} case + * @memberof google.cloud.support.v2beta.UpdateCaseRequest + * @instance + */ + UpdateCaseRequest.prototype["case"] = null; + + /** + * UpdateCaseRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.support.v2beta.UpdateCaseRequest + * @instance + */ + UpdateCaseRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.UpdateCaseRequest + * @static + * @param {google.cloud.support.v2beta.IUpdateCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.UpdateCaseRequest} UpdateCaseRequest instance + */ + UpdateCaseRequest.create = function create(properties) { + return new UpdateCaseRequest(properties); + }; + + /** + * Encodes the specified UpdateCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.UpdateCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.UpdateCaseRequest + * @static + * @param {google.cloud.support.v2beta.IUpdateCaseRequest} message UpdateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) + $root.google.cloud.support.v2beta.Case.encode(message["case"], 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 UpdateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.UpdateCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.UpdateCaseRequest + * @static + * @param {google.cloud.support.v2beta.IUpdateCaseRequest} message UpdateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.UpdateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.UpdateCaseRequest} UpdateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.UpdateCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message["case"] = $root.google.cloud.support.v2beta.Case.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 UpdateCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.UpdateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.UpdateCaseRequest} UpdateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.UpdateCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message["case"] != null && message.hasOwnProperty("case")) { + var error = $root.google.cloud.support.v2beta.Case.verify(message["case"]); + if (error) + return "case." + 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 UpdateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.UpdateCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.UpdateCaseRequest} UpdateCaseRequest + */ + UpdateCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.UpdateCaseRequest) + return object; + var message = new $root.google.cloud.support.v2beta.UpdateCaseRequest(); + if (object["case"] != null) { + if (typeof object["case"] !== "object") + throw TypeError(".google.cloud.support.v2beta.UpdateCaseRequest.case: object expected"); + message["case"] = $root.google.cloud.support.v2beta.Case.fromObject(object["case"]); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.support.v2beta.UpdateCaseRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.UpdateCaseRequest + * @static + * @param {google.cloud.support.v2beta.UpdateCaseRequest} message UpdateCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object["case"] = null; + object.updateMask = null; + } + if (message["case"] != null && message.hasOwnProperty("case")) + object["case"] = $root.google.cloud.support.v2beta.Case.toObject(message["case"], options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.UpdateCaseRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.UpdateCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.UpdateCaseRequest"; + }; + + return UpdateCaseRequest; + })(); + + v2beta.CloseCaseRequest = (function() { + + /** + * Properties of a CloseCaseRequest. + * @memberof google.cloud.support.v2beta + * @interface ICloseCaseRequest + * @property {string|null} [name] CloseCaseRequest name + */ + + /** + * Constructs a new CloseCaseRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a CloseCaseRequest. + * @implements ICloseCaseRequest + * @constructor + * @param {google.cloud.support.v2beta.ICloseCaseRequest=} [properties] Properties to set + */ + function CloseCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloseCaseRequest name. + * @member {string} name + * @memberof google.cloud.support.v2beta.CloseCaseRequest + * @instance + */ + CloseCaseRequest.prototype.name = ""; + + /** + * Creates a new CloseCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.CloseCaseRequest + * @static + * @param {google.cloud.support.v2beta.ICloseCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.CloseCaseRequest} CloseCaseRequest instance + */ + CloseCaseRequest.create = function create(properties) { + return new CloseCaseRequest(properties); + }; + + /** + * Encodes the specified CloseCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.CloseCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.CloseCaseRequest + * @static + * @param {google.cloud.support.v2beta.ICloseCaseRequest} message CloseCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseCaseRequest.encode = function encode(message, writer) { + 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 CloseCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CloseCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.CloseCaseRequest + * @static + * @param {google.cloud.support.v2beta.ICloseCaseRequest} message CloseCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloseCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.CloseCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.CloseCaseRequest} CloseCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseCaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.CloseCaseRequest(); + 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 CloseCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.CloseCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.CloseCaseRequest} CloseCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloseCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.CloseCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloseCaseRequest.verify = function verify(message) { + if (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 CloseCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.CloseCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.CloseCaseRequest} CloseCaseRequest + */ + CloseCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.CloseCaseRequest) + return object; + var message = new $root.google.cloud.support.v2beta.CloseCaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CloseCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.CloseCaseRequest + * @static + * @param {google.cloud.support.v2beta.CloseCaseRequest} message CloseCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloseCaseRequest.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 CloseCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.CloseCaseRequest + * @instance + * @returns {Object.} JSON object + */ + CloseCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloseCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.CloseCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.CloseCaseRequest"; + }; + + return CloseCaseRequest; + })(); + + v2beta.SearchCaseClassificationsRequest = (function() { + + /** + * Properties of a SearchCaseClassificationsRequest. + * @memberof google.cloud.support.v2beta + * @interface ISearchCaseClassificationsRequest + * @property {string|null} [query] SearchCaseClassificationsRequest query + * @property {number|null} [pageSize] SearchCaseClassificationsRequest pageSize + * @property {string|null} [pageToken] SearchCaseClassificationsRequest pageToken + * @property {google.cloud.support.v2beta.IProduct|null} [product] SearchCaseClassificationsRequest product + */ + + /** + * Constructs a new SearchCaseClassificationsRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a SearchCaseClassificationsRequest. + * @implements ISearchCaseClassificationsRequest + * @constructor + * @param {google.cloud.support.v2beta.ISearchCaseClassificationsRequest=} [properties] Properties to set + */ + function SearchCaseClassificationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCaseClassificationsRequest query. + * @member {string} query + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @instance + */ + SearchCaseClassificationsRequest.prototype.query = ""; + + /** + * SearchCaseClassificationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @instance + */ + SearchCaseClassificationsRequest.prototype.pageSize = 0; + + /** + * SearchCaseClassificationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @instance + */ + SearchCaseClassificationsRequest.prototype.pageToken = ""; + + /** + * SearchCaseClassificationsRequest product. + * @member {google.cloud.support.v2beta.IProduct|null|undefined} product + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @instance + */ + SearchCaseClassificationsRequest.prototype.product = null; + + /** + * Creates a new SearchCaseClassificationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @static + * @param {google.cloud.support.v2beta.ISearchCaseClassificationsRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest instance + */ + SearchCaseClassificationsRequest.create = function create(properties) { + return new SearchCaseClassificationsRequest(properties); + }; + + /** + * Encodes the specified SearchCaseClassificationsRequest message. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @static + * @param {google.cloud.support.v2beta.ISearchCaseClassificationsRequest} message SearchCaseClassificationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCaseClassificationsRequest.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.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.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.support.v2beta.Product.encode(message.product, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchCaseClassificationsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @static + * @param {google.cloud.support.v2beta.ISearchCaseClassificationsRequest} message SearchCaseClassificationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCaseClassificationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCaseClassificationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.SearchCaseClassificationsRequest(); + 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.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 7: { + message.product = $root.google.cloud.support.v2beta.Product.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCaseClassificationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCaseClassificationsRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCaseClassificationsRequest.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.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.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.support.v2beta.Product.verify(message.product); + if (error) + return "product." + error; + } + return null; + }; + + /** + * Creates a SearchCaseClassificationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest + */ + SearchCaseClassificationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.SearchCaseClassificationsRequest) + return object; + var message = new $root.google.cloud.support.v2beta.SearchCaseClassificationsRequest(); + if (object.query != null) + message.query = String(object.query); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.support.v2beta.SearchCaseClassificationsRequest.product: object expected"); + message.product = $root.google.cloud.support.v2beta.Product.fromObject(object.product); + } + return message; + }; + + /** + * Creates a plain object from a SearchCaseClassificationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @static + * @param {google.cloud.support.v2beta.SearchCaseClassificationsRequest} message SearchCaseClassificationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCaseClassificationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + object.product = null; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.support.v2beta.Product.toObject(message.product, options); + return object; + }; + + /** + * Converts this SearchCaseClassificationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchCaseClassificationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCaseClassificationsRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCaseClassificationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.SearchCaseClassificationsRequest"; + }; + + return SearchCaseClassificationsRequest; + })(); + + v2beta.SearchCaseClassificationsResponse = (function() { + + /** + * Properties of a SearchCaseClassificationsResponse. + * @memberof google.cloud.support.v2beta + * @interface ISearchCaseClassificationsResponse + * @property {Array.|null} [caseClassifications] SearchCaseClassificationsResponse caseClassifications + * @property {string|null} [nextPageToken] SearchCaseClassificationsResponse nextPageToken + */ + + /** + * Constructs a new SearchCaseClassificationsResponse. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a SearchCaseClassificationsResponse. + * @implements ISearchCaseClassificationsResponse + * @constructor + * @param {google.cloud.support.v2beta.ISearchCaseClassificationsResponse=} [properties] Properties to set + */ + function SearchCaseClassificationsResponse(properties) { + this.caseClassifications = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCaseClassificationsResponse caseClassifications. + * @member {Array.} caseClassifications + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse + * @instance + */ + SearchCaseClassificationsResponse.prototype.caseClassifications = $util.emptyArray; + + /** + * SearchCaseClassificationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse + * @instance + */ + SearchCaseClassificationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchCaseClassificationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse + * @static + * @param {google.cloud.support.v2beta.ISearchCaseClassificationsResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse instance + */ + SearchCaseClassificationsResponse.create = function create(properties) { + return new SearchCaseClassificationsResponse(properties); + }; + + /** + * Encodes the specified SearchCaseClassificationsResponse message. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse + * @static + * @param {google.cloud.support.v2beta.ISearchCaseClassificationsResponse} message SearchCaseClassificationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCaseClassificationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caseClassifications != null && message.caseClassifications.length) + for (var i = 0; i < message.caseClassifications.length; ++i) + $root.google.cloud.support.v2beta.CaseClassification.encode(message.caseClassifications[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 SearchCaseClassificationsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse + * @static + * @param {google.cloud.support.v2beta.ISearchCaseClassificationsResponse} message SearchCaseClassificationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCaseClassificationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCaseClassificationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.SearchCaseClassificationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.caseClassifications && message.caseClassifications.length)) + message.caseClassifications = []; + message.caseClassifications.push($root.google.cloud.support.v2beta.CaseClassification.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCaseClassificationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCaseClassificationsResponse message. + * @function verify + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCaseClassificationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caseClassifications != null && message.hasOwnProperty("caseClassifications")) { + if (!Array.isArray(message.caseClassifications)) + return "caseClassifications: array expected"; + for (var i = 0; i < message.caseClassifications.length; ++i) { + var error = $root.google.cloud.support.v2beta.CaseClassification.verify(message.caseClassifications[i]); + if (error) + return "caseClassifications." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchCaseClassificationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse + */ + SearchCaseClassificationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.SearchCaseClassificationsResponse) + return object; + var message = new $root.google.cloud.support.v2beta.SearchCaseClassificationsResponse(); + if (object.caseClassifications) { + if (!Array.isArray(object.caseClassifications)) + throw TypeError(".google.cloud.support.v2beta.SearchCaseClassificationsResponse.caseClassifications: array expected"); + message.caseClassifications = []; + for (var i = 0; i < object.caseClassifications.length; ++i) { + if (typeof object.caseClassifications[i] !== "object") + throw TypeError(".google.cloud.support.v2beta.SearchCaseClassificationsResponse.caseClassifications: object expected"); + message.caseClassifications[i] = $root.google.cloud.support.v2beta.CaseClassification.fromObject(object.caseClassifications[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchCaseClassificationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse + * @static + * @param {google.cloud.support.v2beta.SearchCaseClassificationsResponse} message SearchCaseClassificationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCaseClassificationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.caseClassifications = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.caseClassifications && message.caseClassifications.length) { + object.caseClassifications = []; + for (var j = 0; j < message.caseClassifications.length; ++j) + object.caseClassifications[j] = $root.google.cloud.support.v2beta.CaseClassification.toObject(message.caseClassifications[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchCaseClassificationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchCaseClassificationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCaseClassificationsResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCaseClassificationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.SearchCaseClassificationsResponse"; + }; + + return SearchCaseClassificationsResponse; + })(); + + v2beta.Escalation = (function() { + + /** + * Properties of an Escalation. + * @memberof google.cloud.support.v2beta + * @interface IEscalation + * @property {google.cloud.support.v2beta.Escalation.Reason|null} [reason] Escalation reason + * @property {string|null} [justification] Escalation justification + */ + + /** + * Constructs a new Escalation. + * @memberof google.cloud.support.v2beta + * @classdesc Represents an Escalation. + * @implements IEscalation + * @constructor + * @param {google.cloud.support.v2beta.IEscalation=} [properties] Properties to set + */ + function Escalation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Escalation reason. + * @member {google.cloud.support.v2beta.Escalation.Reason} reason + * @memberof google.cloud.support.v2beta.Escalation + * @instance + */ + Escalation.prototype.reason = 0; + + /** + * Escalation justification. + * @member {string} justification + * @memberof google.cloud.support.v2beta.Escalation + * @instance + */ + Escalation.prototype.justification = ""; + + /** + * Creates a new Escalation instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.Escalation + * @static + * @param {google.cloud.support.v2beta.IEscalation=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.Escalation} Escalation instance + */ + Escalation.create = function create(properties) { + return new Escalation(properties); + }; + + /** + * Encodes the specified Escalation message. Does not implicitly {@link google.cloud.support.v2beta.Escalation.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.Escalation + * @static + * @param {google.cloud.support.v2beta.IEscalation} message Escalation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Escalation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.reason); + if (message.justification != null && Object.hasOwnProperty.call(message, "justification")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.justification); + return writer; + }; + + /** + * Encodes the specified Escalation message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Escalation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.Escalation + * @static + * @param {google.cloud.support.v2beta.IEscalation} message Escalation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Escalation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Escalation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.Escalation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.Escalation} Escalation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Escalation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.Escalation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.reason = reader.int32(); + break; + } + case 5: { + message.justification = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Escalation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.Escalation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.Escalation} Escalation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Escalation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Escalation message. + * @function verify + * @memberof google.cloud.support.v2beta.Escalation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Escalation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.justification != null && message.hasOwnProperty("justification")) + if (!$util.isString(message.justification)) + return "justification: string expected"; + return null; + }; + + /** + * Creates an Escalation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.Escalation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.Escalation} Escalation + */ + Escalation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.Escalation) + return object; + var message = new $root.google.cloud.support.v2beta.Escalation(); + switch (object.reason) { + default: + if (typeof object.reason === "number") { + message.reason = object.reason; + break; + } + break; + case "REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "RESOLUTION_TIME": + case 1: + message.reason = 1; + break; + case "TECHNICAL_EXPERTISE": + case 2: + message.reason = 2; + break; + case "BUSINESS_IMPACT": + case 3: + message.reason = 3; + break; + } + if (object.justification != null) + message.justification = String(object.justification); + return message; + }; + + /** + * Creates a plain object from an Escalation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.Escalation + * @static + * @param {google.cloud.support.v2beta.Escalation} message Escalation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Escalation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.reason = options.enums === String ? "REASON_UNSPECIFIED" : 0; + object.justification = ""; + } + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = options.enums === String ? $root.google.cloud.support.v2beta.Escalation.Reason[message.reason] === undefined ? message.reason : $root.google.cloud.support.v2beta.Escalation.Reason[message.reason] : message.reason; + if (message.justification != null && message.hasOwnProperty("justification")) + object.justification = message.justification; + return object; + }; + + /** + * Converts this Escalation to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.Escalation + * @instance + * @returns {Object.} JSON object + */ + Escalation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Escalation + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.Escalation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Escalation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.Escalation"; + }; + + /** + * Reason enum. + * @name google.cloud.support.v2beta.Escalation.Reason + * @enum {number} + * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value + * @property {number} RESOLUTION_TIME=1 RESOLUTION_TIME value + * @property {number} TECHNICAL_EXPERTISE=2 TECHNICAL_EXPERTISE value + * @property {number} BUSINESS_IMPACT=3 BUSINESS_IMPACT value + */ + Escalation.Reason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOLUTION_TIME"] = 1; + values[valuesById[2] = "TECHNICAL_EXPERTISE"] = 2; + values[valuesById[3] = "BUSINESS_IMPACT"] = 3; + return values; + })(); + + return Escalation; + })(); + + v2beta.Comment = (function() { + + /** + * Properties of a Comment. + * @memberof google.cloud.support.v2beta + * @interface IComment + * @property {string|null} [name] Comment name + * @property {google.protobuf.ITimestamp|null} [createTime] Comment createTime + * @property {google.cloud.support.v2beta.IActor|null} [creator] Comment creator + * @property {string|null} [body] Comment body + * @property {string|null} [plainTextBody] Comment plainTextBody + */ + + /** + * Constructs a new Comment. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a Comment. + * @implements IComment + * @constructor + * @param {google.cloud.support.v2beta.IComment=} [properties] Properties to set + */ + function Comment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Comment name. + * @member {string} name + * @memberof google.cloud.support.v2beta.Comment + * @instance + */ + Comment.prototype.name = ""; + + /** + * Comment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.support.v2beta.Comment + * @instance + */ + Comment.prototype.createTime = null; + + /** + * Comment creator. + * @member {google.cloud.support.v2beta.IActor|null|undefined} creator + * @memberof google.cloud.support.v2beta.Comment + * @instance + */ + Comment.prototype.creator = null; + + /** + * Comment body. + * @member {string} body + * @memberof google.cloud.support.v2beta.Comment + * @instance + */ + Comment.prototype.body = ""; + + /** + * Comment plainTextBody. + * @member {string} plainTextBody + * @memberof google.cloud.support.v2beta.Comment + * @instance + */ + Comment.prototype.plainTextBody = ""; + + /** + * Creates a new Comment instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.Comment + * @static + * @param {google.cloud.support.v2beta.IComment=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.Comment} Comment instance + */ + Comment.create = function create(properties) { + return new Comment(properties); + }; + + /** + * Encodes the specified Comment message. Does not implicitly {@link google.cloud.support.v2beta.Comment.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.Comment + * @static + * @param {google.cloud.support.v2beta.IComment} message Comment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Comment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + $root.google.cloud.support.v2beta.Actor.encode(message.creator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.body); + if (message.plainTextBody != null && Object.hasOwnProperty.call(message, "plainTextBody")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plainTextBody); + return writer; + }; + + /** + * Encodes the specified Comment message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Comment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.Comment + * @static + * @param {google.cloud.support.v2beta.IComment} message Comment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Comment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Comment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.Comment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.Comment} Comment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Comment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.Comment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.creator = $root.google.cloud.support.v2beta.Actor.decode(reader, reader.uint32()); + break; + } + case 4: { + message.body = reader.string(); + break; + } + case 5: { + message.plainTextBody = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Comment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.Comment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.Comment} Comment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Comment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Comment message. + * @function verify + * @memberof google.cloud.support.v2beta.Comment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Comment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: 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.creator != null && message.hasOwnProperty("creator")) { + var error = $root.google.cloud.support.v2beta.Actor.verify(message.creator); + if (error) + return "creator." + error; + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.plainTextBody != null && message.hasOwnProperty("plainTextBody")) + if (!$util.isString(message.plainTextBody)) + return "plainTextBody: string expected"; + return null; + }; + + /** + * Creates a Comment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.Comment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.Comment} Comment + */ + Comment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.Comment) + return object; + var message = new $root.google.cloud.support.v2beta.Comment(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.support.v2beta.Comment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.creator != null) { + if (typeof object.creator !== "object") + throw TypeError(".google.cloud.support.v2beta.Comment.creator: object expected"); + message.creator = $root.google.cloud.support.v2beta.Actor.fromObject(object.creator); + } + if (object.body != null) + message.body = String(object.body); + if (object.plainTextBody != null) + message.plainTextBody = String(object.plainTextBody); + return message; + }; + + /** + * Creates a plain object from a Comment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.Comment + * @static + * @param {google.cloud.support.v2beta.Comment} message Comment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Comment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.creator = null; + object.body = ""; + object.plainTextBody = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = $root.google.cloud.support.v2beta.Actor.toObject(message.creator, options); + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.plainTextBody != null && message.hasOwnProperty("plainTextBody")) + object.plainTextBody = message.plainTextBody; + return object; + }; + + /** + * Converts this Comment to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.Comment + * @instance + * @returns {Object.} JSON object + */ + Comment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Comment + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.Comment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Comment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.Comment"; + }; + + return Comment; + })(); + + v2beta.CommentService = (function() { + + /** + * Constructs a new CommentService service. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a CommentService + * @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 CommentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CommentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CommentService; + + /** + * Creates new CommentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.support.v2beta.CommentService + * @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 {CommentService} RPC service. Useful where requests and/or responses are streamed. + */ + CommentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.support.v2beta.CommentService|listComments}. + * @memberof google.cloud.support.v2beta.CommentService + * @typedef ListCommentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.ListCommentsResponse} [response] ListCommentsResponse + */ + + /** + * Calls ListComments. + * @function listComments + * @memberof google.cloud.support.v2beta.CommentService + * @instance + * @param {google.cloud.support.v2beta.IListCommentsRequest} request ListCommentsRequest message or plain object + * @param {google.cloud.support.v2beta.CommentService.ListCommentsCallback} callback Node-style callback called with the error, if any, and ListCommentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CommentService.prototype.listComments = function listComments(request, callback) { + return this.rpcCall(listComments, $root.google.cloud.support.v2beta.ListCommentsRequest, $root.google.cloud.support.v2beta.ListCommentsResponse, request, callback); + }, "name", { value: "ListComments" }); + + /** + * Calls ListComments. + * @function listComments + * @memberof google.cloud.support.v2beta.CommentService + * @instance + * @param {google.cloud.support.v2beta.IListCommentsRequest} request ListCommentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2beta.CommentService|createComment}. + * @memberof google.cloud.support.v2beta.CommentService + * @typedef CreateCommentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.Comment} [response] Comment + */ + + /** + * Calls CreateComment. + * @function createComment + * @memberof google.cloud.support.v2beta.CommentService + * @instance + * @param {google.cloud.support.v2beta.ICreateCommentRequest} request CreateCommentRequest message or plain object + * @param {google.cloud.support.v2beta.CommentService.CreateCommentCallback} callback Node-style callback called with the error, if any, and Comment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CommentService.prototype.createComment = function createComment(request, callback) { + return this.rpcCall(createComment, $root.google.cloud.support.v2beta.CreateCommentRequest, $root.google.cloud.support.v2beta.Comment, request, callback); + }, "name", { value: "CreateComment" }); + + /** + * Calls CreateComment. + * @function createComment + * @memberof google.cloud.support.v2beta.CommentService + * @instance + * @param {google.cloud.support.v2beta.ICreateCommentRequest} request CreateCommentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2beta.CommentService|getComment}. + * @memberof google.cloud.support.v2beta.CommentService + * @typedef GetCommentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.Comment} [response] Comment + */ + + /** + * Calls GetComment. + * @function getComment + * @memberof google.cloud.support.v2beta.CommentService + * @instance + * @param {google.cloud.support.v2beta.IGetCommentRequest} request GetCommentRequest message or plain object + * @param {google.cloud.support.v2beta.CommentService.GetCommentCallback} callback Node-style callback called with the error, if any, and Comment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CommentService.prototype.getComment = function getComment(request, callback) { + return this.rpcCall(getComment, $root.google.cloud.support.v2beta.GetCommentRequest, $root.google.cloud.support.v2beta.Comment, request, callback); + }, "name", { value: "GetComment" }); + + /** + * Calls GetComment. + * @function getComment + * @memberof google.cloud.support.v2beta.CommentService + * @instance + * @param {google.cloud.support.v2beta.IGetCommentRequest} request GetCommentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CommentService; + })(); + + v2beta.ListCommentsRequest = (function() { + + /** + * Properties of a ListCommentsRequest. + * @memberof google.cloud.support.v2beta + * @interface IListCommentsRequest + * @property {string|null} [parent] ListCommentsRequest parent + * @property {number|null} [pageSize] ListCommentsRequest pageSize + * @property {string|null} [pageToken] ListCommentsRequest pageToken + */ + + /** + * Constructs a new ListCommentsRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a ListCommentsRequest. + * @implements IListCommentsRequest + * @constructor + * @param {google.cloud.support.v2beta.IListCommentsRequest=} [properties] Properties to set + */ + function ListCommentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCommentsRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @instance + */ + ListCommentsRequest.prototype.parent = ""; + + /** + * ListCommentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @instance + */ + ListCommentsRequest.prototype.pageSize = 0; + + /** + * ListCommentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @instance + */ + ListCommentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCommentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @static + * @param {google.cloud.support.v2beta.IListCommentsRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.ListCommentsRequest} ListCommentsRequest instance + */ + ListCommentsRequest.create = function create(properties) { + return new ListCommentsRequest(properties); + }; + + /** + * Encodes the specified ListCommentsRequest message. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @static + * @param {google.cloud.support.v2beta.IListCommentsRequest} message ListCommentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCommentsRequest.encode = function encode(message, writer) { + if (!writer) + 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 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCommentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @static + * @param {google.cloud.support.v2beta.IListCommentsRequest} message ListCommentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCommentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCommentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.ListCommentsRequest} ListCommentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCommentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ListCommentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCommentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.ListCommentsRequest} ListCommentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCommentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCommentsRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCommentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCommentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.ListCommentsRequest} ListCommentsRequest + */ + ListCommentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.ListCommentsRequest) + return object; + var message = new $root.google.cloud.support.v2beta.ListCommentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCommentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @static + * @param {google.cloud.support.v2beta.ListCommentsRequest} message ListCommentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCommentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListCommentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCommentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCommentsRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.ListCommentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCommentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.ListCommentsRequest"; + }; + + return ListCommentsRequest; + })(); + + v2beta.ListCommentsResponse = (function() { + + /** + * Properties of a ListCommentsResponse. + * @memberof google.cloud.support.v2beta + * @interface IListCommentsResponse + * @property {Array.|null} [comments] ListCommentsResponse comments + * @property {string|null} [nextPageToken] ListCommentsResponse nextPageToken + */ + + /** + * Constructs a new ListCommentsResponse. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a ListCommentsResponse. + * @implements IListCommentsResponse + * @constructor + * @param {google.cloud.support.v2beta.IListCommentsResponse=} [properties] Properties to set + */ + function ListCommentsResponse(properties) { + this.comments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCommentsResponse comments. + * @member {Array.} comments + * @memberof google.cloud.support.v2beta.ListCommentsResponse + * @instance + */ + ListCommentsResponse.prototype.comments = $util.emptyArray; + + /** + * ListCommentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2beta.ListCommentsResponse + * @instance + */ + ListCommentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCommentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.ListCommentsResponse + * @static + * @param {google.cloud.support.v2beta.IListCommentsResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.ListCommentsResponse} ListCommentsResponse instance + */ + ListCommentsResponse.create = function create(properties) { + return new ListCommentsResponse(properties); + }; + + /** + * Encodes the specified ListCommentsResponse message. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.ListCommentsResponse + * @static + * @param {google.cloud.support.v2beta.IListCommentsResponse} message ListCommentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCommentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.comments != null && message.comments.length) + for (var i = 0; i < message.comments.length; ++i) + $root.google.cloud.support.v2beta.Comment.encode(message.comments[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 ListCommentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.ListCommentsResponse + * @static + * @param {google.cloud.support.v2beta.IListCommentsResponse} message ListCommentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCommentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCommentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.ListCommentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.ListCommentsResponse} ListCommentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCommentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ListCommentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.comments && message.comments.length)) + message.comments = []; + message.comments.push($root.google.cloud.support.v2beta.Comment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCommentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.ListCommentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.ListCommentsResponse} ListCommentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCommentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCommentsResponse message. + * @function verify + * @memberof google.cloud.support.v2beta.ListCommentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCommentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.comments != null && message.hasOwnProperty("comments")) { + if (!Array.isArray(message.comments)) + return "comments: array expected"; + for (var i = 0; i < message.comments.length; ++i) { + var error = $root.google.cloud.support.v2beta.Comment.verify(message.comments[i]); + if (error) + return "comments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCommentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.ListCommentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.ListCommentsResponse} ListCommentsResponse + */ + ListCommentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.ListCommentsResponse) + return object; + var message = new $root.google.cloud.support.v2beta.ListCommentsResponse(); + if (object.comments) { + if (!Array.isArray(object.comments)) + throw TypeError(".google.cloud.support.v2beta.ListCommentsResponse.comments: array expected"); + message.comments = []; + for (var i = 0; i < object.comments.length; ++i) { + if (typeof object.comments[i] !== "object") + throw TypeError(".google.cloud.support.v2beta.ListCommentsResponse.comments: object expected"); + message.comments[i] = $root.google.cloud.support.v2beta.Comment.fromObject(object.comments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCommentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.ListCommentsResponse + * @static + * @param {google.cloud.support.v2beta.ListCommentsResponse} message ListCommentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCommentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.comments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.comments && message.comments.length) { + object.comments = []; + for (var j = 0; j < message.comments.length; ++j) + object.comments[j] = $root.google.cloud.support.v2beta.Comment.toObject(message.comments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCommentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.ListCommentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCommentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCommentsResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.ListCommentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCommentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.ListCommentsResponse"; + }; + + return ListCommentsResponse; + })(); + + v2beta.CreateCommentRequest = (function() { + + /** + * Properties of a CreateCommentRequest. + * @memberof google.cloud.support.v2beta + * @interface ICreateCommentRequest + * @property {string|null} [parent] CreateCommentRequest parent + * @property {google.cloud.support.v2beta.IComment|null} [comment] CreateCommentRequest comment + */ + + /** + * Constructs a new CreateCommentRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a CreateCommentRequest. + * @implements ICreateCommentRequest + * @constructor + * @param {google.cloud.support.v2beta.ICreateCommentRequest=} [properties] Properties to set + */ + function CreateCommentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCommentRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2beta.CreateCommentRequest + * @instance + */ + CreateCommentRequest.prototype.parent = ""; + + /** + * CreateCommentRequest comment. + * @member {google.cloud.support.v2beta.IComment|null|undefined} comment + * @memberof google.cloud.support.v2beta.CreateCommentRequest + * @instance + */ + CreateCommentRequest.prototype.comment = null; + + /** + * Creates a new CreateCommentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.CreateCommentRequest + * @static + * @param {google.cloud.support.v2beta.ICreateCommentRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.CreateCommentRequest} CreateCommentRequest instance + */ + CreateCommentRequest.create = function create(properties) { + return new CreateCommentRequest(properties); + }; + + /** + * Encodes the specified CreateCommentRequest message. Does not implicitly {@link google.cloud.support.v2beta.CreateCommentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.CreateCommentRequest + * @static + * @param {google.cloud.support.v2beta.ICreateCommentRequest} message CreateCommentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCommentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) + $root.google.cloud.support.v2beta.Comment.encode(message.comment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CreateCommentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.CreateCommentRequest + * @static + * @param {google.cloud.support.v2beta.ICreateCommentRequest} message CreateCommentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCommentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCommentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.CreateCommentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.CreateCommentRequest} CreateCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCommentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.CreateCommentRequest(); + 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.comment = $root.google.cloud.support.v2beta.Comment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCommentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.CreateCommentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.CreateCommentRequest} CreateCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCommentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCommentRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.CreateCommentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCommentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.comment != null && message.hasOwnProperty("comment")) { + var error = $root.google.cloud.support.v2beta.Comment.verify(message.comment); + if (error) + return "comment." + error; + } + return null; + }; + + /** + * Creates a CreateCommentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.CreateCommentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.CreateCommentRequest} CreateCommentRequest + */ + CreateCommentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.CreateCommentRequest) + return object; + var message = new $root.google.cloud.support.v2beta.CreateCommentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.comment != null) { + if (typeof object.comment !== "object") + throw TypeError(".google.cloud.support.v2beta.CreateCommentRequest.comment: object expected"); + message.comment = $root.google.cloud.support.v2beta.Comment.fromObject(object.comment); + } + return message; + }; + + /** + * Creates a plain object from a CreateCommentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.CreateCommentRequest + * @static + * @param {google.cloud.support.v2beta.CreateCommentRequest} message CreateCommentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCommentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.comment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.comment != null && message.hasOwnProperty("comment")) + object.comment = $root.google.cloud.support.v2beta.Comment.toObject(message.comment, options); + return object; + }; + + /** + * Converts this CreateCommentRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.CreateCommentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCommentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCommentRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.CreateCommentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCommentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.CreateCommentRequest"; + }; + + return CreateCommentRequest; + })(); + + v2beta.GetCommentRequest = (function() { + + /** + * Properties of a GetCommentRequest. + * @memberof google.cloud.support.v2beta + * @interface IGetCommentRequest + * @property {string|null} [name] GetCommentRequest name + */ + + /** + * Constructs a new GetCommentRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a GetCommentRequest. + * @implements IGetCommentRequest + * @constructor + * @param {google.cloud.support.v2beta.IGetCommentRequest=} [properties] Properties to set + */ + function GetCommentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCommentRequest name. + * @member {string} name + * @memberof google.cloud.support.v2beta.GetCommentRequest + * @instance + */ + GetCommentRequest.prototype.name = ""; + + /** + * Creates a new GetCommentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.GetCommentRequest + * @static + * @param {google.cloud.support.v2beta.IGetCommentRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.GetCommentRequest} GetCommentRequest instance + */ + GetCommentRequest.create = function create(properties) { + return new GetCommentRequest(properties); + }; + + /** + * Encodes the specified GetCommentRequest message. Does not implicitly {@link google.cloud.support.v2beta.GetCommentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.GetCommentRequest + * @static + * @param {google.cloud.support.v2beta.IGetCommentRequest} message GetCommentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCommentRequest.encode = function encode(message, writer) { + 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 GetCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.GetCommentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.GetCommentRequest + * @static + * @param {google.cloud.support.v2beta.IGetCommentRequest} message GetCommentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCommentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCommentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.GetCommentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.GetCommentRequest} GetCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCommentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.GetCommentRequest(); + 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 GetCommentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.GetCommentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.GetCommentRequest} GetCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCommentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCommentRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.GetCommentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCommentRequest.verify = function verify(message) { + if (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 GetCommentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.GetCommentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.GetCommentRequest} GetCommentRequest + */ + GetCommentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.GetCommentRequest) + return object; + var message = new $root.google.cloud.support.v2beta.GetCommentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCommentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.GetCommentRequest + * @static + * @param {google.cloud.support.v2beta.GetCommentRequest} message GetCommentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCommentRequest.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 GetCommentRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.GetCommentRequest + * @instance + * @returns {Object.} JSON object + */ + GetCommentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCommentRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.GetCommentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCommentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.GetCommentRequest"; + }; + + return GetCommentRequest; + })(); + + v2beta.TextContent = (function() { + + /** + * Properties of a TextContent. + * @memberof google.cloud.support.v2beta + * @interface ITextContent + * @property {string|null} [plainText] TextContent plainText + */ + + /** + * Constructs a new TextContent. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a TextContent. + * @implements ITextContent + * @constructor + * @param {google.cloud.support.v2beta.ITextContent=} [properties] Properties to set + */ + function TextContent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextContent plainText. + * @member {string} plainText + * @memberof google.cloud.support.v2beta.TextContent + * @instance + */ + TextContent.prototype.plainText = ""; + + /** + * Creates a new TextContent instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.TextContent + * @static + * @param {google.cloud.support.v2beta.ITextContent=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.TextContent} TextContent instance + */ + TextContent.create = function create(properties) { + return new TextContent(properties); + }; + + /** + * Encodes the specified TextContent message. Does not implicitly {@link google.cloud.support.v2beta.TextContent.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.TextContent + * @static + * @param {google.cloud.support.v2beta.ITextContent} message TextContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.plainText != null && Object.hasOwnProperty.call(message, "plainText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.plainText); + return writer; + }; + + /** + * Encodes the specified TextContent message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.TextContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.TextContent + * @static + * @param {google.cloud.support.v2beta.ITextContent} message TextContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextContent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.TextContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.TextContent} TextContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextContent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.TextContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.plainText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.TextContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.TextContent} TextContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextContent message. + * @function verify + * @memberof google.cloud.support.v2beta.TextContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextContent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.plainText != null && message.hasOwnProperty("plainText")) + if (!$util.isString(message.plainText)) + return "plainText: string expected"; + return null; + }; + + /** + * Creates a TextContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.TextContent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.TextContent} TextContent + */ + TextContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.TextContent) + return object; + var message = new $root.google.cloud.support.v2beta.TextContent(); + if (object.plainText != null) + message.plainText = String(object.plainText); + return message; + }; + + /** + * Creates a plain object from a TextContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.TextContent + * @static + * @param {google.cloud.support.v2beta.TextContent} message TextContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.plainText = ""; + if (message.plainText != null && message.hasOwnProperty("plainText")) + object.plainText = message.plainText; + return object; + }; + + /** + * Converts this TextContent to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.TextContent + * @instance + * @returns {Object.} JSON object + */ + TextContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextContent + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.TextContent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.TextContent"; + }; + + return TextContent; + })(); + + v2beta.EmailMessage = (function() { + + /** + * Properties of an EmailMessage. + * @memberof google.cloud.support.v2beta + * @interface IEmailMessage + * @property {string|null} [name] EmailMessage name + * @property {google.protobuf.ITimestamp|null} [createTime] EmailMessage createTime + * @property {google.cloud.support.v2beta.IActor|null} [actor] EmailMessage actor + * @property {string|null} [subject] EmailMessage subject + * @property {Array.|null} [recipientEmailAddresses] EmailMessage recipientEmailAddresses + * @property {Array.|null} [ccEmailAddresses] EmailMessage ccEmailAddresses + * @property {google.cloud.support.v2beta.ITextContent|null} [bodyContent] EmailMessage bodyContent + */ + + /** + * Constructs a new EmailMessage. + * @memberof google.cloud.support.v2beta + * @classdesc Represents an EmailMessage. + * @implements IEmailMessage + * @constructor + * @param {google.cloud.support.v2beta.IEmailMessage=} [properties] Properties to set + */ + function EmailMessage(properties) { + this.recipientEmailAddresses = []; + this.ccEmailAddresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmailMessage name. + * @member {string} name + * @memberof google.cloud.support.v2beta.EmailMessage + * @instance + */ + EmailMessage.prototype.name = ""; + + /** + * EmailMessage createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.support.v2beta.EmailMessage + * @instance + */ + EmailMessage.prototype.createTime = null; + + /** + * EmailMessage actor. + * @member {google.cloud.support.v2beta.IActor|null|undefined} actor + * @memberof google.cloud.support.v2beta.EmailMessage + * @instance + */ + EmailMessage.prototype.actor = null; + + /** + * EmailMessage subject. + * @member {string} subject + * @memberof google.cloud.support.v2beta.EmailMessage + * @instance + */ + EmailMessage.prototype.subject = ""; + + /** + * EmailMessage recipientEmailAddresses. + * @member {Array.} recipientEmailAddresses + * @memberof google.cloud.support.v2beta.EmailMessage + * @instance + */ + EmailMessage.prototype.recipientEmailAddresses = $util.emptyArray; + + /** + * EmailMessage ccEmailAddresses. + * @member {Array.} ccEmailAddresses + * @memberof google.cloud.support.v2beta.EmailMessage + * @instance + */ + EmailMessage.prototype.ccEmailAddresses = $util.emptyArray; + + /** + * EmailMessage bodyContent. + * @member {google.cloud.support.v2beta.ITextContent|null|undefined} bodyContent + * @memberof google.cloud.support.v2beta.EmailMessage + * @instance + */ + EmailMessage.prototype.bodyContent = null; + + /** + * Creates a new EmailMessage instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.EmailMessage + * @static + * @param {google.cloud.support.v2beta.IEmailMessage=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.EmailMessage} EmailMessage instance + */ + EmailMessage.create = function create(properties) { + return new EmailMessage(properties); + }; + + /** + * Encodes the specified EmailMessage message. Does not implicitly {@link google.cloud.support.v2beta.EmailMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.EmailMessage + * @static + * @param {google.cloud.support.v2beta.IEmailMessage} message EmailMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmailMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.actor != null && Object.hasOwnProperty.call(message, "actor")) + $root.google.cloud.support.v2beta.Actor.encode(message.actor, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.subject); + if (message.recipientEmailAddresses != null && message.recipientEmailAddresses.length) + for (var i = 0; i < message.recipientEmailAddresses.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.recipientEmailAddresses[i]); + if (message.ccEmailAddresses != null && message.ccEmailAddresses.length) + for (var i = 0; i < message.ccEmailAddresses.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.ccEmailAddresses[i]); + if (message.bodyContent != null && Object.hasOwnProperty.call(message, "bodyContent")) + $root.google.cloud.support.v2beta.TextContent.encode(message.bodyContent, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EmailMessage message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.EmailMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.EmailMessage + * @static + * @param {google.cloud.support.v2beta.IEmailMessage} message EmailMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmailMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmailMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.EmailMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.EmailMessage} EmailMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmailMessage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.EmailMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.actor = $root.google.cloud.support.v2beta.Actor.decode(reader, reader.uint32()); + break; + } + case 4: { + message.subject = reader.string(); + break; + } + case 5: { + if (!(message.recipientEmailAddresses && message.recipientEmailAddresses.length)) + message.recipientEmailAddresses = []; + message.recipientEmailAddresses.push(reader.string()); + break; + } + case 6: { + if (!(message.ccEmailAddresses && message.ccEmailAddresses.length)) + message.ccEmailAddresses = []; + message.ccEmailAddresses.push(reader.string()); + break; + } + case 8: { + message.bodyContent = $root.google.cloud.support.v2beta.TextContent.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmailMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.EmailMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.EmailMessage} EmailMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmailMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmailMessage message. + * @function verify + * @memberof google.cloud.support.v2beta.EmailMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmailMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: 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.actor != null && message.hasOwnProperty("actor")) { + var error = $root.google.cloud.support.v2beta.Actor.verify(message.actor); + if (error) + return "actor." + error; + } + if (message.subject != null && message.hasOwnProperty("subject")) + if (!$util.isString(message.subject)) + return "subject: string expected"; + if (message.recipientEmailAddresses != null && message.hasOwnProperty("recipientEmailAddresses")) { + if (!Array.isArray(message.recipientEmailAddresses)) + return "recipientEmailAddresses: array expected"; + for (var i = 0; i < message.recipientEmailAddresses.length; ++i) + if (!$util.isString(message.recipientEmailAddresses[i])) + return "recipientEmailAddresses: string[] expected"; + } + if (message.ccEmailAddresses != null && message.hasOwnProperty("ccEmailAddresses")) { + if (!Array.isArray(message.ccEmailAddresses)) + return "ccEmailAddresses: array expected"; + for (var i = 0; i < message.ccEmailAddresses.length; ++i) + if (!$util.isString(message.ccEmailAddresses[i])) + return "ccEmailAddresses: string[] expected"; + } + if (message.bodyContent != null && message.hasOwnProperty("bodyContent")) { + var error = $root.google.cloud.support.v2beta.TextContent.verify(message.bodyContent); + if (error) + return "bodyContent." + error; + } + return null; + }; + + /** + * Creates an EmailMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.EmailMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.EmailMessage} EmailMessage + */ + EmailMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.EmailMessage) + return object; + var message = new $root.google.cloud.support.v2beta.EmailMessage(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.support.v2beta.EmailMessage.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.actor != null) { + if (typeof object.actor !== "object") + throw TypeError(".google.cloud.support.v2beta.EmailMessage.actor: object expected"); + message.actor = $root.google.cloud.support.v2beta.Actor.fromObject(object.actor); + } + if (object.subject != null) + message.subject = String(object.subject); + if (object.recipientEmailAddresses) { + if (!Array.isArray(object.recipientEmailAddresses)) + throw TypeError(".google.cloud.support.v2beta.EmailMessage.recipientEmailAddresses: array expected"); + message.recipientEmailAddresses = []; + for (var i = 0; i < object.recipientEmailAddresses.length; ++i) + message.recipientEmailAddresses[i] = String(object.recipientEmailAddresses[i]); + } + if (object.ccEmailAddresses) { + if (!Array.isArray(object.ccEmailAddresses)) + throw TypeError(".google.cloud.support.v2beta.EmailMessage.ccEmailAddresses: array expected"); + message.ccEmailAddresses = []; + for (var i = 0; i < object.ccEmailAddresses.length; ++i) + message.ccEmailAddresses[i] = String(object.ccEmailAddresses[i]); + } + if (object.bodyContent != null) { + if (typeof object.bodyContent !== "object") + throw TypeError(".google.cloud.support.v2beta.EmailMessage.bodyContent: object expected"); + message.bodyContent = $root.google.cloud.support.v2beta.TextContent.fromObject(object.bodyContent); + } + return message; + }; + + /** + * Creates a plain object from an EmailMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.EmailMessage + * @static + * @param {google.cloud.support.v2beta.EmailMessage} message EmailMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmailMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.recipientEmailAddresses = []; + object.ccEmailAddresses = []; + } + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.actor = null; + object.subject = ""; + object.bodyContent = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.actor != null && message.hasOwnProperty("actor")) + object.actor = $root.google.cloud.support.v2beta.Actor.toObject(message.actor, options); + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = message.subject; + if (message.recipientEmailAddresses && message.recipientEmailAddresses.length) { + object.recipientEmailAddresses = []; + for (var j = 0; j < message.recipientEmailAddresses.length; ++j) + object.recipientEmailAddresses[j] = message.recipientEmailAddresses[j]; + } + if (message.ccEmailAddresses && message.ccEmailAddresses.length) { + object.ccEmailAddresses = []; + for (var j = 0; j < message.ccEmailAddresses.length; ++j) + object.ccEmailAddresses[j] = message.ccEmailAddresses[j]; + } + if (message.bodyContent != null && message.hasOwnProperty("bodyContent")) + object.bodyContent = $root.google.cloud.support.v2beta.TextContent.toObject(message.bodyContent, options); + return object; + }; + + /** + * Converts this EmailMessage to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.EmailMessage + * @instance + * @returns {Object.} JSON object + */ + EmailMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmailMessage + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.EmailMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmailMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.EmailMessage"; + }; + + return EmailMessage; + })(); + + v2beta.FeedItem = (function() { + + /** + * Properties of a FeedItem. + * @memberof google.cloud.support.v2beta + * @interface IFeedItem + * @property {google.cloud.support.v2beta.IComment|null} [comment] FeedItem comment + * @property {google.cloud.support.v2beta.IAttachment|null} [attachment] FeedItem attachment + * @property {google.cloud.support.v2beta.IEmailMessage|null} [emailMessage] FeedItem emailMessage + * @property {google.cloud.support.v2beta.IAttachment|null} [deletedAttachment] FeedItem deletedAttachment + * @property {google.protobuf.ITimestamp|null} [eventTime] FeedItem eventTime + */ + + /** + * Constructs a new FeedItem. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a FeedItem. + * @implements IFeedItem + * @constructor + * @param {google.cloud.support.v2beta.IFeedItem=} [properties] Properties to set + */ + function FeedItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeedItem comment. + * @member {google.cloud.support.v2beta.IComment|null|undefined} comment + * @memberof google.cloud.support.v2beta.FeedItem + * @instance + */ + FeedItem.prototype.comment = null; + + /** + * FeedItem attachment. + * @member {google.cloud.support.v2beta.IAttachment|null|undefined} attachment + * @memberof google.cloud.support.v2beta.FeedItem + * @instance + */ + FeedItem.prototype.attachment = null; + + /** + * FeedItem emailMessage. + * @member {google.cloud.support.v2beta.IEmailMessage|null|undefined} emailMessage + * @memberof google.cloud.support.v2beta.FeedItem + * @instance + */ + FeedItem.prototype.emailMessage = null; + + /** + * FeedItem deletedAttachment. + * @member {google.cloud.support.v2beta.IAttachment|null|undefined} deletedAttachment + * @memberof google.cloud.support.v2beta.FeedItem + * @instance + */ + FeedItem.prototype.deletedAttachment = null; + + /** + * FeedItem eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.support.v2beta.FeedItem + * @instance + */ + FeedItem.prototype.eventTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FeedItem eventObject. + * @member {"comment"|"attachment"|"emailMessage"|"deletedAttachment"|undefined} eventObject + * @memberof google.cloud.support.v2beta.FeedItem + * @instance + */ + Object.defineProperty(FeedItem.prototype, "eventObject", { + get: $util.oneOfGetter($oneOfFields = ["comment", "attachment", "emailMessage", "deletedAttachment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FeedItem instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.FeedItem + * @static + * @param {google.cloud.support.v2beta.IFeedItem=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.FeedItem} FeedItem instance + */ + FeedItem.create = function create(properties) { + return new FeedItem(properties); + }; + + /** + * Encodes the specified FeedItem message. Does not implicitly {@link google.cloud.support.v2beta.FeedItem.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.FeedItem + * @static + * @param {google.cloud.support.v2beta.IFeedItem} message FeedItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeedItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) + $root.google.cloud.support.v2beta.Comment.encode(message.comment, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.attachment != null && Object.hasOwnProperty.call(message, "attachment")) + $root.google.cloud.support.v2beta.Attachment.encode(message.attachment, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.emailMessage != null && Object.hasOwnProperty.call(message, "emailMessage")) + $root.google.cloud.support.v2beta.EmailMessage.encode(message.emailMessage, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + if (message.deletedAttachment != null && Object.hasOwnProperty.call(message, "deletedAttachment")) + $root.google.cloud.support.v2beta.Attachment.encode(message.deletedAttachment, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeedItem message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.FeedItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.FeedItem + * @static + * @param {google.cloud.support.v2beta.IFeedItem} message FeedItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeedItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeedItem message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.FeedItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.FeedItem} FeedItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeedItem.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.FeedItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 100: { + message.comment = $root.google.cloud.support.v2beta.Comment.decode(reader, reader.uint32()); + break; + } + case 101: { + message.attachment = $root.google.cloud.support.v2beta.Attachment.decode(reader, reader.uint32()); + break; + } + case 102: { + message.emailMessage = $root.google.cloud.support.v2beta.EmailMessage.decode(reader, reader.uint32()); + break; + } + case 103: { + message.deletedAttachment = $root.google.cloud.support.v2beta.Attachment.decode(reader, reader.uint32()); + break; + } + case 1: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeedItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.FeedItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.FeedItem} FeedItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeedItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeedItem message. + * @function verify + * @memberof google.cloud.support.v2beta.FeedItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeedItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.comment != null && message.hasOwnProperty("comment")) { + properties.eventObject = 1; + { + var error = $root.google.cloud.support.v2beta.Comment.verify(message.comment); + if (error) + return "comment." + error; + } + } + if (message.attachment != null && message.hasOwnProperty("attachment")) { + if (properties.eventObject === 1) + return "eventObject: multiple values"; + properties.eventObject = 1; + { + var error = $root.google.cloud.support.v2beta.Attachment.verify(message.attachment); + if (error) + return "attachment." + error; + } + } + if (message.emailMessage != null && message.hasOwnProperty("emailMessage")) { + if (properties.eventObject === 1) + return "eventObject: multiple values"; + properties.eventObject = 1; + { + var error = $root.google.cloud.support.v2beta.EmailMessage.verify(message.emailMessage); + if (error) + return "emailMessage." + error; + } + } + if (message.deletedAttachment != null && message.hasOwnProperty("deletedAttachment")) { + if (properties.eventObject === 1) + return "eventObject: multiple values"; + properties.eventObject = 1; + { + var error = $root.google.cloud.support.v2beta.Attachment.verify(message.deletedAttachment); + if (error) + return "deletedAttachment." + 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 FeedItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.FeedItem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.FeedItem} FeedItem + */ + FeedItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.FeedItem) + return object; + var message = new $root.google.cloud.support.v2beta.FeedItem(); + if (object.comment != null) { + if (typeof object.comment !== "object") + throw TypeError(".google.cloud.support.v2beta.FeedItem.comment: object expected"); + message.comment = $root.google.cloud.support.v2beta.Comment.fromObject(object.comment); + } + if (object.attachment != null) { + if (typeof object.attachment !== "object") + throw TypeError(".google.cloud.support.v2beta.FeedItem.attachment: object expected"); + message.attachment = $root.google.cloud.support.v2beta.Attachment.fromObject(object.attachment); + } + if (object.emailMessage != null) { + if (typeof object.emailMessage !== "object") + throw TypeError(".google.cloud.support.v2beta.FeedItem.emailMessage: object expected"); + message.emailMessage = $root.google.cloud.support.v2beta.EmailMessage.fromObject(object.emailMessage); + } + if (object.deletedAttachment != null) { + if (typeof object.deletedAttachment !== "object") + throw TypeError(".google.cloud.support.v2beta.FeedItem.deletedAttachment: object expected"); + message.deletedAttachment = $root.google.cloud.support.v2beta.Attachment.fromObject(object.deletedAttachment); + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.support.v2beta.FeedItem.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + return message; + }; + + /** + * Creates a plain object from a FeedItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.FeedItem + * @static + * @param {google.cloud.support.v2beta.FeedItem} message FeedItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeedItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.eventTime = null; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.comment != null && message.hasOwnProperty("comment")) { + object.comment = $root.google.cloud.support.v2beta.Comment.toObject(message.comment, options); + if (options.oneofs) + object.eventObject = "comment"; + } + if (message.attachment != null && message.hasOwnProperty("attachment")) { + object.attachment = $root.google.cloud.support.v2beta.Attachment.toObject(message.attachment, options); + if (options.oneofs) + object.eventObject = "attachment"; + } + if (message.emailMessage != null && message.hasOwnProperty("emailMessage")) { + object.emailMessage = $root.google.cloud.support.v2beta.EmailMessage.toObject(message.emailMessage, options); + if (options.oneofs) + object.eventObject = "emailMessage"; + } + if (message.deletedAttachment != null && message.hasOwnProperty("deletedAttachment")) { + object.deletedAttachment = $root.google.cloud.support.v2beta.Attachment.toObject(message.deletedAttachment, options); + if (options.oneofs) + object.eventObject = "deletedAttachment"; + } + return object; + }; + + /** + * Converts this FeedItem to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.FeedItem + * @instance + * @returns {Object.} JSON object + */ + FeedItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeedItem + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.FeedItem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeedItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.FeedItem"; + }; + + return FeedItem; + })(); + + v2beta.FeedService = (function() { + + /** + * Constructs a new FeedService service. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a FeedService + * @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 FeedService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (FeedService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = FeedService; + + /** + * Creates new FeedService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.support.v2beta.FeedService + * @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 {FeedService} RPC service. Useful where requests and/or responses are streamed. + */ + FeedService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.support.v2beta.FeedService|showFeed}. + * @memberof google.cloud.support.v2beta.FeedService + * @typedef ShowFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2beta.ShowFeedResponse} [response] ShowFeedResponse + */ + + /** + * Calls ShowFeed. + * @function showFeed + * @memberof google.cloud.support.v2beta.FeedService + * @instance + * @param {google.cloud.support.v2beta.IShowFeedRequest} request ShowFeedRequest message or plain object + * @param {google.cloud.support.v2beta.FeedService.ShowFeedCallback} callback Node-style callback called with the error, if any, and ShowFeedResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FeedService.prototype.showFeed = function showFeed(request, callback) { + return this.rpcCall(showFeed, $root.google.cloud.support.v2beta.ShowFeedRequest, $root.google.cloud.support.v2beta.ShowFeedResponse, request, callback); + }, "name", { value: "ShowFeed" }); + + /** + * Calls ShowFeed. + * @function showFeed + * @memberof google.cloud.support.v2beta.FeedService + * @instance + * @param {google.cloud.support.v2beta.IShowFeedRequest} request ShowFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return FeedService; + })(); + + v2beta.ShowFeedRequest = (function() { + + /** + * Properties of a ShowFeedRequest. + * @memberof google.cloud.support.v2beta + * @interface IShowFeedRequest + * @property {string|null} [parent] ShowFeedRequest parent + * @property {string|null} [orderBy] ShowFeedRequest orderBy + * @property {number|null} [pageSize] ShowFeedRequest pageSize + * @property {string|null} [pageToken] ShowFeedRequest pageToken + */ + + /** + * Constructs a new ShowFeedRequest. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a ShowFeedRequest. + * @implements IShowFeedRequest + * @constructor + * @param {google.cloud.support.v2beta.IShowFeedRequest=} [properties] Properties to set + */ + function ShowFeedRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShowFeedRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @instance + */ + ShowFeedRequest.prototype.parent = ""; + + /** + * ShowFeedRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @instance + */ + ShowFeedRequest.prototype.orderBy = ""; + + /** + * ShowFeedRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @instance + */ + ShowFeedRequest.prototype.pageSize = 0; + + /** + * ShowFeedRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @instance + */ + ShowFeedRequest.prototype.pageToken = ""; + + /** + * Creates a new ShowFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @static + * @param {google.cloud.support.v2beta.IShowFeedRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.ShowFeedRequest} ShowFeedRequest instance + */ + ShowFeedRequest.create = function create(properties) { + return new ShowFeedRequest(properties); + }; + + /** + * Encodes the specified ShowFeedRequest message. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @static + * @param {google.cloud.support.v2beta.IShowFeedRequest} message ShowFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShowFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.orderBy); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ShowFeedRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @static + * @param {google.cloud.support.v2beta.IShowFeedRequest} message ShowFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShowFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShowFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.ShowFeedRequest} ShowFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShowFeedRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ShowFeedRequest(); + 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.orderBy = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShowFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.ShowFeedRequest} ShowFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShowFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShowFeedRequest message. + * @function verify + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShowFeedRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: 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 ShowFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.ShowFeedRequest} ShowFeedRequest + */ + ShowFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.ShowFeedRequest) + return object; + var message = new $root.google.cloud.support.v2beta.ShowFeedRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + 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 ShowFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @static + * @param {google.cloud.support.v2beta.ShowFeedRequest} message ShowFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShowFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.orderBy = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ShowFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @instance + * @returns {Object.} JSON object + */ + ShowFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShowFeedRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.ShowFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShowFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.ShowFeedRequest"; + }; + + return ShowFeedRequest; + })(); + + v2beta.ShowFeedResponse = (function() { + + /** + * Properties of a ShowFeedResponse. + * @memberof google.cloud.support.v2beta + * @interface IShowFeedResponse + * @property {Array.|null} [feedItems] ShowFeedResponse feedItems + * @property {string|null} [nextPageToken] ShowFeedResponse nextPageToken + */ + + /** + * Constructs a new ShowFeedResponse. + * @memberof google.cloud.support.v2beta + * @classdesc Represents a ShowFeedResponse. + * @implements IShowFeedResponse + * @constructor + * @param {google.cloud.support.v2beta.IShowFeedResponse=} [properties] Properties to set + */ + function ShowFeedResponse(properties) { + this.feedItems = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShowFeedResponse feedItems. + * @member {Array.} feedItems + * @memberof google.cloud.support.v2beta.ShowFeedResponse + * @instance + */ + ShowFeedResponse.prototype.feedItems = $util.emptyArray; + + /** + * ShowFeedResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2beta.ShowFeedResponse + * @instance + */ + ShowFeedResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ShowFeedResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2beta.ShowFeedResponse + * @static + * @param {google.cloud.support.v2beta.IShowFeedResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2beta.ShowFeedResponse} ShowFeedResponse instance + */ + ShowFeedResponse.create = function create(properties) { + return new ShowFeedResponse(properties); + }; + + /** + * Encodes the specified ShowFeedResponse message. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2beta.ShowFeedResponse + * @static + * @param {google.cloud.support.v2beta.IShowFeedResponse} message ShowFeedResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShowFeedResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feedItems != null && message.feedItems.length) + for (var i = 0; i < message.feedItems.length; ++i) + $root.google.cloud.support.v2beta.FeedItem.encode(message.feedItems[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 ShowFeedResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2beta.ShowFeedResponse + * @static + * @param {google.cloud.support.v2beta.IShowFeedResponse} message ShowFeedResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShowFeedResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShowFeedResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2beta.ShowFeedResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2beta.ShowFeedResponse} ShowFeedResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShowFeedResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ShowFeedResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.feedItems && message.feedItems.length)) + message.feedItems = []; + message.feedItems.push($root.google.cloud.support.v2beta.FeedItem.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShowFeedResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2beta.ShowFeedResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2beta.ShowFeedResponse} ShowFeedResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShowFeedResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShowFeedResponse message. + * @function verify + * @memberof google.cloud.support.v2beta.ShowFeedResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShowFeedResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.feedItems != null && message.hasOwnProperty("feedItems")) { + if (!Array.isArray(message.feedItems)) + return "feedItems: array expected"; + for (var i = 0; i < message.feedItems.length; ++i) { + var error = $root.google.cloud.support.v2beta.FeedItem.verify(message.feedItems[i]); + if (error) + return "feedItems." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ShowFeedResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2beta.ShowFeedResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2beta.ShowFeedResponse} ShowFeedResponse + */ + ShowFeedResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2beta.ShowFeedResponse) + return object; + var message = new $root.google.cloud.support.v2beta.ShowFeedResponse(); + if (object.feedItems) { + if (!Array.isArray(object.feedItems)) + throw TypeError(".google.cloud.support.v2beta.ShowFeedResponse.feedItems: array expected"); + message.feedItems = []; + for (var i = 0; i < object.feedItems.length; ++i) { + if (typeof object.feedItems[i] !== "object") + throw TypeError(".google.cloud.support.v2beta.ShowFeedResponse.feedItems: object expected"); + message.feedItems[i] = $root.google.cloud.support.v2beta.FeedItem.fromObject(object.feedItems[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ShowFeedResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2beta.ShowFeedResponse + * @static + * @param {google.cloud.support.v2beta.ShowFeedResponse} message ShowFeedResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShowFeedResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.feedItems = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.feedItems && message.feedItems.length) { + object.feedItems = []; + for (var j = 0; j < message.feedItems.length; ++j) + object.feedItems[j] = $root.google.cloud.support.v2beta.FeedItem.toObject(message.feedItems[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ShowFeedResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2beta.ShowFeedResponse + * @instance + * @returns {Object.} JSON object + */ + ShowFeedResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShowFeedResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2beta.ShowFeedResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShowFeedResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2beta.ShowFeedResponse"; + }; + + return ShowFeedResponse; + })(); + + return v2beta; + })(); + + return support; + })(); + + 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 + */ + + /** + * 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; + + /** + * 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.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; + } + 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"; + } + 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]); + } + 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.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.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.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.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.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; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-support/protos/protos.json b/owl-bot-staging/google-cloud-support/protos/protos.json new file mode 100644 index 00000000000..461f1eefc45 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/protos/protos.json @@ -0,0 +1,3752 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "support": { + "nested": { + "v2": { + "options": { + "csharp_namespace": "Google.Cloud.Support.V2", + "go_package": "cloud.google.com/go/support/apiv2/supportpb;supportpb", + "java_multiple_files": true, + "java_outer_classname": "CommentServiceProto", + "java_package": "com.google.cloud.support.v2", + "php_namespace": "Google\\Cloud\\Support\\V2", + "ruby_package": "Google::Cloud::Support::V2" + }, + "nested": { + "Actor": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "email": { + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "googleSupport": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "username": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Attachment": { + "options": { + "(google.api.resource).type": "cloudsupport.googleapis.com/Attachment", + "(google.api.resource).pattern": "projects/{project}/cases/{case}/attachments/{attachment_id}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "Actor", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "filename": { + "type": "string", + "id": 4 + }, + "mimeType": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sizeBytes": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CaseAttachmentService": { + "options": { + "(google.api.default_host)": "cloudsupport.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListAttachments": { + "requestType": "ListAttachmentsRequest", + "responseType": "ListAttachmentsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/cases/*}/attachments", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/cases/*}/attachments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/cases/*}/attachments", + "additional_bindings": { + "get": "/v2/{parent=organizations/*/cases/*}/attachments" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "ListAttachmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListAttachmentsResponse": { + "fields": { + "attachments": { + "rule": "repeated", + "type": "Attachment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Case": { + "options": { + "(google.api.resource).type": "cloudsupport.googleapis.com/Case", + "(google.api.resource).pattern": "projects/{project}/cases/{case}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "classification": { + "type": "CaseClassification", + "id": 4 + }, + "timeZone": { + "type": "string", + "id": 8 + }, + "subscriberEmailAddresses": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "state": { + "type": "State", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "Actor", + "id": 15 + }, + "contactEmail": { + "type": "string", + "id": 35 + }, + "escalated": { + "type": "bool", + "id": 17 + }, + "testCase": { + "type": "bool", + "id": 19 + }, + "languageCode": { + "type": "string", + "id": 23 + }, + "priority": { + "type": "Priority", + "id": 32 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "NEW": 1, + "IN_PROGRESS_GOOGLE_SUPPORT": 2, + "ACTION_REQUIRED": 3, + "SOLUTION_PROVIDED": 4, + "CLOSED": 5 + } + }, + "Priority": { + "values": { + "PRIORITY_UNSPECIFIED": 0, + "P0": 1, + "P1": 2, + "P2": 3, + "P3": 4, + "P4": 5 + } + } + } + }, + "CaseClassification": { + "fields": { + "id": { + "type": "string", + "id": 3 + }, + "displayName": { + "type": "string", + "id": 4 + } + } + }, + "CaseService": { + "options": { + "(google.api.default_host)": "cloudsupport.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetCase": { + "requestType": "GetCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/cases/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*/cases/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/cases/*}", + "additional_bindings": { + "get": "/v2/{name=organizations/*/cases/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCases": { + "requestType": "ListCasesRequest", + "responseType": "ListCasesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/cases", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*}/cases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/cases", + "additional_bindings": { + "get": "/v2/{parent=organizations/*}/cases" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SearchCases": { + "requestType": "SearchCasesRequest", + "responseType": "SearchCasesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/cases:search", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*}/cases:search" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/cases:search", + "additional_bindings": { + "get": "/v2/{parent=organizations/*}/cases:search" + } + } + } + ] + }, + "CreateCase": { + "requestType": "CreateCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/cases", + "(google.api.http).body": "case", + "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*}/cases", + "(google.api.http).additional_bindings.body": "case", + "(google.api.method_signature)": "parent,case" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/cases", + "body": "case", + "additional_bindings": { + "post": "/v2/{parent=organizations/*}/cases", + "body": "case" + } + } + }, + { + "(google.api.method_signature)": "parent,case" + } + ] + }, + "UpdateCase": { + "requestType": "UpdateCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).patch": "/v2/{case.name=projects/*/cases/*}", + "(google.api.http).body": "case", + "(google.api.http).additional_bindings.patch": "/v2/{case.name=organizations/*/cases/*}", + "(google.api.http).additional_bindings.body": "case", + "(google.api.method_signature)": "case,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{case.name=projects/*/cases/*}", + "body": "case", + "additional_bindings": { + "patch": "/v2/{case.name=organizations/*/cases/*}", + "body": "case" + } + } + }, + { + "(google.api.method_signature)": "case,update_mask" + } + ] + }, + "EscalateCase": { + "requestType": "EscalateCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/cases/*}:escalate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{name=organizations/*/cases/*}:escalate", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/cases/*}:escalate", + "body": "*", + "additional_bindings": { + "post": "/v2/{name=organizations/*/cases/*}:escalate", + "body": "*" + } + } + } + ] + }, + "CloseCase": { + "requestType": "CloseCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/cases/*}:close", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{name=organizations/*/cases/*}:close", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/cases/*}:close", + "body": "*", + "additional_bindings": { + "post": "/v2/{name=organizations/*/cases/*}:close", + "body": "*" + } + } + } + ] + }, + "SearchCaseClassifications": { + "requestType": "SearchCaseClassificationsRequest", + "responseType": "SearchCaseClassificationsResponse", + "options": { + "(google.api.http).get": "/v2/caseClassifications:search" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/caseClassifications:search" + } + } + ] + } + } + }, + "GetCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + } + } + }, + "CreateCaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudsupport.googleapis.com/Case" + } + }, + "case": { + "type": "Case", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListCasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudsupport.googleapis.com/Case" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "ListCasesResponse": { + "fields": { + "cases": { + "rule": "repeated", + "type": "Case", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchCasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 4 + }, + "query": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "SearchCasesResponse": { + "fields": { + "cases": { + "rule": "repeated", + "type": "Case", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "EscalateCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "escalation": { + "type": "Escalation", + "id": 2 + } + } + }, + "UpdateCaseRequest": { + "fields": { + "case": { + "type": "Case", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "CloseCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + } + } + }, + "SearchCaseClassificationsRequest": { + "fields": { + "query": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "SearchCaseClassificationsResponse": { + "fields": { + "caseClassifications": { + "rule": "repeated", + "type": "CaseClassification", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Escalation": { + "fields": { + "reason": { + "type": "Reason", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "justification": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Reason": { + "values": { + "REASON_UNSPECIFIED": 0, + "RESOLUTION_TIME": 1, + "TECHNICAL_EXPERTISE": 2, + "BUSINESS_IMPACT": 3 + } + } + } + }, + "Comment": { + "options": { + "(google.api.resource).type": "cloudsupport.googleapis.com/Comment", + "(google.api.resource).pattern": "projects/{project}/cases/{case}/comments/{comment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "Actor", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "body": { + "type": "string", + "id": 4 + }, + "plainTextBody": { + "type": "string", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CommentService": { + "options": { + "(google.api.default_host)": "cloudsupport.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListComments": { + "requestType": "ListCommentsRequest", + "responseType": "ListCommentsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/cases/*}/comments", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/cases/*}/comments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/cases/*}/comments", + "additional_bindings": { + "get": "/v2/{parent=organizations/*/cases/*}/comments" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateComment": { + "requestType": "CreateCommentRequest", + "responseType": "Comment", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/cases/*}/comments", + "(google.api.http).body": "comment", + "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*/cases/*}/comments", + "(google.api.http).additional_bindings.body": "comment", + "(google.api.method_signature)": "parent,comment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/cases/*}/comments", + "body": "comment", + "additional_bindings": { + "post": "/v2/{parent=organizations/*/cases/*}/comments", + "body": "comment" + } + } + }, + { + "(google.api.method_signature)": "parent,comment" + } + ] + } + } + }, + "ListCommentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "ListCommentsResponse": { + "fields": { + "comments": { + "rule": "repeated", + "type": "Comment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateCommentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "comment": { + "type": "Comment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "v2beta": { + "options": { + "csharp_namespace": "Google.Cloud.Support.V2Beta", + "go_package": "cloud.google.com/go/support/apiv2beta/supportpb;supportpb", + "java_multiple_files": true, + "java_outer_classname": "FeedServiceProto", + "java_package": "com.google.cloud.support.v2beta", + "php_namespace": "Google\\Cloud\\Support\\V2beta", + "ruby_package": "Google::Cloud::Support::V2beta" + }, + "nested": { + "Actor": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "email": { + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "googleSupport": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "username": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Attachment": { + "options": { + "(google.api.resource).type": "cloudsupport.googleapis.com/Attachment", + "(google.api.resource).pattern": "projects/{project}/cases/{case}/attachments/{attachment_id}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "Actor", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "filename": { + "type": "string", + "id": 4 + }, + "mimeType": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sizeBytes": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CaseAttachmentService": { + "options": { + "(google.api.default_host)": "cloudsupport.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListAttachments": { + "requestType": "ListAttachmentsRequest", + "responseType": "ListAttachmentsResponse", + "options": { + "(google.api.http).get": "/v2beta/{parent=projects/*/cases/*}/attachments", + "(google.api.http).additional_bindings.get": "/v2beta/{parent=organizations/*/cases/*}/attachments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{parent=projects/*/cases/*}/attachments", + "additional_bindings": { + "get": "/v2beta/{parent=organizations/*/cases/*}/attachments" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAttachment": { + "requestType": "GetAttachmentRequest", + "responseType": "Attachment", + "options": { + "(google.api.http).get": "/v2beta/{name=*/*/cases/*/attachments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{name=*/*/cases/*/attachments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListAttachmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "GetAttachmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Attachment" + } + } + } + }, + "ListAttachmentsResponse": { + "fields": { + "attachments": { + "rule": "repeated", + "type": "Attachment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ProductLine": { + "values": { + "PRODUCT_LINE_UNSPECIFIED": 0, + "GOOGLE_CLOUD": 1, + "GOOGLE_MAPS": 2 + } + }, + "Case": { + "options": { + "(google.api.resource).type": "cloudsupport.googleapis.com/Case", + "(google.api.resource).pattern": "projects/{project}/cases/{case}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "classification": { + "type": "CaseClassification", + "id": 4 + }, + "timeZone": { + "type": "string", + "id": 8 + }, + "subscriberEmailAddresses": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "state": { + "type": "State", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "Actor", + "id": 15 + }, + "contactEmail": { + "type": "string", + "id": 35 + }, + "escalated": { + "type": "bool", + "id": 17 + }, + "testCase": { + "type": "bool", + "id": 19 + }, + "languageCode": { + "type": "string", + "id": 23 + }, + "priority": { + "type": "Priority", + "id": 32 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "NEW": 1, + "IN_PROGRESS_GOOGLE_SUPPORT": 2, + "ACTION_REQUIRED": 3, + "SOLUTION_PROVIDED": 4, + "CLOSED": 5 + } + }, + "Priority": { + "values": { + "PRIORITY_UNSPECIFIED": 0, + "P0": 1, + "P1": 2, + "P2": 3, + "P3": 4, + "P4": 5 + } + } + } + }, + "CaseClassification": { + "fields": { + "id": { + "type": "string", + "id": 3 + }, + "displayName": { + "type": "string", + "id": 4 + }, + "product": { + "type": "Product", + "id": 10 + } + } + }, + "Product": { + "fields": { + "productLine": { + "type": "ProductLine", + "id": 1 + } + } + }, + "CaseService": { + "options": { + "(google.api.default_host)": "cloudsupport.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetCase": { + "requestType": "GetCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).get": "/v2beta/{name=projects/*/cases/*}", + "(google.api.http).additional_bindings.get": "/v2beta/{name=organizations/*/cases/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{name=projects/*/cases/*}", + "additional_bindings": { + "get": "/v2beta/{name=organizations/*/cases/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCases": { + "requestType": "ListCasesRequest", + "responseType": "ListCasesResponse", + "options": { + "(google.api.http).get": "/v2beta/{parent=projects/*}/cases", + "(google.api.http).additional_bindings.get": "/v2beta/{parent=organizations/*}/cases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{parent=projects/*}/cases", + "additional_bindings": { + "get": "/v2beta/{parent=organizations/*}/cases" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SearchCases": { + "requestType": "SearchCasesRequest", + "responseType": "SearchCasesResponse", + "options": { + "(google.api.http).get": "/v2beta/{parent=projects/*}/cases:search", + "(google.api.http).additional_bindings.get": "/v2beta/{parent=organizations/*}/cases:search" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{parent=projects/*}/cases:search", + "additional_bindings": { + "get": "/v2beta/{parent=organizations/*}/cases:search" + } + } + } + ] + }, + "CreateCase": { + "requestType": "CreateCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).post": "/v2beta/{parent=projects/*}/cases", + "(google.api.http).body": "case", + "(google.api.http).additional_bindings.post": "/v2beta/{parent=organizations/*}/cases", + "(google.api.http).additional_bindings.body": "case", + "(google.api.method_signature)": "parent,case" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{parent=projects/*}/cases", + "body": "case", + "additional_bindings": { + "post": "/v2beta/{parent=organizations/*}/cases", + "body": "case" + } + } + }, + { + "(google.api.method_signature)": "parent,case" + } + ] + }, + "UpdateCase": { + "requestType": "UpdateCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).patch": "/v2beta/{case.name=projects/*/cases/*}", + "(google.api.http).body": "case", + "(google.api.http).additional_bindings.patch": "/v2beta/{case.name=organizations/*/cases/*}", + "(google.api.http).additional_bindings.body": "case", + "(google.api.method_signature)": "case,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2beta/{case.name=projects/*/cases/*}", + "body": "case", + "additional_bindings": { + "patch": "/v2beta/{case.name=organizations/*/cases/*}", + "body": "case" + } + } + }, + { + "(google.api.method_signature)": "case,update_mask" + } + ] + }, + "EscalateCase": { + "requestType": "EscalateCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).post": "/v2beta/{name=projects/*/cases/*}:escalate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta/{name=organizations/*/cases/*}:escalate", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{name=projects/*/cases/*}:escalate", + "body": "*", + "additional_bindings": { + "post": "/v2beta/{name=organizations/*/cases/*}:escalate", + "body": "*" + } + } + } + ] + }, + "CloseCase": { + "requestType": "CloseCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).post": "/v2beta/{name=projects/*/cases/*}:close", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta/{name=organizations/*/cases/*}:close", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{name=projects/*/cases/*}:close", + "body": "*", + "additional_bindings": { + "post": "/v2beta/{name=organizations/*/cases/*}:close", + "body": "*" + } + } + } + ] + }, + "SearchCaseClassifications": { + "requestType": "SearchCaseClassificationsRequest", + "responseType": "SearchCaseClassificationsResponse", + "options": { + "(google.api.http).get": "/v2beta/caseClassifications:search" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/caseClassifications:search" + } + } + ] + } + } + }, + "GetCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + } + } + }, + "CreateCaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudsupport.googleapis.com/Case" + } + }, + "case": { + "type": "Case", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListCasesRequest": { + "oneofs": { + "_productLine": { + "oneof": [ + "productLine" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudsupport.googleapis.com/Case" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + }, + "productLine": { + "type": "ProductLine", + "id": 8, + "options": { + "proto3_optional": true + } + } + } + }, + "ListCasesResponse": { + "fields": { + "cases": { + "rule": "repeated", + "type": "Case", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchCasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 4 + }, + "query": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "SearchCasesResponse": { + "fields": { + "cases": { + "rule": "repeated", + "type": "Case", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "EscalateCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "escalation": { + "type": "Escalation", + "id": 2 + } + } + }, + "UpdateCaseRequest": { + "fields": { + "case": { + "type": "Case", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "CloseCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + } + } + }, + "SearchCaseClassificationsRequest": { + "fields": { + "query": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "product": { + "type": "Product", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchCaseClassificationsResponse": { + "fields": { + "caseClassifications": { + "rule": "repeated", + "type": "CaseClassification", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Escalation": { + "fields": { + "reason": { + "type": "Reason", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "justification": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Reason": { + "values": { + "REASON_UNSPECIFIED": 0, + "RESOLUTION_TIME": 1, + "TECHNICAL_EXPERTISE": 2, + "BUSINESS_IMPACT": 3 + } + } + } + }, + "Comment": { + "options": { + "(google.api.resource).type": "cloudsupport.googleapis.com/Comment", + "(google.api.resource).pattern": "projects/{project}/cases/{case}/comments/{comment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "Actor", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "body": { + "type": "string", + "id": 4 + }, + "plainTextBody": { + "type": "string", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CommentService": { + "options": { + "(google.api.default_host)": "cloudsupport.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListComments": { + "requestType": "ListCommentsRequest", + "responseType": "ListCommentsResponse", + "options": { + "(google.api.http).get": "/v2beta/{parent=projects/*/cases/*}/comments", + "(google.api.http).additional_bindings.get": "/v2beta/{parent=organizations/*/cases/*}/comments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{parent=projects/*/cases/*}/comments", + "additional_bindings": { + "get": "/v2beta/{parent=organizations/*/cases/*}/comments" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateComment": { + "requestType": "CreateCommentRequest", + "responseType": "Comment", + "options": { + "(google.api.http).post": "/v2beta/{parent=projects/*/cases/*}/comments", + "(google.api.http).body": "comment", + "(google.api.http).additional_bindings.post": "/v2beta/{parent=organizations/*/cases/*}/comments", + "(google.api.http).additional_bindings.body": "comment", + "(google.api.method_signature)": "parent,comment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{parent=projects/*/cases/*}/comments", + "body": "comment", + "additional_bindings": { + "post": "/v2beta/{parent=organizations/*/cases/*}/comments", + "body": "comment" + } + } + }, + { + "(google.api.method_signature)": "parent,comment" + } + ] + }, + "GetComment": { + "requestType": "GetCommentRequest", + "responseType": "Comment", + "options": { + "(google.api.http).get": "/v2beta/{name=*/*/cases/*/comments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{name=*/*/cases/*/comments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListCommentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "ListCommentsResponse": { + "fields": { + "comments": { + "rule": "repeated", + "type": "Comment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateCommentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "comment": { + "type": "Comment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetCommentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Comment" + } + } + } + }, + "TextContent": { + "fields": { + "plainText": { + "type": "string", + "id": 1 + } + } + }, + "EmailMessage": { + "options": { + "(google.api.resource).type": "cloudsupport.googleapis.com/EmailMessage", + "(google.api.resource).pattern": "organizations/{organization}/cases/{case}/emailMessages/{email_message}", + "(google.api.resource).plural": "emailMessages", + "(google.api.resource).singular": "emailMessage" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "actor": { + "type": "Actor", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "subject": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "recipientEmailAddresses": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ccEmailAddresses": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "bodyContent": { + "type": "TextContent", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "FeedItem": { + "oneofs": { + "eventObject": { + "oneof": [ + "comment", + "attachment", + "emailMessage", + "deletedAttachment" + ] + } + }, + "fields": { + "comment": { + "type": "Comment", + "id": 100, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attachment": { + "type": "Attachment", + "id": 101, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "emailMessage": { + "type": "EmailMessage", + "id": 102, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deletedAttachment": { + "type": "Attachment", + "id": 103, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "FeedService": { + "options": { + "(google.api.default_host)": "cloudsupport.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ShowFeed": { + "requestType": "ShowFeedRequest", + "responseType": "ShowFeedResponse", + "options": { + "(google.api.http).get": "/v2beta/{parent=projects/*/cases/*}:showFeed", + "(google.api.http).additional_bindings.get": "/v2beta/{parent=organizations/*/cases/*}:showFeed", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{parent=projects/*/cases/*}:showFeed", + "additional_bindings": { + "get": "/v2beta/{parent=organizations/*/cases/*}:showFeed" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "ShowFeedRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "orderBy": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ShowFeedResponse": { + "fields": { + "feedItems": { + "rule": "repeated", + "type": "FeedItem", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "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 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js new file mode 100644 index 00000000000..c6962a4f15a --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 case for which attachments should be listed. + */ + // const parent = 'abc123' + /** + * The maximum number of attachments fetched with each request. + * If not provided, the default is 10. The maximum page size that will be + * returned is 100. + * The size of each page can be smaller than the requested page size and can + * include zero. For example, you could request 100 attachments on one page, + * receive 0, and then on the next page, receive 90. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CaseAttachmentServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseAttachmentServiceClient(); + + async function callListAttachments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = supportClient.listAttachmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAttachments(); + // [END cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.close_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.close_case.js new file mode 100644 index 00000000000..3f6593141e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.close_case.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 cloudsupport_v2_generated_CaseService_CloseCase_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 case to close. + */ + // const name = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callCloseCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await supportClient.closeCase(request); + console.log(response); + } + + callCloseCase(); + // [END cloudsupport_v2_generated_CaseService_CloseCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.create_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.create_case.js new file mode 100644 index 00000000000..e3677fcb459 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.create_case.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(parent, case) { + // [START cloudsupport_v2_generated_CaseService_CreateCase_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent under which the case should be created. + */ + // const parent = 'abc123' + /** + * Required. The case to be created. + */ + // const case = {} + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callCreateCase() { + // Construct request + const request = { + parent, + case, + }; + + // Run request + const response = await supportClient.createCase(request); + console.log(response); + } + + callCreateCase(); + // [END cloudsupport_v2_generated_CaseService_CreateCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.escalate_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.escalate_case.js new file mode 100644 index 00000000000..287ee208360 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.escalate_case.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(name) { + // [START cloudsupport_v2_generated_CaseService_EscalateCase_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 case to be escalated. + */ + // const name = 'abc123' + /** + * The escalation information to be sent with the escalation request. + */ + // const escalation = {} + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callEscalateCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await supportClient.escalateCase(request); + console.log(response); + } + + callEscalateCase(); + // [END cloudsupport_v2_generated_CaseService_EscalateCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.get_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.get_case.js new file mode 100644 index 00000000000..18fa9969cb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.get_case.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 cloudsupport_v2_generated_CaseService_GetCase_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full name of a case to be retrieved. + */ + // const name = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callGetCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await supportClient.getCase(request); + console.log(response); + } + + callGetCase(); + // [END cloudsupport_v2_generated_CaseService_GetCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.list_cases.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.list_cases.js new file mode 100644 index 00000000000..0742afa4322 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.list_cases.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 cloudsupport_v2_generated_CaseService_ListCases_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 a parent to list cases under. + */ + // const parent = 'abc123' + /** + * An expression used to filter cases. + * If it's an empty string, then no filtering happens. Otherwise, the endpoint + * returns the cases that match the filter. + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * EXAMPLES: + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + */ + // const filter = 'abc123' + /** + * The maximum number of cases fetched with each request. Defaults to 10. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callListCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = supportClient.listCasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCases(); + // [END cloudsupport_v2_generated_CaseService_ListCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js new file mode 100644 index 00000000000..fd17e1b24df --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.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() { + // [START cloudsupport_v2_generated_CaseService_SearchCaseClassifications_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * An expression used to filter case classifications. + * If it's an empty string, then no filtering happens. Otherwise, case + * classifications will be returned that match the filter. + */ + // const query = 'abc123' + /** + * The maximum number of classifications fetched with each request. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callSearchCaseClassifications() { + // Construct request + const request = { + }; + + // Run request + const iterable = supportClient.searchCaseClassificationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchCaseClassifications(); + // [END cloudsupport_v2_generated_CaseService_SearchCaseClassifications_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_cases.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_cases.js new file mode 100644 index 00000000000..82971582ba7 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_cases.js @@ -0,0 +1,100 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 cloudsupport_v2_generated_CaseService_SearchCases_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 name of the parent resource to search for cases under. + */ + // const parent = 'abc123' + /** + * An expression used to filter cases. + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * - `organization`: An organization name in the form + * `organizations/`. + * - `project`: A project name in the form `projects/`. + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * You must specify either `organization` or `project`. + * To search across `displayName`, `description`, and comments, use a global + * restriction with no keyword or operator. For example, `"my search"`. + * To search only cases updated after a certain date, use `update_time` + * restricted with that particular date, time, and timezone in ISO datetime + * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + * `update_time` only supports the greater than operator (`>`). + * Examples: + * - `organization="organizations/123456789"` + * - `project="projects/my-project-id"` + * - `project="projects/123456789"` + * - `organization="organizations/123456789" AND state=CLOSED` + * - `project="projects/my-project-id" AND creator.email="tester@example.com"` + * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + */ + // const query = 'abc123' + /** + * The maximum number of cases fetched with each request. The default page + * size is 10. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callSearchCases() { + // Construct request + const request = { + }; + + // Run request + const iterable = supportClient.searchCasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchCases(); + // [END cloudsupport_v2_generated_CaseService_SearchCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.update_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.update_case.js new file mode 100644 index 00000000000..1fa63a79ae2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.update_case.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(case) { + // [START cloudsupport_v2_generated_CaseService_UpdateCase_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The case to update. + */ + // const case = {} + /** + * A list of attributes of the case that should be updated. Supported values + * are `priority`, `display_name`, and `subscriber_email_addresses`. If no + * fields are specified, all supported fields are updated. + * Be careful - if you do not provide a field mask, then you might + * accidentally clear some fields. For example, if you leave the field mask + * empty and do not provide a value for `subscriber_email_addresses`, then + * `subscriber_email_addresses` is updated to empty. + */ + // const updateMask = {} + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callUpdateCase() { + // Construct request + const request = { + case, + }; + + // Run request + const response = await supportClient.updateCase(request); + console.log(response); + } + + callUpdateCase(); + // [END cloudsupport_v2_generated_CaseService_UpdateCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.create_comment.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.create_comment.js new file mode 100644 index 00000000000..da6bf18fec6 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.create_comment.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(parent, comment) { + // [START cloudsupport_v2_generated_CommentService_CreateComment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 case to which the comment should be added. + */ + // const parent = 'abc123' + /** + * Required. The comment to be added. + */ + // const comment = {} + + // Imports the Support library + const {CommentServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CommentServiceClient(); + + async function callCreateComment() { + // Construct request + const request = { + parent, + comment, + }; + + // Run request + const response = await supportClient.createComment(request); + console.log(response); + } + + callCreateComment(); + // [END cloudsupport_v2_generated_CommentService_CreateComment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.list_comments.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.list_comments.js new file mode 100644 index 00000000000..f2944c228e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.list_comments.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) { + // [START cloudsupport_v2_generated_CommentService_ListComments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 case for which to list comments. + */ + // const parent = 'abc123' + /** + * The maximum number of comments to fetch. Defaults to 10. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is returned. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CommentServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CommentServiceClient(); + + async function callListComments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = supportClient.listCommentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListComments(); + // [END cloudsupport_v2_generated_CommentService_ListComments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/snippet_metadata_google.cloud.support.v2.json b/owl-bot-staging/google-cloud-support/samples/generated/v2/snippet_metadata_google.cloud.support.v2.json new file mode 100644 index 00000000000..fa991325c32 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2/snippet_metadata_google.cloud.support.v2.json @@ -0,0 +1,519 @@ +{ + "clientLibrary": { + "name": "nodejs-support", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.support.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_async", + "title": "CaseAttachmentService listAttachments Sample", + "origin": "API_DEFINITION", + "description": " List all the attachments associated with a support case.", + "canonical": true, + "file": "case_attachment_service.list_attachments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAttachments", + "fullName": "google.cloud.support.v2.CaseAttachmentService.ListAttachments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.ListAttachmentsResponse", + "client": { + "shortName": "CaseAttachmentServiceClient", + "fullName": "google.cloud.support.v2.CaseAttachmentServiceClient" + }, + "method": { + "shortName": "ListAttachments", + "fullName": "google.cloud.support.v2.CaseAttachmentService.ListAttachments", + "service": { + "shortName": "CaseAttachmentService", + "fullName": "google.cloud.support.v2.CaseAttachmentService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_GetCase_async", + "title": "CaseAttachmentService getCase Sample", + "origin": "API_DEFINITION", + "description": " Retrieve a case.", + "canonical": true, + "file": "case_service.get_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCase", + "fullName": "google.cloud.support.v2.CaseService.GetCase", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "GetCase", + "fullName": "google.cloud.support.v2.CaseService.GetCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_ListCases_async", + "title": "CaseAttachmentService listCases Sample", + "origin": "API_DEFINITION", + "description": " Retrieve all cases under a parent, but not its children. For example, listing cases under an organization only returns the cases that are directly parented by that organization. To retrieve cases under an organization and its projects, use `cases.search`.", + "canonical": true, + "file": "case_service.list_cases.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCases", + "fullName": "google.cloud.support.v2.CaseService.ListCases", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.ListCasesResponse", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "ListCases", + "fullName": "google.cloud.support.v2.CaseService.ListCases", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_SearchCases_async", + "title": "CaseAttachmentService searchCases Sample", + "origin": "API_DEFINITION", + "description": " Search for cases using a query.", + "canonical": true, + "file": "case_service.search_cases.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchCases", + "fullName": "google.cloud.support.v2.CaseService.SearchCases", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.SearchCasesResponse", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "SearchCases", + "fullName": "google.cloud.support.v2.CaseService.SearchCases", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_CreateCase_async", + "title": "CaseAttachmentService createCase Sample", + "origin": "API_DEFINITION", + "description": " Create a new case and associate it with a parent. It must have the following fields set: `display_name`, `description`, `classification`, and `priority`. If you're just testing the API and don't want to route your case to an agent, set `testCase=true`.", + "canonical": true, + "file": "case_service.create_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCase", + "fullName": "google.cloud.support.v2.CaseService.CreateCase", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "case", + "type": ".google.cloud.support.v2.Case" + } + ], + "resultType": ".google.cloud.support.v2.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "CreateCase", + "fullName": "google.cloud.support.v2.CaseService.CreateCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_UpdateCase_async", + "title": "CaseAttachmentService updateCase Sample", + "origin": "API_DEFINITION", + "description": " Update a case. Only some fields can be updated.", + "canonical": true, + "file": "case_service.update_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCase", + "fullName": "google.cloud.support.v2.CaseService.UpdateCase", + "async": true, + "parameters": [ + { + "name": "case", + "type": ".google.cloud.support.v2.Case" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.support.v2.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "UpdateCase", + "fullName": "google.cloud.support.v2.CaseService.UpdateCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_EscalateCase_async", + "title": "CaseAttachmentService escalateCase Sample", + "origin": "API_DEFINITION", + "description": " Escalate a case, starting the Google Cloud Support escalation management process. This operation is only available for some support services. Go to https://cloud.google.com/support and look for 'Technical support escalations' in the feature list to find out which ones let you do that.", + "canonical": true, + "file": "case_service.escalate_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EscalateCase", + "fullName": "google.cloud.support.v2.CaseService.EscalateCase", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "escalation", + "type": ".google.cloud.support.v2.Escalation" + } + ], + "resultType": ".google.cloud.support.v2.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "EscalateCase", + "fullName": "google.cloud.support.v2.CaseService.EscalateCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_CloseCase_async", + "title": "CaseAttachmentService closeCase Sample", + "origin": "API_DEFINITION", + "description": " Close a case.", + "canonical": true, + "file": "case_service.close_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CloseCase", + "fullName": "google.cloud.support.v2.CaseService.CloseCase", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "CloseCase", + "fullName": "google.cloud.support.v2.CaseService.CloseCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_SearchCaseClassifications_async", + "title": "CaseAttachmentService searchCaseClassifications Sample", + "origin": "API_DEFINITION", + "description": " Retrieve valid classifications to use when creating a support case. Classifications are hierarchical. Each classification is a string containing all levels of the hierarchy separated by `\" > \"`. For example, `\"Technical Issue > Compute > Compute Engine\"`. Classification IDs returned by this endpoint are valid for at least six months. When a classification is deactivated, this endpoint immediately stops returning it. After six months, `case.create` requests using the classification will fail.", + "canonical": true, + "file": "case_service.search_case_classifications.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchCaseClassifications", + "fullName": "google.cloud.support.v2.CaseService.SearchCaseClassifications", + "async": true, + "parameters": [ + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.SearchCaseClassificationsResponse", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "SearchCaseClassifications", + "fullName": "google.cloud.support.v2.CaseService.SearchCaseClassifications", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CommentService_ListComments_async", + "title": "CaseAttachmentService listComments Sample", + "origin": "API_DEFINITION", + "description": " List all the comments associated with a case.", + "canonical": true, + "file": "comment_service.list_comments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListComments", + "fullName": "google.cloud.support.v2.CommentService.ListComments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.ListCommentsResponse", + "client": { + "shortName": "CommentServiceClient", + "fullName": "google.cloud.support.v2.CommentServiceClient" + }, + "method": { + "shortName": "ListComments", + "fullName": "google.cloud.support.v2.CommentService.ListComments", + "service": { + "shortName": "CommentService", + "fullName": "google.cloud.support.v2.CommentService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CommentService_CreateComment_async", + "title": "CaseAttachmentService createComment Sample", + "origin": "API_DEFINITION", + "description": " Add a new comment to a case. The comment must have the following fields set: `body`.", + "canonical": true, + "file": "comment_service.create_comment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateComment", + "fullName": "google.cloud.support.v2.CommentService.CreateComment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "comment", + "type": ".google.cloud.support.v2.Comment" + } + ], + "resultType": ".google.cloud.support.v2.Comment", + "client": { + "shortName": "CommentServiceClient", + "fullName": "google.cloud.support.v2.CommentServiceClient" + }, + "method": { + "shortName": "CreateComment", + "fullName": "google.cloud.support.v2.CommentService.CreateComment", + "service": { + "shortName": "CommentService", + "fullName": "google.cloud.support.v2.CommentService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.get_attachment.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.get_attachment.js new file mode 100644 index 00000000000..4daed19740b --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.get_attachment.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 cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 attachment to get. + */ + // const name = 'abc123' + + // Imports the Support library + const {CaseAttachmentServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CaseAttachmentServiceClient(); + + async function callGetAttachment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await supportClient.getAttachment(request); + console.log(response); + } + + callGetAttachment(); + // [END cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.list_attachments.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.list_attachments.js new file mode 100644 index 00000000000..7bfe8cbb5b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.list_attachments.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 case for which attachments should be listed. + */ + // const parent = 'abc123' + /** + * The maximum number of attachments fetched with each request. + * If not provided, the default is 10. The maximum page size that will be + * returned is 100. + * The size of each page can be smaller than the requested page size and can + * include zero. For example, you could request 100 attachments on one page, + * receive 0, and then on the next page, receive 90. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CaseAttachmentServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CaseAttachmentServiceClient(); + + async function callListAttachments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = supportClient.listAttachmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAttachments(); + // [END cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.close_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.close_case.js new file mode 100644 index 00000000000..ebb2c3f8bf0 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.close_case.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 cloudsupport_v2beta_generated_CaseService_CloseCase_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 case to close. + */ + // const name = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callCloseCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await supportClient.closeCase(request); + console.log(response); + } + + callCloseCase(); + // [END cloudsupport_v2beta_generated_CaseService_CloseCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.create_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.create_case.js new file mode 100644 index 00000000000..9719dd4d6a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.create_case.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(parent, case) { + // [START cloudsupport_v2beta_generated_CaseService_CreateCase_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent under which the case should be created. + */ + // const parent = 'abc123' + /** + * Required. The case to be created. + */ + // const case = {} + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callCreateCase() { + // Construct request + const request = { + parent, + case, + }; + + // Run request + const response = await supportClient.createCase(request); + console.log(response); + } + + callCreateCase(); + // [END cloudsupport_v2beta_generated_CaseService_CreateCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.escalate_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.escalate_case.js new file mode 100644 index 00000000000..a540a7f3252 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.escalate_case.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(name) { + // [START cloudsupport_v2beta_generated_CaseService_EscalateCase_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 case to be escalated. + */ + // const name = 'abc123' + /** + * The escalation information to be sent with the escalation request. + */ + // const escalation = {} + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callEscalateCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await supportClient.escalateCase(request); + console.log(response); + } + + callEscalateCase(); + // [END cloudsupport_v2beta_generated_CaseService_EscalateCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.get_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.get_case.js new file mode 100644 index 00000000000..69fcd3a222e --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.get_case.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 cloudsupport_v2beta_generated_CaseService_GetCase_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full name of a case to be retrieved. + */ + // const name = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callGetCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await supportClient.getCase(request); + console.log(response); + } + + callGetCase(); + // [END cloudsupport_v2beta_generated_CaseService_GetCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.list_cases.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.list_cases.js new file mode 100644 index 00000000000..9a406ebdf7e --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.list_cases.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 cloudsupport_v2beta_generated_CaseService_ListCases_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 a parent to list cases under. + */ + // const parent = 'abc123' + /** + * An expression used to filter cases. + * If it's an empty string, then no filtering happens. Otherwise, the endpoint + * returns the cases that match the filter. + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * EXAMPLES: + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + */ + // const filter = 'abc123' + /** + * The maximum number of cases fetched with each request. Defaults to 10. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + /** + * The product line to request cases for. If unspecified, only + * Google Cloud cases will be returned. + */ + // const productLine = {} + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callListCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = supportClient.listCasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCases(); + // [END cloudsupport_v2beta_generated_CaseService_ListCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_case_classifications.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_case_classifications.js new file mode 100644 index 00000000000..e48944ac618 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_case_classifications.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() { + // [START cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * An expression used to filter case classifications. + * If it's an empty string, then no filtering happens. Otherwise, case + * classifications will be returned that match the filter. + */ + // const query = 'abc123' + /** + * The maximum number of classifications fetched with each request. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + /** + * Optional. The product to return case classifications for. + */ + // const product = {} + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callSearchCaseClassifications() { + // Construct request + const request = { + }; + + // Run request + const iterable = supportClient.searchCaseClassificationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchCaseClassifications(); + // [END cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_cases.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_cases.js new file mode 100644 index 00000000000..d801f1e7d48 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_cases.js @@ -0,0 +1,100 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 cloudsupport_v2beta_generated_CaseService_SearchCases_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 name of the parent resource to search for cases under. + */ + // const parent = 'abc123' + /** + * An expression used to filter cases. + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * - `organization`: An organization name in the form + * `organizations/`. + * - `project`: A project name in the form `projects/`. + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * You must specify either `organization` or `project`. + * To search across `displayName`, `description`, and comments, use a global + * restriction with no keyword or operator. For example, `"my search"`. + * To search only cases updated after a certain date, use `update_time` + * restricted with that particular date, time, and timezone in ISO datetime + * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + * `update_time` only supports the greater than operator (`>`). + * Examples: + * - `organization="organizations/123456789"` + * - `project="projects/my-project-id"` + * - `project="projects/123456789"` + * - `organization="organizations/123456789" AND state=CLOSED` + * - `project="projects/my-project-id" AND creator.email="tester@example.com"` + * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + */ + // const query = 'abc123' + /** + * The maximum number of cases fetched with each request. The default page + * size is 10. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callSearchCases() { + // Construct request + const request = { + }; + + // Run request + const iterable = supportClient.searchCasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchCases(); + // [END cloudsupport_v2beta_generated_CaseService_SearchCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.update_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.update_case.js new file mode 100644 index 00000000000..69696767fca --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.update_case.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(case) { + // [START cloudsupport_v2beta_generated_CaseService_UpdateCase_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The case to update. + */ + // const case = {} + /** + * A list of attributes of the case that should be updated. Supported values + * are `priority`, `display_name`, and `subscriber_email_addresses`. If no + * fields are specified, all supported fields are updated. + * Be careful - if you do not provide a field mask, then you might + * accidentally clear some fields. For example, if you leave the field mask + * empty and do not provide a value for `subscriber_email_addresses`, then + * `subscriber_email_addresses` is updated to empty. + */ + // const updateMask = {} + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callUpdateCase() { + // Construct request + const request = { + case, + }; + + // Run request + const response = await supportClient.updateCase(request); + console.log(response); + } + + callUpdateCase(); + // [END cloudsupport_v2beta_generated_CaseService_UpdateCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.create_comment.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.create_comment.js new file mode 100644 index 00000000000..2bb63bc5bfc --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.create_comment.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(parent, comment) { + // [START cloudsupport_v2beta_generated_CommentService_CreateComment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 case to which the comment should be added. + */ + // const parent = 'abc123' + /** + * Required. The comment to be added. + */ + // const comment = {} + + // Imports the Support library + const {CommentServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CommentServiceClient(); + + async function callCreateComment() { + // Construct request + const request = { + parent, + comment, + }; + + // Run request + const response = await supportClient.createComment(request); + console.log(response); + } + + callCreateComment(); + // [END cloudsupport_v2beta_generated_CommentService_CreateComment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.get_comment.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.get_comment.js new file mode 100644 index 00000000000..52098d93ab3 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.get_comment.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 cloudsupport_v2beta_generated_CommentService_GetComment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 comment to retrieve. + */ + // const name = 'abc123' + + // Imports the Support library + const {CommentServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CommentServiceClient(); + + async function callGetComment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await supportClient.getComment(request); + console.log(response); + } + + callGetComment(); + // [END cloudsupport_v2beta_generated_CommentService_GetComment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.list_comments.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.list_comments.js new file mode 100644 index 00000000000..98d2dde3539 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.list_comments.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) { + // [START cloudsupport_v2beta_generated_CommentService_ListComments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 case for which to list comments. + */ + // const parent = 'abc123' + /** + * The maximum number of comments to fetch. Defaults to 10. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is returned. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CommentServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new CommentServiceClient(); + + async function callListComments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = supportClient.listCommentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListComments(); + // [END cloudsupport_v2beta_generated_CommentService_ListComments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/feed_service.show_feed.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/feed_service.show_feed.js new file mode 100644 index 00000000000..f50cc73f2d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/feed_service.show_feed.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudsupport_v2beta_generated_FeedService_ShowFeed_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 case for which feed items should be + * listed. + */ + // const parent = 'abc123' + /** + * Optional. Field to order feed items by, followed by `asc` or `desc` + * postfix. The only valid field is + * `creation_time`. This list is case-insensitive, default sorting order is + * ascending, and the redundant space characters are insignificant. + * Example: `creation_time desc` + */ + // const orderBy = 'abc123' + /** + * Optional. The maximum number of feed items fetched with each request. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying the page of results to return. If + * unspecified, it retrieves the first page. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {FeedServiceClient} = require('@google-cloud/support').v2beta; + + // Instantiates a client + const supportClient = new FeedServiceClient(); + + async function callShowFeed() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = supportClient.showFeedAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callShowFeed(); + // [END cloudsupport_v2beta_generated_FeedService_ShowFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/snippet_metadata_google.cloud.support.v2beta.json b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/snippet_metadata_google.cloud.support.v2beta.json new file mode 100644 index 00000000000..b1a16161856 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/snippet_metadata_google.cloud.support.v2beta.json @@ -0,0 +1,659 @@ +{ + "clientLibrary": { + "name": "nodejs-support", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.support.v2beta", + "version": "v2beta" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_async", + "title": "CaseAttachmentService listAttachments Sample", + "origin": "API_DEFINITION", + "description": " List all the attachments associated with a support case.", + "canonical": true, + "file": "case_attachment_service.list_attachments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAttachments", + "fullName": "google.cloud.support.v2beta.CaseAttachmentService.ListAttachments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2beta.ListAttachmentsResponse", + "client": { + "shortName": "CaseAttachmentServiceClient", + "fullName": "google.cloud.support.v2beta.CaseAttachmentServiceClient" + }, + "method": { + "shortName": "ListAttachments", + "fullName": "google.cloud.support.v2beta.CaseAttachmentService.ListAttachments", + "service": { + "shortName": "CaseAttachmentService", + "fullName": "google.cloud.support.v2beta.CaseAttachmentService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_async", + "title": "CaseAttachmentService getAttachment Sample", + "origin": "API_DEFINITION", + "description": " Retrieve an attachment.", + "canonical": true, + "file": "case_attachment_service.get_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAttachment", + "fullName": "google.cloud.support.v2beta.CaseAttachmentService.GetAttachment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2beta.Attachment", + "client": { + "shortName": "CaseAttachmentServiceClient", + "fullName": "google.cloud.support.v2beta.CaseAttachmentServiceClient" + }, + "method": { + "shortName": "GetAttachment", + "fullName": "google.cloud.support.v2beta.CaseAttachmentService.GetAttachment", + "service": { + "shortName": "CaseAttachmentService", + "fullName": "google.cloud.support.v2beta.CaseAttachmentService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_CaseService_GetCase_async", + "title": "CaseAttachmentService getCase Sample", + "origin": "API_DEFINITION", + "description": " Retrieve a case.", + "canonical": true, + "file": "case_service.get_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCase", + "fullName": "google.cloud.support.v2beta.CaseService.GetCase", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2beta.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2beta.CaseServiceClient" + }, + "method": { + "shortName": "GetCase", + "fullName": "google.cloud.support.v2beta.CaseService.GetCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2beta.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_CaseService_ListCases_async", + "title": "CaseAttachmentService listCases Sample", + "origin": "API_DEFINITION", + "description": " Retrieve all cases under a parent, but not its children. For example, listing cases under an organization only returns the cases that are directly parented by that organization. To retrieve cases under an organization and its projects, use `cases.search`.", + "canonical": true, + "file": "case_service.list_cases.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCases", + "fullName": "google.cloud.support.v2beta.CaseService.ListCases", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "product_line", + "type": ".google.cloud.support.v2beta.ProductLine" + } + ], + "resultType": ".google.cloud.support.v2beta.ListCasesResponse", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2beta.CaseServiceClient" + }, + "method": { + "shortName": "ListCases", + "fullName": "google.cloud.support.v2beta.CaseService.ListCases", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2beta.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_CaseService_SearchCases_async", + "title": "CaseAttachmentService searchCases Sample", + "origin": "API_DEFINITION", + "description": " Search for cases using a query.", + "canonical": true, + "file": "case_service.search_cases.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchCases", + "fullName": "google.cloud.support.v2beta.CaseService.SearchCases", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2beta.SearchCasesResponse", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2beta.CaseServiceClient" + }, + "method": { + "shortName": "SearchCases", + "fullName": "google.cloud.support.v2beta.CaseService.SearchCases", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2beta.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_CaseService_CreateCase_async", + "title": "CaseAttachmentService createCase Sample", + "origin": "API_DEFINITION", + "description": " Create a new case and associate it with a parent. It must have the following fields set: `display_name`, `description`, `classification`, and `priority`. If you're just testing the API and don't want to route your case to an agent, set `testCase=true`.", + "canonical": true, + "file": "case_service.create_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCase", + "fullName": "google.cloud.support.v2beta.CaseService.CreateCase", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "case", + "type": ".google.cloud.support.v2beta.Case" + } + ], + "resultType": ".google.cloud.support.v2beta.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2beta.CaseServiceClient" + }, + "method": { + "shortName": "CreateCase", + "fullName": "google.cloud.support.v2beta.CaseService.CreateCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2beta.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_CaseService_UpdateCase_async", + "title": "CaseAttachmentService updateCase Sample", + "origin": "API_DEFINITION", + "description": " Update a case. Only some fields can be updated.", + "canonical": true, + "file": "case_service.update_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCase", + "fullName": "google.cloud.support.v2beta.CaseService.UpdateCase", + "async": true, + "parameters": [ + { + "name": "case", + "type": ".google.cloud.support.v2beta.Case" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.support.v2beta.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2beta.CaseServiceClient" + }, + "method": { + "shortName": "UpdateCase", + "fullName": "google.cloud.support.v2beta.CaseService.UpdateCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2beta.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_CaseService_EscalateCase_async", + "title": "CaseAttachmentService escalateCase Sample", + "origin": "API_DEFINITION", + "description": " Escalate a case, starting the Google Cloud Support escalation management process. This operation is only available for some support services. Go to https://cloud.google.com/support and look for 'Technical support escalations' in the feature list to find out which ones let you do that.", + "canonical": true, + "file": "case_service.escalate_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EscalateCase", + "fullName": "google.cloud.support.v2beta.CaseService.EscalateCase", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "escalation", + "type": ".google.cloud.support.v2beta.Escalation" + } + ], + "resultType": ".google.cloud.support.v2beta.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2beta.CaseServiceClient" + }, + "method": { + "shortName": "EscalateCase", + "fullName": "google.cloud.support.v2beta.CaseService.EscalateCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2beta.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_CaseService_CloseCase_async", + "title": "CaseAttachmentService closeCase Sample", + "origin": "API_DEFINITION", + "description": " Close a case.", + "canonical": true, + "file": "case_service.close_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CloseCase", + "fullName": "google.cloud.support.v2beta.CaseService.CloseCase", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2beta.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2beta.CaseServiceClient" + }, + "method": { + "shortName": "CloseCase", + "fullName": "google.cloud.support.v2beta.CaseService.CloseCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2beta.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_async", + "title": "CaseAttachmentService searchCaseClassifications Sample", + "origin": "API_DEFINITION", + "description": " Retrieve valid classifications to use when creating a support case. Classifications are hierarchical. Each classification is a string containing all levels of the hierarchy separated by `\" > \"`. For example, `\"Technical Issue > Compute > Compute Engine\"`. Classification IDs returned by this endpoint are valid for at least six months. When a classification is deactivated, this endpoint immediately stops returning it. After six months, `case.create` requests using the classification will fail.", + "canonical": true, + "file": "case_service.search_case_classifications.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchCaseClassifications", + "fullName": "google.cloud.support.v2beta.CaseService.SearchCaseClassifications", + "async": true, + "parameters": [ + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "product", + "type": ".google.cloud.support.v2beta.Product" + } + ], + "resultType": ".google.cloud.support.v2beta.SearchCaseClassificationsResponse", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2beta.CaseServiceClient" + }, + "method": { + "shortName": "SearchCaseClassifications", + "fullName": "google.cloud.support.v2beta.CaseService.SearchCaseClassifications", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2beta.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_CommentService_ListComments_async", + "title": "CaseAttachmentService listComments Sample", + "origin": "API_DEFINITION", + "description": " List all the comments associated with a case.", + "canonical": true, + "file": "comment_service.list_comments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListComments", + "fullName": "google.cloud.support.v2beta.CommentService.ListComments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2beta.ListCommentsResponse", + "client": { + "shortName": "CommentServiceClient", + "fullName": "google.cloud.support.v2beta.CommentServiceClient" + }, + "method": { + "shortName": "ListComments", + "fullName": "google.cloud.support.v2beta.CommentService.ListComments", + "service": { + "shortName": "CommentService", + "fullName": "google.cloud.support.v2beta.CommentService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_CommentService_CreateComment_async", + "title": "CaseAttachmentService createComment Sample", + "origin": "API_DEFINITION", + "description": " Add a new comment to a case. The comment must have the following fields set: `body`.", + "canonical": true, + "file": "comment_service.create_comment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateComment", + "fullName": "google.cloud.support.v2beta.CommentService.CreateComment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "comment", + "type": ".google.cloud.support.v2beta.Comment" + } + ], + "resultType": ".google.cloud.support.v2beta.Comment", + "client": { + "shortName": "CommentServiceClient", + "fullName": "google.cloud.support.v2beta.CommentServiceClient" + }, + "method": { + "shortName": "CreateComment", + "fullName": "google.cloud.support.v2beta.CommentService.CreateComment", + "service": { + "shortName": "CommentService", + "fullName": "google.cloud.support.v2beta.CommentService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_CommentService_GetComment_async", + "title": "CaseAttachmentService getComment Sample", + "origin": "API_DEFINITION", + "description": " Retrieve a comment.", + "canonical": true, + "file": "comment_service.get_comment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetComment", + "fullName": "google.cloud.support.v2beta.CommentService.GetComment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2beta.Comment", + "client": { + "shortName": "CommentServiceClient", + "fullName": "google.cloud.support.v2beta.CommentServiceClient" + }, + "method": { + "shortName": "GetComment", + "fullName": "google.cloud.support.v2beta.CommentService.GetComment", + "service": { + "shortName": "CommentService", + "fullName": "google.cloud.support.v2beta.CommentService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2beta_generated_FeedService_ShowFeed_async", + "title": "CaseAttachmentService showFeed Sample", + "origin": "API_DEFINITION", + "description": " Show items in the feed of this case, including case emails, attachments, and comments.", + "canonical": true, + "file": "feed_service.show_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ShowFeed", + "fullName": "google.cloud.support.v2beta.FeedService.ShowFeed", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2beta.ShowFeedResponse", + "client": { + "shortName": "FeedServiceClient", + "fullName": "google.cloud.support.v2beta.FeedServiceClient" + }, + "method": { + "shortName": "ShowFeed", + "fullName": "google.cloud.support.v2beta.FeedService.ShowFeed", + "service": { + "shortName": "FeedService", + "fullName": "google.cloud.support.v2beta.FeedService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-support/src/index.ts b/owl-bot-staging/google-cloud-support/src/index.ts new file mode 100644 index 00000000000..fc0d62b6479 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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 v2 from './v2'; +import * as v2beta from './v2beta'; + +const CaseAttachmentServiceClient = v2.CaseAttachmentServiceClient; +type CaseAttachmentServiceClient = v2.CaseAttachmentServiceClient; +const CaseServiceClient = v2.CaseServiceClient; +type CaseServiceClient = v2.CaseServiceClient; +const CommentServiceClient = v2.CommentServiceClient; +type CommentServiceClient = v2.CommentServiceClient; + +export {v2, v2beta, CaseAttachmentServiceClient, CaseServiceClient, CommentServiceClient}; +export default {v2, v2beta, CaseAttachmentServiceClient, CaseServiceClient, CommentServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client.ts new file mode 100644 index 00000000000..e1ed9634d72 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client.ts @@ -0,0 +1,858 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, PaginationCallback, GaxCall} 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/v2/case_attachment_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './case_attachment_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service to manage file attachments for Google Cloud support cases. + * @class + * @memberof v2 + */ +export class CaseAttachmentServiceClient { + 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('support'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + caseAttachmentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CaseAttachmentServiceClient. + * + * @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 CaseAttachmentServiceClient({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 CaseAttachmentServiceClient; + 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 = 'cloudsupport.' + 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; + } + + // 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 = { + organizationCasePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}' + ), + organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' + ), + organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/comments/{comment}' + ), + projectCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}' + ), + projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/attachments/{attachment_id}' + ), + projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/comments/{comment}' + ), + }; + + // 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 = { + listAttachments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attachments') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.support.v2.CaseAttachmentService', 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.caseAttachmentServiceStub) { + return this.caseAttachmentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.support.v2.CaseAttachmentService. + this.caseAttachmentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.support.v2.CaseAttachmentService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.support.v2.CaseAttachmentService, + 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 caseAttachmentServiceStubMethods = + ['listAttachments']; + for (const methodName of caseAttachmentServiceStubMethods) { + const callPromise = this.caseAttachmentServiceStub.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] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.caseAttachmentServiceStub; + } + + /** + * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * List all the attachments associated with a support case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case for which attachments should be listed. + * @param {number} request.pageSize + * The maximum number of attachments fetched with each request. + * + * If not provided, the default is 10. The maximum page size that will be + * returned is 100. + * + * The size of each page can be smaller than the requested page size and can + * include zero. For example, you could request 100 attachments on one page, + * receive 0, and then on the next page, receive 90. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2.Attachment|Attachment}. + * 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 `listAttachmentsAsync()` + * 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. + */ + listAttachments( + request?: protos.google.cloud.support.v2.IListAttachmentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2.IAttachment[], + protos.google.cloud.support.v2.IListAttachmentsRequest|null, + protos.google.cloud.support.v2.IListAttachmentsResponse + ]>; + listAttachments( + request: protos.google.cloud.support.v2.IListAttachmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2.IListAttachmentsRequest, + protos.google.cloud.support.v2.IListAttachmentsResponse|null|undefined, + protos.google.cloud.support.v2.IAttachment>): void; + listAttachments( + request: protos.google.cloud.support.v2.IListAttachmentsRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2.IListAttachmentsRequest, + protos.google.cloud.support.v2.IListAttachmentsResponse|null|undefined, + protos.google.cloud.support.v2.IAttachment>): void; + listAttachments( + request?: protos.google.cloud.support.v2.IListAttachmentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.support.v2.IListAttachmentsRequest, + protos.google.cloud.support.v2.IListAttachmentsResponse|null|undefined, + protos.google.cloud.support.v2.IAttachment>, + callback?: PaginationCallback< + protos.google.cloud.support.v2.IListAttachmentsRequest, + protos.google.cloud.support.v2.IListAttachmentsResponse|null|undefined, + protos.google.cloud.support.v2.IAttachment>): + Promise<[ + protos.google.cloud.support.v2.IAttachment[], + protos.google.cloud.support.v2.IListAttachmentsRequest|null, + protos.google.cloud.support.v2.IListAttachmentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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.support.v2.IListAttachmentsRequest, + protos.google.cloud.support.v2.IListAttachmentsResponse|null|undefined, + protos.google.cloud.support.v2.IAttachment>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAttachments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAttachments request %j', request); + return this.innerApiCalls + .listAttachments(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.support.v2.IAttachment[], + protos.google.cloud.support.v2.IListAttachmentsRequest|null, + protos.google.cloud.support.v2.IListAttachmentsResponse + ]) => { + this._log.info('listAttachments values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAttachments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case for which attachments should be listed. + * @param {number} request.pageSize + * The maximum number of attachments fetched with each request. + * + * If not provided, the default is 10. The maximum page size that will be + * returned is 100. + * + * The size of each page can be smaller than the requested page size and can + * include zero. For example, you could request 100 attachments on one page, + * receive 0, and then on the next page, receive 90. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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.support.v2.Attachment|Attachment} 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 `listAttachmentsAsync()` + * 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. + */ + listAttachmentsStream( + request?: protos.google.cloud.support.v2.IListAttachmentsRequest, + 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['listAttachments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAttachments stream %j', request); + return this.descriptors.page.listAttachments.createStream( + this.innerApiCalls.listAttachments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAttachments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case for which attachments should be listed. + * @param {number} request.pageSize + * The maximum number of attachments fetched with each request. + * + * If not provided, the default is 10. The maximum page size that will be + * returned is 100. + * + * The size of each page can be smaller than the requested page size and can + * include zero. For example, you could request 100 attachments on one page, + * receive 0, and then on the next page, receive 90. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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.support.v2.Attachment|Attachment}. 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/v2/case_attachment_service.list_attachments.js + * region_tag:cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_async + */ + listAttachmentsAsync( + request?: protos.google.cloud.support.v2.IListAttachmentsRequest, + 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['listAttachments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAttachments iterate %j', request); + return this.descriptors.page.listAttachments.asyncIterate( + this.innerApiCalls['listAttachments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organizationCase resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @returns {string} Resource name string. + */ + organizationCasePath(organization:string,caseParam:string) { + return this.pathTemplates.organizationCasePathTemplate.render({ + organization: organization, + case: caseParam, + }); + } + + /** + * Parse the organization from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; + } + + /** + * Parse the case from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; + } + + /** + * Return a fully-qualified organizationCaseAttachmentId resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ + organization: organization, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the organization from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; + } + + /** + * Parse the case from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified organizationCaseComment resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.render({ + organization: organization, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the organization from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; + } + + /** + * Parse the case from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; + } + + /** + * Parse the comment from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; + } + + /** + * Return a fully-qualified projectCase resource name string. + * + * @param {string} project + * @param {string} caseParam + * @returns {string} Resource name string. + */ + projectCasePath(project:string,caseParam:string) { + return this.pathTemplates.projectCasePathTemplate.render({ + project: project, + case: caseParam, + }); + } + + /** + * Parse the project from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; + } + + /** + * Parse the case from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; + } + + /** + * Return a fully-qualified projectCaseAttachmentId resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ + project: project, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the project from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; + } + + /** + * Parse the case from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified projectCaseComment resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + projectCaseCommentPath(project:string,caseParam:string,comment:string) { + return this.pathTemplates.projectCaseCommentPathTemplate.render({ + project: project, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the project from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; + } + + /** + * Parse the case from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; + } + + /** + * Parse the comment from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; + } + + /** + * 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.caseAttachmentServiceStub && !this._terminated) { + return this.caseAttachmentServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client_config.json new file mode 100644 index 00000000000..cbbee7880fd --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client_config.json @@ -0,0 +1,43 @@ +{ + "interfaces": { + "google.cloud.support.v2.CaseAttachmentService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListAttachments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_proto_list.json new file mode 100644 index 00000000000..e71d4155489 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_proto_list.json @@ -0,0 +1,10 @@ +[ + "../../protos/google/cloud/support/v2/actor.proto", + "../../protos/google/cloud/support/v2/attachment.proto", + "../../protos/google/cloud/support/v2/attachment_service.proto", + "../../protos/google/cloud/support/v2/case.proto", + "../../protos/google/cloud/support/v2/case_service.proto", + "../../protos/google/cloud/support/v2/comment.proto", + "../../protos/google/cloud/support/v2/comment_service.proto", + "../../protos/google/cloud/support/v2/escalation.proto" +] diff --git a/owl-bot-staging/google-cloud-support/src/v2/case_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2/case_service_client.ts new file mode 100644 index 00000000000..2906526ea18 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2/case_service_client.ts @@ -0,0 +1,1917 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, PaginationCallback, GaxCall} 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/v2/case_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './case_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service to manage Google Cloud support cases. + * @class + * @memberof v2 + */ +export class CaseServiceClient { + 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('support'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + caseServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CaseServiceClient. + * + * @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 CaseServiceClient({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 CaseServiceClient; + 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 = 'cloudsupport.' + 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; + } + + // 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 = { + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationCasePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}' + ), + organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' + ), + organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/comments/{comment}' + ), + projectCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}' + ), + projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/attachments/{attachment_id}' + ), + projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/comments/{comment}' + ), + }; + + // 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 = { + listCases: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'cases'), + searchCases: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'cases'), + searchCaseClassifications: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'caseClassifications') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.support.v2.CaseService', 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.caseServiceStub) { + return this.caseServiceStub; + } + + // Put together the "service stub" for + // google.cloud.support.v2.CaseService. + this.caseServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.support.v2.CaseService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.support.v2.CaseService, + 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 caseServiceStubMethods = + ['getCase', 'listCases', 'searchCases', 'createCase', 'updateCase', 'escalateCase', 'closeCase', 'searchCaseClassifications']; + for (const methodName of caseServiceStubMethods) { + const callPromise = this.caseServiceStub.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] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.caseServiceStub; + } + + /** + * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Retrieve a case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of a case to be retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Case|Case}. + * 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/v2/case_service.get_case.js + * region_tag:cloudsupport_v2_generated_CaseService_GetCase_async + */ + getCase( + request?: protos.google.cloud.support.v2.IGetCaseRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest|undefined, {}|undefined + ]>; + getCase( + request: protos.google.cloud.support.v2.IGetCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest|null|undefined, + {}|null|undefined>): void; + getCase( + request: protos.google.cloud.support.v2.IGetCaseRequest, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest|null|undefined, + {}|null|undefined>): void; + getCase( + request?: protos.google.cloud.support.v2.IGetCaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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('getCase request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getCase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('getCase 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; + }); + } +/** + * Create a new case and associate it with a parent. + * + * It must have the following fields set: `display_name`, `description`, + * `classification`, and `priority`. If you're just testing the API and don't + * want to route your case to an agent, set `testCase=true`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent under which the case should be created. + * @param {google.cloud.support.v2.Case} request.case + * Required. The case to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.support.v2.Case|Case}. + * 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/v2/case_service.create_case.js + * region_tag:cloudsupport_v2_generated_CaseService_CreateCase_async + */ + createCase( + request?: protos.google.cloud.support.v2.ICreateCaseRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest|undefined, {}|undefined + ]>; + createCase( + request: protos.google.cloud.support.v2.ICreateCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest|null|undefined, + {}|null|undefined>): void; + createCase( + request: protos.google.cloud.support.v2.ICreateCaseRequest, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest|null|undefined, + {}|null|undefined>): void; + createCase( + request?: protos.google.cloud.support.v2.ICreateCaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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('createCase request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createCase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('createCase 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; + }); + } +/** + * Update a case. Only some fields can be updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.support.v2.Case} request.case + * Required. The case to update. + * @param {google.protobuf.FieldMask} request.updateMask + * A list of attributes of the case that should be updated. Supported values + * are `priority`, `display_name`, and `subscriber_email_addresses`. If no + * fields are specified, all supported fields are updated. + * + * Be careful - if you do not provide a field mask, then you might + * accidentally clear some fields. For example, if you leave the field mask + * empty and do not provide a value for `subscriber_email_addresses`, then + * `subscriber_email_addresses` is updated to empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Case|Case}. + * 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/v2/case_service.update_case.js + * region_tag:cloudsupport_v2_generated_CaseService_UpdateCase_async + */ + updateCase( + request?: protos.google.cloud.support.v2.IUpdateCaseRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest|undefined, {}|undefined + ]>; + updateCase( + request: protos.google.cloud.support.v2.IUpdateCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest|null|undefined, + {}|null|undefined>): void; + updateCase( + request: protos.google.cloud.support.v2.IUpdateCaseRequest, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest|null|undefined, + {}|null|undefined>): void; + updateCase( + request?: protos.google.cloud.support.v2.IUpdateCaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'case.name': request.case!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateCase request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateCase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateCase 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; + }); + } +/** + * Escalate a case, starting the Google Cloud Support escalation management + * process. + * + * This operation is only available for some support services. Go to + * https://cloud.google.com/support and look for 'Technical support + * escalations' in the feature list to find out which ones let you + * do that. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the case to be escalated. + * @param {google.cloud.support.v2.Escalation} request.escalation + * The escalation information to be sent with the escalation request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.support.v2.Case|Case}. + * 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/v2/case_service.escalate_case.js + * region_tag:cloudsupport_v2_generated_CaseService_EscalateCase_async + */ + escalateCase( + request?: protos.google.cloud.support.v2.IEscalateCaseRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest|undefined, {}|undefined + ]>; + escalateCase( + request: protos.google.cloud.support.v2.IEscalateCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest|null|undefined, + {}|null|undefined>): void; + escalateCase( + request: protos.google.cloud.support.v2.IEscalateCaseRequest, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest|null|undefined, + {}|null|undefined>): void; + escalateCase( + request?: protos.google.cloud.support.v2.IEscalateCaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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('escalateCase request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('escalateCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.escalateCase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('escalateCase 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; + }); + } +/** + * Close a case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the case to close. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Case|Case}. + * 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/v2/case_service.close_case.js + * region_tag:cloudsupport_v2_generated_CaseService_CloseCase_async + */ + closeCase( + request?: protos.google.cloud.support.v2.ICloseCaseRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest|undefined, {}|undefined + ]>; + closeCase( + request: protos.google.cloud.support.v2.ICloseCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest|null|undefined, + {}|null|undefined>): void; + closeCase( + request: protos.google.cloud.support.v2.ICloseCaseRequest, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest|null|undefined, + {}|null|undefined>): void; + closeCase( + request?: protos.google.cloud.support.v2.ICloseCaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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('closeCase request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('closeCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.closeCase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('closeCase 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 all cases under a parent, but not its children. + * + * For example, listing cases under an organization only returns the cases + * that are directly parented by that organization. To retrieve cases + * under an organization and its projects, use `cases.search`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of a parent to list cases under. + * @param {string} request.filter + * An expression used to filter cases. + * + * If it's an empty string, then no filtering happens. Otherwise, the endpoint + * returns the cases that match the filter. + * + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * EXAMPLES: + * + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2.Case|Case}. + * 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 `listCasesAsync()` + * 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. + */ + listCases( + request?: protos.google.cloud.support.v2.IListCasesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2.ICase[], + protos.google.cloud.support.v2.IListCasesRequest|null, + protos.google.cloud.support.v2.IListCasesResponse + ]>; + listCases( + request: protos.google.cloud.support.v2.IListCasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2.IListCasesRequest, + protos.google.cloud.support.v2.IListCasesResponse|null|undefined, + protos.google.cloud.support.v2.ICase>): void; + listCases( + request: protos.google.cloud.support.v2.IListCasesRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2.IListCasesRequest, + protos.google.cloud.support.v2.IListCasesResponse|null|undefined, + protos.google.cloud.support.v2.ICase>): void; + listCases( + request?: protos.google.cloud.support.v2.IListCasesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.support.v2.IListCasesRequest, + protos.google.cloud.support.v2.IListCasesResponse|null|undefined, + protos.google.cloud.support.v2.ICase>, + callback?: PaginationCallback< + protos.google.cloud.support.v2.IListCasesRequest, + protos.google.cloud.support.v2.IListCasesResponse|null|undefined, + protos.google.cloud.support.v2.ICase>): + Promise<[ + protos.google.cloud.support.v2.ICase[], + protos.google.cloud.support.v2.IListCasesRequest|null, + protos.google.cloud.support.v2.IListCasesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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.support.v2.IListCasesRequest, + protos.google.cloud.support.v2.IListCasesResponse|null|undefined, + protos.google.cloud.support.v2.ICase>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCases request %j', request); + return this.innerApiCalls + .listCases(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.support.v2.ICase[], + protos.google.cloud.support.v2.IListCasesRequest|null, + protos.google.cloud.support.v2.IListCasesResponse + ]) => { + this._log.info('listCases values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listCases`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of a parent to list cases under. + * @param {string} request.filter + * An expression used to filter cases. + * + * If it's an empty string, then no filtering happens. Otherwise, the endpoint + * returns the cases that match the filter. + * + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * EXAMPLES: + * + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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.support.v2.Case|Case} 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 `listCasesAsync()` + * 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. + */ + listCasesStream( + request?: protos.google.cloud.support.v2.IListCasesRequest, + 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['listCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCases stream %j', request); + return this.descriptors.page.listCases.createStream( + this.innerApiCalls.listCases as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCases`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of a parent to list cases under. + * @param {string} request.filter + * An expression used to filter cases. + * + * If it's an empty string, then no filtering happens. Otherwise, the endpoint + * returns the cases that match the filter. + * + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * EXAMPLES: + * + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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.support.v2.Case|Case}. 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/v2/case_service.list_cases.js + * region_tag:cloudsupport_v2_generated_CaseService_ListCases_async + */ + listCasesAsync( + request?: protos.google.cloud.support.v2.IListCasesRequest, + 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['listCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCases iterate %j', request); + return this.descriptors.page.listCases.asyncIterate( + this.innerApiCalls['listCases'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Search for cases using a query. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The name of the parent resource to search for cases under. + * @param {string} request.query + * An expression used to filter cases. + * + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * + * - `organization`: An organization name in the form + * `organizations/`. + * - `project`: A project name in the form `projects/`. + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * You must specify either `organization` or `project`. + * + * To search across `displayName`, `description`, and comments, use a global + * restriction with no keyword or operator. For example, `"my search"`. + * + * To search only cases updated after a certain date, use `update_time` + * restricted with that particular date, time, and timezone in ISO datetime + * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + * `update_time` only supports the greater than operator (`>`). + * + * Examples: + * + * - `organization="organizations/123456789"` + * - `project="projects/my-project-id"` + * - `project="projects/123456789"` + * - `organization="organizations/123456789" AND state=CLOSED` + * - `project="projects/my-project-id" AND creator.email="tester@example.com"` + * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. The default page + * size is 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2.Case|Case}. + * 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 `searchCasesAsync()` + * 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. + */ + searchCases( + request?: protos.google.cloud.support.v2.ISearchCasesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2.ICase[], + protos.google.cloud.support.v2.ISearchCasesRequest|null, + protos.google.cloud.support.v2.ISearchCasesResponse + ]>; + searchCases( + request: protos.google.cloud.support.v2.ISearchCasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2.ISearchCasesRequest, + protos.google.cloud.support.v2.ISearchCasesResponse|null|undefined, + protos.google.cloud.support.v2.ICase>): void; + searchCases( + request: protos.google.cloud.support.v2.ISearchCasesRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2.ISearchCasesRequest, + protos.google.cloud.support.v2.ISearchCasesResponse|null|undefined, + protos.google.cloud.support.v2.ICase>): void; + searchCases( + request?: protos.google.cloud.support.v2.ISearchCasesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.support.v2.ISearchCasesRequest, + protos.google.cloud.support.v2.ISearchCasesResponse|null|undefined, + protos.google.cloud.support.v2.ICase>, + callback?: PaginationCallback< + protos.google.cloud.support.v2.ISearchCasesRequest, + protos.google.cloud.support.v2.ISearchCasesResponse|null|undefined, + protos.google.cloud.support.v2.ICase>): + Promise<[ + protos.google.cloud.support.v2.ICase[], + protos.google.cloud.support.v2.ISearchCasesRequest|null, + protos.google.cloud.support.v2.ISearchCasesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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.support.v2.ISearchCasesRequest, + protos.google.cloud.support.v2.ISearchCasesResponse|null|undefined, + protos.google.cloud.support.v2.ICase>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchCases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchCases request %j', request); + return this.innerApiCalls + .searchCases(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.support.v2.ICase[], + protos.google.cloud.support.v2.ISearchCasesRequest|null, + protos.google.cloud.support.v2.ISearchCasesResponse + ]) => { + this._log.info('searchCases values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `searchCases`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The name of the parent resource to search for cases under. + * @param {string} request.query + * An expression used to filter cases. + * + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * + * - `organization`: An organization name in the form + * `organizations/`. + * - `project`: A project name in the form `projects/`. + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * You must specify either `organization` or `project`. + * + * To search across `displayName`, `description`, and comments, use a global + * restriction with no keyword or operator. For example, `"my search"`. + * + * To search only cases updated after a certain date, use `update_time` + * restricted with that particular date, time, and timezone in ISO datetime + * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + * `update_time` only supports the greater than operator (`>`). + * + * Examples: + * + * - `organization="organizations/123456789"` + * - `project="projects/my-project-id"` + * - `project="projects/123456789"` + * - `organization="organizations/123456789" AND state=CLOSED` + * - `project="projects/my-project-id" AND creator.email="tester@example.com"` + * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. The default page + * size is 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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.support.v2.Case|Case} 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 `searchCasesAsync()` + * 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. + */ + searchCasesStream( + request?: protos.google.cloud.support.v2.ISearchCasesRequest, + 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['searchCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('searchCases stream %j', request); + return this.descriptors.page.searchCases.createStream( + this.innerApiCalls.searchCases as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchCases`, 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 + * The name of the parent resource to search for cases under. + * @param {string} request.query + * An expression used to filter cases. + * + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * + * - `organization`: An organization name in the form + * `organizations/`. + * - `project`: A project name in the form `projects/`. + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * You must specify either `organization` or `project`. + * + * To search across `displayName`, `description`, and comments, use a global + * restriction with no keyword or operator. For example, `"my search"`. + * + * To search only cases updated after a certain date, use `update_time` + * restricted with that particular date, time, and timezone in ISO datetime + * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + * `update_time` only supports the greater than operator (`>`). + * + * Examples: + * + * - `organization="organizations/123456789"` + * - `project="projects/my-project-id"` + * - `project="projects/123456789"` + * - `organization="organizations/123456789" AND state=CLOSED` + * - `project="projects/my-project-id" AND creator.email="tester@example.com"` + * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. The default page + * size is 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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.support.v2.Case|Case}. 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/v2/case_service.search_cases.js + * region_tag:cloudsupport_v2_generated_CaseService_SearchCases_async + */ + searchCasesAsync( + request?: protos.google.cloud.support.v2.ISearchCasesRequest, + 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['searchCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('searchCases iterate %j', request); + return this.descriptors.page.searchCases.asyncIterate( + this.innerApiCalls['searchCases'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Retrieve valid classifications to use when creating a support case. + * + * Classifications are hierarchical. Each classification is a string + * containing all levels of the hierarchy separated by `" > "`. For example, + * `"Technical Issue > Compute > Compute Engine"`. + * + * Classification IDs returned by this endpoint are valid for at least six + * months. When a classification is deactivated, this endpoint immediately + * stops returning it. After six months, `case.create` requests using the + * classification will fail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.query + * An expression used to filter case classifications. + * + * If it's an empty string, then no filtering happens. Otherwise, case + * classifications will be returned that match the filter. + * @param {number} request.pageSize + * The maximum number of classifications fetched with each request. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2.CaseClassification|CaseClassification}. + * 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 `searchCaseClassificationsAsync()` + * 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. + */ + searchCaseClassifications( + request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2.ICaseClassification[], + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest|null, + protos.google.cloud.support.v2.ISearchCaseClassificationsResponse + ]>; + searchCaseClassifications( + request: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + protos.google.cloud.support.v2.ISearchCaseClassificationsResponse|null|undefined, + protos.google.cloud.support.v2.ICaseClassification>): void; + searchCaseClassifications( + request: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + protos.google.cloud.support.v2.ISearchCaseClassificationsResponse|null|undefined, + protos.google.cloud.support.v2.ICaseClassification>): void; + searchCaseClassifications( + request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + protos.google.cloud.support.v2.ISearchCaseClassificationsResponse|null|undefined, + protos.google.cloud.support.v2.ICaseClassification>, + callback?: PaginationCallback< + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + protos.google.cloud.support.v2.ISearchCaseClassificationsResponse|null|undefined, + protos.google.cloud.support.v2.ICaseClassification>): + Promise<[ + protos.google.cloud.support.v2.ICaseClassification[], + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest|null, + protos.google.cloud.support.v2.ISearchCaseClassificationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + protos.google.cloud.support.v2.ISearchCaseClassificationsResponse|null|undefined, + protos.google.cloud.support.v2.ICaseClassification>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchCaseClassifications values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchCaseClassifications request %j', request); + return this.innerApiCalls + .searchCaseClassifications(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.support.v2.ICaseClassification[], + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest|null, + protos.google.cloud.support.v2.ISearchCaseClassificationsResponse + ]) => { + this._log.info('searchCaseClassifications values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `searchCaseClassifications`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.query + * An expression used to filter case classifications. + * + * If it's an empty string, then no filtering happens. Otherwise, case + * classifications will be returned that match the filter. + * @param {number} request.pageSize + * The maximum number of classifications fetched with each request. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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.support.v2.CaseClassification|CaseClassification} 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 `searchCaseClassificationsAsync()` + * 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. + */ + searchCaseClassificationsStream( + request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchCaseClassifications']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('searchCaseClassifications stream %j', request); + return this.descriptors.page.searchCaseClassifications.createStream( + this.innerApiCalls.searchCaseClassifications as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchCaseClassifications`, 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.query + * An expression used to filter case classifications. + * + * If it's an empty string, then no filtering happens. Otherwise, case + * classifications will be returned that match the filter. + * @param {number} request.pageSize + * The maximum number of classifications fetched with each request. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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.support.v2.CaseClassification|CaseClassification}. 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/v2/case_service.search_case_classifications.js + * region_tag:cloudsupport_v2_generated_CaseService_SearchCaseClassifications_async + */ + searchCaseClassificationsAsync( + request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchCaseClassifications']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('searchCaseClassifications iterate %j', request); + return this.descriptors.page.searchCaseClassifications.asyncIterate( + this.innerApiCalls['searchCaseClassifications'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization:string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName).organization; + } + + /** + * Return a fully-qualified organizationCase resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @returns {string} Resource name string. + */ + organizationCasePath(organization:string,caseParam:string) { + return this.pathTemplates.organizationCasePathTemplate.render({ + organization: organization, + case: caseParam, + }); + } + + /** + * Parse the organization from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; + } + + /** + * Parse the case from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; + } + + /** + * Return a fully-qualified organizationCaseAttachmentId resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ + organization: organization, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the organization from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; + } + + /** + * Parse the case from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified organizationCaseComment resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.render({ + organization: organization, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the organization from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; + } + + /** + * Parse the case from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; + } + + /** + * Parse the comment from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; + } + + /** + * Return a fully-qualified projectCase resource name string. + * + * @param {string} project + * @param {string} caseParam + * @returns {string} Resource name string. + */ + projectCasePath(project:string,caseParam:string) { + return this.pathTemplates.projectCasePathTemplate.render({ + project: project, + case: caseParam, + }); + } + + /** + * Parse the project from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; + } + + /** + * Parse the case from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; + } + + /** + * Return a fully-qualified projectCaseAttachmentId resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ + project: project, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the project from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; + } + + /** + * Parse the case from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified projectCaseComment resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + projectCaseCommentPath(project:string,caseParam:string,comment:string) { + return this.pathTemplates.projectCaseCommentPathTemplate.render({ + project: project, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the project from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; + } + + /** + * Parse the case from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; + } + + /** + * Parse the comment from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; + } + + /** + * 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.caseServiceStub && !this._terminated) { + return this.caseServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2/case_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2/case_service_client_config.json new file mode 100644 index 00000000000..a1e21087917 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2/case_service_client_config.json @@ -0,0 +1,78 @@ +{ + "interfaces": { + "google.cloud.support.v2.CaseService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetCase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "SearchCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateCase": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCase": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "EscalateCase": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CloseCase": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchCaseClassifications": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-support/src/v2/case_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2/case_service_proto_list.json new file mode 100644 index 00000000000..e71d4155489 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2/case_service_proto_list.json @@ -0,0 +1,10 @@ +[ + "../../protos/google/cloud/support/v2/actor.proto", + "../../protos/google/cloud/support/v2/attachment.proto", + "../../protos/google/cloud/support/v2/attachment_service.proto", + "../../protos/google/cloud/support/v2/case.proto", + "../../protos/google/cloud/support/v2/case_service.proto", + "../../protos/google/cloud/support/v2/comment.proto", + "../../protos/google/cloud/support/v2/comment_service.proto", + "../../protos/google/cloud/support/v2/escalation.proto" +] diff --git a/owl-bot-staging/google-cloud-support/src/v2/comment_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2/comment_service_client.ts new file mode 100644 index 00000000000..b4c4c584214 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2/comment_service_client.ts @@ -0,0 +1,935 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, PaginationCallback, GaxCall} 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/v2/comment_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './comment_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service to manage comments on cases. + * @class + * @memberof v2 + */ +export class CommentServiceClient { + 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('support'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + commentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CommentServiceClient. + * + * @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 CommentServiceClient({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 CommentServiceClient; + 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 = 'cloudsupport.' + 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; + } + + // 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 = { + organizationCasePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}' + ), + organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' + ), + organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/comments/{comment}' + ), + projectCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}' + ), + projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/attachments/{attachment_id}' + ), + projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/comments/{comment}' + ), + }; + + // 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 = { + listComments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'comments') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.support.v2.CommentService', 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.commentServiceStub) { + return this.commentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.support.v2.CommentService. + this.commentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.support.v2.CommentService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.support.v2.CommentService, + 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 commentServiceStubMethods = + ['listComments', 'createComment']; + for (const methodName of commentServiceStubMethods) { + const callPromise = this.commentServiceStub.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] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.commentServiceStub; + } + + /** + * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Add a new comment to a case. + * + * The comment must have the following fields set: `body`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case to which the comment should be added. + * @param {google.cloud.support.v2.Comment} request.comment + * Required. The comment to be added. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Comment|Comment}. + * 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/v2/comment_service.create_comment.js + * region_tag:cloudsupport_v2_generated_CommentService_CreateComment_async + */ + createComment( + request?: protos.google.cloud.support.v2.ICreateCommentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest|undefined, {}|undefined + ]>; + createComment( + request: protos.google.cloud.support.v2.ICreateCommentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest|null|undefined, + {}|null|undefined>): void; + createComment( + request: protos.google.cloud.support.v2.ICreateCommentRequest, + callback: Callback< + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest|null|undefined, + {}|null|undefined>): void; + createComment( + request?: protos.google.cloud.support.v2.ICreateCommentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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('createComment request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createComment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createComment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest|undefined, + {}|undefined + ]) => { + this._log.info('createComment 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; + }); + } + + /** + * List all the comments associated with a case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case for which to list comments. + * @param {number} request.pageSize + * The maximum number of comments to fetch. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is 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 Array of {@link protos.google.cloud.support.v2.Comment|Comment}. + * 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 `listCommentsAsync()` + * 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. + */ + listComments( + request?: protos.google.cloud.support.v2.IListCommentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2.IComment[], + protos.google.cloud.support.v2.IListCommentsRequest|null, + protos.google.cloud.support.v2.IListCommentsResponse + ]>; + listComments( + request: protos.google.cloud.support.v2.IListCommentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2.IListCommentsRequest, + protos.google.cloud.support.v2.IListCommentsResponse|null|undefined, + protos.google.cloud.support.v2.IComment>): void; + listComments( + request: protos.google.cloud.support.v2.IListCommentsRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2.IListCommentsRequest, + protos.google.cloud.support.v2.IListCommentsResponse|null|undefined, + protos.google.cloud.support.v2.IComment>): void; + listComments( + request?: protos.google.cloud.support.v2.IListCommentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.support.v2.IListCommentsRequest, + protos.google.cloud.support.v2.IListCommentsResponse|null|undefined, + protos.google.cloud.support.v2.IComment>, + callback?: PaginationCallback< + protos.google.cloud.support.v2.IListCommentsRequest, + protos.google.cloud.support.v2.IListCommentsResponse|null|undefined, + protos.google.cloud.support.v2.IComment>): + Promise<[ + protos.google.cloud.support.v2.IComment[], + protos.google.cloud.support.v2.IListCommentsRequest|null, + protos.google.cloud.support.v2.IListCommentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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.support.v2.IListCommentsRequest, + protos.google.cloud.support.v2.IListCommentsResponse|null|undefined, + protos.google.cloud.support.v2.IComment>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listComments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listComments request %j', request); + return this.innerApiCalls + .listComments(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.support.v2.IComment[], + protos.google.cloud.support.v2.IListCommentsRequest|null, + protos.google.cloud.support.v2.IListCommentsResponse + ]) => { + this._log.info('listComments values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listComments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case for which to list comments. + * @param {number} request.pageSize + * The maximum number of comments to fetch. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is returned. + * @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.support.v2.Comment|Comment} 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 `listCommentsAsync()` + * 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. + */ + listCommentsStream( + request?: protos.google.cloud.support.v2.IListCommentsRequest, + 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['listComments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listComments stream %j', request); + return this.descriptors.page.listComments.createStream( + this.innerApiCalls.listComments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listComments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case for which to list comments. + * @param {number} request.pageSize + * The maximum number of comments to fetch. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is returned. + * @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.support.v2.Comment|Comment}. 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/v2/comment_service.list_comments.js + * region_tag:cloudsupport_v2_generated_CommentService_ListComments_async + */ + listCommentsAsync( + request?: protos.google.cloud.support.v2.IListCommentsRequest, + 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['listComments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listComments iterate %j', request); + return this.descriptors.page.listComments.asyncIterate( + this.innerApiCalls['listComments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organizationCase resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @returns {string} Resource name string. + */ + organizationCasePath(organization:string,caseParam:string) { + return this.pathTemplates.organizationCasePathTemplate.render({ + organization: organization, + case: caseParam, + }); + } + + /** + * Parse the organization from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; + } + + /** + * Parse the case from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; + } + + /** + * Return a fully-qualified organizationCaseAttachmentId resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ + organization: organization, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the organization from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; + } + + /** + * Parse the case from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified organizationCaseComment resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.render({ + organization: organization, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the organization from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; + } + + /** + * Parse the case from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; + } + + /** + * Parse the comment from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; + } + + /** + * Return a fully-qualified projectCase resource name string. + * + * @param {string} project + * @param {string} caseParam + * @returns {string} Resource name string. + */ + projectCasePath(project:string,caseParam:string) { + return this.pathTemplates.projectCasePathTemplate.render({ + project: project, + case: caseParam, + }); + } + + /** + * Parse the project from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; + } + + /** + * Parse the case from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; + } + + /** + * Return a fully-qualified projectCaseAttachmentId resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ + project: project, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the project from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; + } + + /** + * Parse the case from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified projectCaseComment resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + projectCaseCommentPath(project:string,caseParam:string,comment:string) { + return this.pathTemplates.projectCaseCommentPathTemplate.render({ + project: project, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the project from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; + } + + /** + * Parse the case from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; + } + + /** + * Parse the comment from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; + } + + /** + * 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.commentServiceStub && !this._terminated) { + return this.commentServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2/comment_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2/comment_service_client_config.json new file mode 100644 index 00000000000..addf5b5e654 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2/comment_service_client_config.json @@ -0,0 +1,48 @@ +{ + "interfaces": { + "google.cloud.support.v2.CommentService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListComments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateComment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-support/src/v2/comment_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2/comment_service_proto_list.json new file mode 100644 index 00000000000..e71d4155489 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2/comment_service_proto_list.json @@ -0,0 +1,10 @@ +[ + "../../protos/google/cloud/support/v2/actor.proto", + "../../protos/google/cloud/support/v2/attachment.proto", + "../../protos/google/cloud/support/v2/attachment_service.proto", + "../../protos/google/cloud/support/v2/case.proto", + "../../protos/google/cloud/support/v2/case_service.proto", + "../../protos/google/cloud/support/v2/comment.proto", + "../../protos/google/cloud/support/v2/comment_service.proto", + "../../protos/google/cloud/support/v2/escalation.proto" +] diff --git a/owl-bot-staging/google-cloud-support/src/v2/gapic_metadata.json b/owl-bot-staging/google-cloud-support/src/v2/gapic_metadata.json new file mode 100644 index 00000000000..7bb73a8fbd4 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2/gapic_metadata.json @@ -0,0 +1,181 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.support.v2", + "libraryPackage": "@google-cloud/support", + "services": { + "CaseAttachmentService": { + "clients": { + "grpc": { + "libraryClient": "CaseAttachmentServiceClient", + "rpcs": { + "ListAttachments": { + "methods": [ + "listAttachments", + "listAttachmentsStream", + "listAttachmentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CaseAttachmentServiceClient", + "rpcs": { + "ListAttachments": { + "methods": [ + "listAttachments", + "listAttachmentsStream", + "listAttachmentsAsync" + ] + } + } + } + } + }, + "CaseService": { + "clients": { + "grpc": { + "libraryClient": "CaseServiceClient", + "rpcs": { + "GetCase": { + "methods": [ + "getCase" + ] + }, + "CreateCase": { + "methods": [ + "createCase" + ] + }, + "UpdateCase": { + "methods": [ + "updateCase" + ] + }, + "EscalateCase": { + "methods": [ + "escalateCase" + ] + }, + "CloseCase": { + "methods": [ + "closeCase" + ] + }, + "ListCases": { + "methods": [ + "listCases", + "listCasesStream", + "listCasesAsync" + ] + }, + "SearchCases": { + "methods": [ + "searchCases", + "searchCasesStream", + "searchCasesAsync" + ] + }, + "SearchCaseClassifications": { + "methods": [ + "searchCaseClassifications", + "searchCaseClassificationsStream", + "searchCaseClassificationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CaseServiceClient", + "rpcs": { + "GetCase": { + "methods": [ + "getCase" + ] + }, + "CreateCase": { + "methods": [ + "createCase" + ] + }, + "UpdateCase": { + "methods": [ + "updateCase" + ] + }, + "EscalateCase": { + "methods": [ + "escalateCase" + ] + }, + "CloseCase": { + "methods": [ + "closeCase" + ] + }, + "ListCases": { + "methods": [ + "listCases", + "listCasesStream", + "listCasesAsync" + ] + }, + "SearchCases": { + "methods": [ + "searchCases", + "searchCasesStream", + "searchCasesAsync" + ] + }, + "SearchCaseClassifications": { + "methods": [ + "searchCaseClassifications", + "searchCaseClassificationsStream", + "searchCaseClassificationsAsync" + ] + } + } + } + } + }, + "CommentService": { + "clients": { + "grpc": { + "libraryClient": "CommentServiceClient", + "rpcs": { + "CreateComment": { + "methods": [ + "createComment" + ] + }, + "ListComments": { + "methods": [ + "listComments", + "listCommentsStream", + "listCommentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CommentServiceClient", + "rpcs": { + "CreateComment": { + "methods": [ + "createComment" + ] + }, + "ListComments": { + "methods": [ + "listComments", + "listCommentsStream", + "listCommentsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-support/src/v2/index.ts b/owl-bot-staging/google-cloud-support/src/v2/index.ts new file mode 100644 index 00000000000..adc3d2e7e29 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2/index.ts @@ -0,0 +1,21 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {CaseAttachmentServiceClient} from './case_attachment_service_client'; +export {CaseServiceClient} from './case_service_client'; +export {CommentServiceClient} from './comment_service_client'; diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client.ts new file mode 100644 index 00000000000..c26d85e72bc --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client.ts @@ -0,0 +1,1056 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, PaginationCallback, GaxCall} 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/v2beta/case_attachment_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './case_attachment_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service to manage file attachments for Google Cloud support cases. + * @class + * @memberof v2beta + */ +export class CaseAttachmentServiceClient { + 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('support'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + caseAttachmentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CaseAttachmentServiceClient. + * + * @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 CaseAttachmentServiceClient({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 CaseAttachmentServiceClient; + 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 = 'cloudsupport.' + 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; + } + + // 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 = { + organizationCasePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}' + ), + organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' + ), + organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/comments/{comment}' + ), + organizationCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/emailMessages/{email_message}' + ), + projectCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}' + ), + projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/attachments/{attachment_id}' + ), + projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/comments/{comment}' + ), + projectCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/emailMessages/{email_message}' + ), + }; + + // 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 = { + listAttachments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attachments') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.support.v2beta.CaseAttachmentService', 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.caseAttachmentServiceStub) { + return this.caseAttachmentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.support.v2beta.CaseAttachmentService. + this.caseAttachmentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.support.v2beta.CaseAttachmentService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.support.v2beta.CaseAttachmentService, + 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 caseAttachmentServiceStubMethods = + ['listAttachments', 'getAttachment']; + for (const methodName of caseAttachmentServiceStubMethods) { + const callPromise = this.caseAttachmentServiceStub.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] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.caseAttachmentServiceStub; + } + + /** + * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Retrieve an attachment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the attachment to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2beta.Attachment|Attachment}. + * 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/v2beta/case_attachment_service.get_attachment.js + * region_tag:cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_async + */ + getAttachment( + request?: protos.google.cloud.support.v2beta.IGetAttachmentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.IAttachment, + protos.google.cloud.support.v2beta.IGetAttachmentRequest|undefined, {}|undefined + ]>; + getAttachment( + request: protos.google.cloud.support.v2beta.IGetAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2beta.IAttachment, + protos.google.cloud.support.v2beta.IGetAttachmentRequest|null|undefined, + {}|null|undefined>): void; + getAttachment( + request: protos.google.cloud.support.v2beta.IGetAttachmentRequest, + callback: Callback< + protos.google.cloud.support.v2beta.IAttachment, + protos.google.cloud.support.v2beta.IGetAttachmentRequest|null|undefined, + {}|null|undefined>): void; + getAttachment( + request?: protos.google.cloud.support.v2beta.IGetAttachmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2beta.IAttachment, + protos.google.cloud.support.v2beta.IGetAttachmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2beta.IAttachment, + protos.google.cloud.support.v2beta.IGetAttachmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2beta.IAttachment, + protos.google.cloud.support.v2beta.IGetAttachmentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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('getAttachment request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2beta.IAttachment, + protos.google.cloud.support.v2beta.IGetAttachmentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAttachment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getAttachment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2beta.IAttachment, + protos.google.cloud.support.v2beta.IGetAttachmentRequest|undefined, + {}|undefined + ]) => { + this._log.info('getAttachment 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; + }); + } + + /** + * List all the attachments associated with a support case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case for which attachments should be listed. + * @param {number} request.pageSize + * The maximum number of attachments fetched with each request. + * + * If not provided, the default is 10. The maximum page size that will be + * returned is 100. + * + * The size of each page can be smaller than the requested page size and can + * include zero. For example, you could request 100 attachments on one page, + * receive 0, and then on the next page, receive 90. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2beta.Attachment|Attachment}. + * 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 `listAttachmentsAsync()` + * 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. + */ + listAttachments( + request?: protos.google.cloud.support.v2beta.IListAttachmentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.IAttachment[], + protos.google.cloud.support.v2beta.IListAttachmentsRequest|null, + protos.google.cloud.support.v2beta.IListAttachmentsResponse + ]>; + listAttachments( + request: protos.google.cloud.support.v2beta.IListAttachmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2beta.IListAttachmentsRequest, + protos.google.cloud.support.v2beta.IListAttachmentsResponse|null|undefined, + protos.google.cloud.support.v2beta.IAttachment>): void; + listAttachments( + request: protos.google.cloud.support.v2beta.IListAttachmentsRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2beta.IListAttachmentsRequest, + protos.google.cloud.support.v2beta.IListAttachmentsResponse|null|undefined, + protos.google.cloud.support.v2beta.IAttachment>): void; + listAttachments( + request?: protos.google.cloud.support.v2beta.IListAttachmentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.support.v2beta.IListAttachmentsRequest, + protos.google.cloud.support.v2beta.IListAttachmentsResponse|null|undefined, + protos.google.cloud.support.v2beta.IAttachment>, + callback?: PaginationCallback< + protos.google.cloud.support.v2beta.IListAttachmentsRequest, + protos.google.cloud.support.v2beta.IListAttachmentsResponse|null|undefined, + protos.google.cloud.support.v2beta.IAttachment>): + Promise<[ + protos.google.cloud.support.v2beta.IAttachment[], + protos.google.cloud.support.v2beta.IListAttachmentsRequest|null, + protos.google.cloud.support.v2beta.IListAttachmentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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.support.v2beta.IListAttachmentsRequest, + protos.google.cloud.support.v2beta.IListAttachmentsResponse|null|undefined, + protos.google.cloud.support.v2beta.IAttachment>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAttachments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAttachments request %j', request); + return this.innerApiCalls + .listAttachments(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.support.v2beta.IAttachment[], + protos.google.cloud.support.v2beta.IListAttachmentsRequest|null, + protos.google.cloud.support.v2beta.IListAttachmentsResponse + ]) => { + this._log.info('listAttachments values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAttachments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case for which attachments should be listed. + * @param {number} request.pageSize + * The maximum number of attachments fetched with each request. + * + * If not provided, the default is 10. The maximum page size that will be + * returned is 100. + * + * The size of each page can be smaller than the requested page size and can + * include zero. For example, you could request 100 attachments on one page, + * receive 0, and then on the next page, receive 90. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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.support.v2beta.Attachment|Attachment} 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 `listAttachmentsAsync()` + * 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. + */ + listAttachmentsStream( + request?: protos.google.cloud.support.v2beta.IListAttachmentsRequest, + 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['listAttachments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAttachments stream %j', request); + return this.descriptors.page.listAttachments.createStream( + this.innerApiCalls.listAttachments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAttachments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case for which attachments should be listed. + * @param {number} request.pageSize + * The maximum number of attachments fetched with each request. + * + * If not provided, the default is 10. The maximum page size that will be + * returned is 100. + * + * The size of each page can be smaller than the requested page size and can + * include zero. For example, you could request 100 attachments on one page, + * receive 0, and then on the next page, receive 90. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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.support.v2beta.Attachment|Attachment}. 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/v2beta/case_attachment_service.list_attachments.js + * region_tag:cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_async + */ + listAttachmentsAsync( + request?: protos.google.cloud.support.v2beta.IListAttachmentsRequest, + 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['listAttachments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAttachments iterate %j', request); + return this.descriptors.page.listAttachments.asyncIterate( + this.innerApiCalls['listAttachments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organizationCase resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @returns {string} Resource name string. + */ + organizationCasePath(organization:string,caseParam:string) { + return this.pathTemplates.organizationCasePathTemplate.render({ + organization: organization, + case: caseParam, + }); + } + + /** + * Parse the organization from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; + } + + /** + * Parse the case from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; + } + + /** + * Return a fully-qualified organizationCaseAttachmentId resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ + organization: organization, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the organization from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; + } + + /** + * Parse the case from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified organizationCaseComment resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.render({ + organization: organization, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the organization from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; + } + + /** + * Parse the case from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; + } + + /** + * Parse the comment from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; + } + + /** + * Return a fully-qualified organizationCaseEmailMessages resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} email_message + * @returns {string} Resource name string. + */ + organizationCaseEmailMessagesPath(organization:string,caseParam:string,emailMessage:string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.render({ + organization: organization, + case: caseParam, + email_message: emailMessage, + }); + } + + /** + * Parse the organization from OrganizationCaseEmailMessages resource. + * + * @param {string} organizationCaseEmailMessagesName + * A fully-qualified path representing organization_case_emailMessages resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).organization; + } + + /** + * Parse the case from OrganizationCaseEmailMessages resource. + * + * @param {string} organizationCaseEmailMessagesName + * A fully-qualified path representing organization_case_emailMessages resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).case; + } + + /** + * Parse the email_message from OrganizationCaseEmailMessages resource. + * + * @param {string} organizationCaseEmailMessagesName + * A fully-qualified path representing organization_case_emailMessages resource. + * @returns {string} A string representing the email_message. + */ + matchEmailMessageFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).email_message; + } + + /** + * Return a fully-qualified projectCase resource name string. + * + * @param {string} project + * @param {string} caseParam + * @returns {string} Resource name string. + */ + projectCasePath(project:string,caseParam:string) { + return this.pathTemplates.projectCasePathTemplate.render({ + project: project, + case: caseParam, + }); + } + + /** + * Parse the project from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; + } + + /** + * Parse the case from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; + } + + /** + * Return a fully-qualified projectCaseAttachmentId resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ + project: project, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the project from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; + } + + /** + * Parse the case from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified projectCaseComment resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + projectCaseCommentPath(project:string,caseParam:string,comment:string) { + return this.pathTemplates.projectCaseCommentPathTemplate.render({ + project: project, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the project from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; + } + + /** + * Parse the case from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; + } + + /** + * Parse the comment from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; + } + + /** + * Return a fully-qualified projectCaseEmailMessages resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} email_message + * @returns {string} Resource name string. + */ + projectCaseEmailMessagesPath(project:string,caseParam:string,emailMessage:string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.render({ + project: project, + case: caseParam, + email_message: emailMessage, + }); + } + + /** + * Parse the project from ProjectCaseEmailMessages resource. + * + * @param {string} projectCaseEmailMessagesName + * A fully-qualified path representing project_case_emailMessages resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).project; + } + + /** + * Parse the case from ProjectCaseEmailMessages resource. + * + * @param {string} projectCaseEmailMessagesName + * A fully-qualified path representing project_case_emailMessages resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).case; + } + + /** + * Parse the email_message from ProjectCaseEmailMessages resource. + * + * @param {string} projectCaseEmailMessagesName + * A fully-qualified path representing project_case_emailMessages resource. + * @returns {string} A string representing the email_message. + */ + matchEmailMessageFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).email_message; + } + + /** + * 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.caseAttachmentServiceStub && !this._terminated) { + return this.caseAttachmentServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client_config.json new file mode 100644 index 00000000000..5002130b100 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client_config.json @@ -0,0 +1,47 @@ +{ + "interfaces": { + "google.cloud.support.v2beta.CaseAttachmentService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListAttachments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetAttachment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_proto_list.json new file mode 100644 index 00000000000..a623d27a7fd --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_proto_list.json @@ -0,0 +1,14 @@ +[ + "../../protos/google/cloud/support/v2beta/actor.proto", + "../../protos/google/cloud/support/v2beta/attachment.proto", + "../../protos/google/cloud/support/v2beta/attachment_service.proto", + "../../protos/google/cloud/support/v2beta/case.proto", + "../../protos/google/cloud/support/v2beta/case_service.proto", + "../../protos/google/cloud/support/v2beta/comment.proto", + "../../protos/google/cloud/support/v2beta/comment_service.proto", + "../../protos/google/cloud/support/v2beta/content.proto", + "../../protos/google/cloud/support/v2beta/email_message.proto", + "../../protos/google/cloud/support/v2beta/escalation.proto", + "../../protos/google/cloud/support/v2beta/feed_item.proto", + "../../protos/google/cloud/support/v2beta/feed_service.proto" +] diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/case_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2beta/case_service_client.ts new file mode 100644 index 00000000000..7e0db96918e --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/case_service_client.ts @@ -0,0 +1,2036 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, PaginationCallback, GaxCall} 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/v2beta/case_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './case_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service to manage Google Cloud support cases. + * @class + * @memberof v2beta + */ +export class CaseServiceClient { + 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('support'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + caseServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CaseServiceClient. + * + * @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 CaseServiceClient({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 CaseServiceClient; + 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 = 'cloudsupport.' + 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; + } + + // 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 = { + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationCasePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}' + ), + organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' + ), + organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/comments/{comment}' + ), + organizationCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/emailMessages/{email_message}' + ), + projectCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}' + ), + projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/attachments/{attachment_id}' + ), + projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/comments/{comment}' + ), + projectCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/emailMessages/{email_message}' + ), + }; + + // 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 = { + listCases: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'cases'), + searchCases: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'cases'), + searchCaseClassifications: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'caseClassifications') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.support.v2beta.CaseService', 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.caseServiceStub) { + return this.caseServiceStub; + } + + // Put together the "service stub" for + // google.cloud.support.v2beta.CaseService. + this.caseServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.support.v2beta.CaseService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.support.v2beta.CaseService, + 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 caseServiceStubMethods = + ['getCase', 'listCases', 'searchCases', 'createCase', 'updateCase', 'escalateCase', 'closeCase', 'searchCaseClassifications']; + for (const methodName of caseServiceStubMethods) { + const callPromise = this.caseServiceStub.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] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.caseServiceStub; + } + + /** + * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Retrieve a case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of a case to be retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2beta.Case|Case}. + * 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/v2beta/case_service.get_case.js + * region_tag:cloudsupport_v2beta_generated_CaseService_GetCase_async + */ + getCase( + request?: protos.google.cloud.support.v2beta.IGetCaseRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IGetCaseRequest|undefined, {}|undefined + ]>; + getCase( + request: protos.google.cloud.support.v2beta.IGetCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IGetCaseRequest|null|undefined, + {}|null|undefined>): void; + getCase( + request: protos.google.cloud.support.v2beta.IGetCaseRequest, + callback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IGetCaseRequest|null|undefined, + {}|null|undefined>): void; + getCase( + request?: protos.google.cloud.support.v2beta.IGetCaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IGetCaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IGetCaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IGetCaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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('getCase request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IGetCaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getCase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IGetCaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('getCase 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; + }); + } +/** + * Create a new case and associate it with a parent. + * + * It must have the following fields set: `display_name`, `description`, + * `classification`, and `priority`. If you're just testing the API and don't + * want to route your case to an agent, set `testCase=true`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent under which the case should be created. + * @param {google.cloud.support.v2beta.Case} request.case + * Required. The case to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.support.v2beta.Case|Case}. + * 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/v2beta/case_service.create_case.js + * region_tag:cloudsupport_v2beta_generated_CaseService_CreateCase_async + */ + createCase( + request?: protos.google.cloud.support.v2beta.ICreateCaseRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICreateCaseRequest|undefined, {}|undefined + ]>; + createCase( + request: protos.google.cloud.support.v2beta.ICreateCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICreateCaseRequest|null|undefined, + {}|null|undefined>): void; + createCase( + request: protos.google.cloud.support.v2beta.ICreateCaseRequest, + callback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICreateCaseRequest|null|undefined, + {}|null|undefined>): void; + createCase( + request?: protos.google.cloud.support.v2beta.ICreateCaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICreateCaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICreateCaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICreateCaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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('createCase request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICreateCaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createCase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICreateCaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('createCase 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; + }); + } +/** + * Update a case. Only some fields can be updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.support.v2beta.Case} request.case + * Required. The case to update. + * @param {google.protobuf.FieldMask} request.updateMask + * A list of attributes of the case that should be updated. Supported values + * are `priority`, `display_name`, and `subscriber_email_addresses`. If no + * fields are specified, all supported fields are updated. + * + * Be careful - if you do not provide a field mask, then you might + * accidentally clear some fields. For example, if you leave the field mask + * empty and do not provide a value for `subscriber_email_addresses`, then + * `subscriber_email_addresses` is updated to empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2beta.Case|Case}. + * 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/v2beta/case_service.update_case.js + * region_tag:cloudsupport_v2beta_generated_CaseService_UpdateCase_async + */ + updateCase( + request?: protos.google.cloud.support.v2beta.IUpdateCaseRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IUpdateCaseRequest|undefined, {}|undefined + ]>; + updateCase( + request: protos.google.cloud.support.v2beta.IUpdateCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IUpdateCaseRequest|null|undefined, + {}|null|undefined>): void; + updateCase( + request: protos.google.cloud.support.v2beta.IUpdateCaseRequest, + callback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IUpdateCaseRequest|null|undefined, + {}|null|undefined>): void; + updateCase( + request?: protos.google.cloud.support.v2beta.IUpdateCaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IUpdateCaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IUpdateCaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IUpdateCaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'case.name': request.case!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateCase request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IUpdateCaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateCase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IUpdateCaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateCase 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; + }); + } +/** + * Escalate a case, starting the Google Cloud Support escalation management + * process. + * + * This operation is only available for some support services. Go to + * https://cloud.google.com/support and look for 'Technical support + * escalations' in the feature list to find out which ones let you + * do that. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the case to be escalated. + * @param {google.cloud.support.v2beta.Escalation} request.escalation + * The escalation information to be sent with the escalation request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.support.v2beta.Case|Case}. + * 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/v2beta/case_service.escalate_case.js + * region_tag:cloudsupport_v2beta_generated_CaseService_EscalateCase_async + */ + escalateCase( + request?: protos.google.cloud.support.v2beta.IEscalateCaseRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IEscalateCaseRequest|undefined, {}|undefined + ]>; + escalateCase( + request: protos.google.cloud.support.v2beta.IEscalateCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IEscalateCaseRequest|null|undefined, + {}|null|undefined>): void; + escalateCase( + request: protos.google.cloud.support.v2beta.IEscalateCaseRequest, + callback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IEscalateCaseRequest|null|undefined, + {}|null|undefined>): void; + escalateCase( + request?: protos.google.cloud.support.v2beta.IEscalateCaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IEscalateCaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IEscalateCaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IEscalateCaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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('escalateCase request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IEscalateCaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('escalateCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.escalateCase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.IEscalateCaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('escalateCase 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; + }); + } +/** + * Close a case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the case to close. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2beta.Case|Case}. + * 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/v2beta/case_service.close_case.js + * region_tag:cloudsupport_v2beta_generated_CaseService_CloseCase_async + */ + closeCase( + request?: protos.google.cloud.support.v2beta.ICloseCaseRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICloseCaseRequest|undefined, {}|undefined + ]>; + closeCase( + request: protos.google.cloud.support.v2beta.ICloseCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICloseCaseRequest|null|undefined, + {}|null|undefined>): void; + closeCase( + request: protos.google.cloud.support.v2beta.ICloseCaseRequest, + callback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICloseCaseRequest|null|undefined, + {}|null|undefined>): void; + closeCase( + request?: protos.google.cloud.support.v2beta.ICloseCaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICloseCaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICloseCaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICloseCaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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('closeCase request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICloseCaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('closeCase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.closeCase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2beta.ICase, + protos.google.cloud.support.v2beta.ICloseCaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('closeCase 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 all cases under a parent, but not its children. + * + * For example, listing cases under an organization only returns the cases + * that are directly parented by that organization. To retrieve cases + * under an organization and its projects, use `cases.search`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of a parent to list cases under. + * @param {string} request.filter + * An expression used to filter cases. + * + * If it's an empty string, then no filtering happens. Otherwise, the endpoint + * returns the cases that match the filter. + * + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * EXAMPLES: + * + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {google.cloud.support.v2beta.ProductLine} request.productLine + * The product line to request cases for. If unspecified, only + * Google Cloud cases 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 Array of {@link protos.google.cloud.support.v2beta.Case|Case}. + * 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 `listCasesAsync()` + * 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. + */ + listCases( + request?: protos.google.cloud.support.v2beta.IListCasesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.ICase[], + protos.google.cloud.support.v2beta.IListCasesRequest|null, + protos.google.cloud.support.v2beta.IListCasesResponse + ]>; + listCases( + request: protos.google.cloud.support.v2beta.IListCasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2beta.IListCasesRequest, + protos.google.cloud.support.v2beta.IListCasesResponse|null|undefined, + protos.google.cloud.support.v2beta.ICase>): void; + listCases( + request: protos.google.cloud.support.v2beta.IListCasesRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2beta.IListCasesRequest, + protos.google.cloud.support.v2beta.IListCasesResponse|null|undefined, + protos.google.cloud.support.v2beta.ICase>): void; + listCases( + request?: protos.google.cloud.support.v2beta.IListCasesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.support.v2beta.IListCasesRequest, + protos.google.cloud.support.v2beta.IListCasesResponse|null|undefined, + protos.google.cloud.support.v2beta.ICase>, + callback?: PaginationCallback< + protos.google.cloud.support.v2beta.IListCasesRequest, + protos.google.cloud.support.v2beta.IListCasesResponse|null|undefined, + protos.google.cloud.support.v2beta.ICase>): + Promise<[ + protos.google.cloud.support.v2beta.ICase[], + protos.google.cloud.support.v2beta.IListCasesRequest|null, + protos.google.cloud.support.v2beta.IListCasesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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.support.v2beta.IListCasesRequest, + protos.google.cloud.support.v2beta.IListCasesResponse|null|undefined, + protos.google.cloud.support.v2beta.ICase>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCases request %j', request); + return this.innerApiCalls + .listCases(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.support.v2beta.ICase[], + protos.google.cloud.support.v2beta.IListCasesRequest|null, + protos.google.cloud.support.v2beta.IListCasesResponse + ]) => { + this._log.info('listCases values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listCases`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of a parent to list cases under. + * @param {string} request.filter + * An expression used to filter cases. + * + * If it's an empty string, then no filtering happens. Otherwise, the endpoint + * returns the cases that match the filter. + * + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * EXAMPLES: + * + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {google.cloud.support.v2beta.ProductLine} request.productLine + * The product line to request cases for. If unspecified, only + * Google Cloud cases 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 {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.support.v2beta.Case|Case} 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 `listCasesAsync()` + * 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. + */ + listCasesStream( + request?: protos.google.cloud.support.v2beta.IListCasesRequest, + 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['listCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCases stream %j', request); + return this.descriptors.page.listCases.createStream( + this.innerApiCalls.listCases as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCases`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of a parent to list cases under. + * @param {string} request.filter + * An expression used to filter cases. + * + * If it's an empty string, then no filtering happens. Otherwise, the endpoint + * returns the cases that match the filter. + * + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * EXAMPLES: + * + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {google.cloud.support.v2beta.ProductLine} request.productLine + * The product line to request cases for. If unspecified, only + * Google Cloud cases 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 {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.support.v2beta.Case|Case}. 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/v2beta/case_service.list_cases.js + * region_tag:cloudsupport_v2beta_generated_CaseService_ListCases_async + */ + listCasesAsync( + request?: protos.google.cloud.support.v2beta.IListCasesRequest, + 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['listCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listCases iterate %j', request); + return this.descriptors.page.listCases.asyncIterate( + this.innerApiCalls['listCases'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Search for cases using a query. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The name of the parent resource to search for cases under. + * @param {string} request.query + * An expression used to filter cases. + * + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * + * - `organization`: An organization name in the form + * `organizations/`. + * - `project`: A project name in the form `projects/`. + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * You must specify either `organization` or `project`. + * + * To search across `displayName`, `description`, and comments, use a global + * restriction with no keyword or operator. For example, `"my search"`. + * + * To search only cases updated after a certain date, use `update_time` + * restricted with that particular date, time, and timezone in ISO datetime + * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + * `update_time` only supports the greater than operator (`>`). + * + * Examples: + * + * - `organization="organizations/123456789"` + * - `project="projects/my-project-id"` + * - `project="projects/123456789"` + * - `organization="organizations/123456789" AND state=CLOSED` + * - `project="projects/my-project-id" AND creator.email="tester@example.com"` + * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. The default page + * size is 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2beta.Case|Case}. + * 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 `searchCasesAsync()` + * 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. + */ + searchCases( + request?: protos.google.cloud.support.v2beta.ISearchCasesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.ICase[], + protos.google.cloud.support.v2beta.ISearchCasesRequest|null, + protos.google.cloud.support.v2beta.ISearchCasesResponse + ]>; + searchCases( + request: protos.google.cloud.support.v2beta.ISearchCasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2beta.ISearchCasesRequest, + protos.google.cloud.support.v2beta.ISearchCasesResponse|null|undefined, + protos.google.cloud.support.v2beta.ICase>): void; + searchCases( + request: protos.google.cloud.support.v2beta.ISearchCasesRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2beta.ISearchCasesRequest, + protos.google.cloud.support.v2beta.ISearchCasesResponse|null|undefined, + protos.google.cloud.support.v2beta.ICase>): void; + searchCases( + request?: protos.google.cloud.support.v2beta.ISearchCasesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.support.v2beta.ISearchCasesRequest, + protos.google.cloud.support.v2beta.ISearchCasesResponse|null|undefined, + protos.google.cloud.support.v2beta.ICase>, + callback?: PaginationCallback< + protos.google.cloud.support.v2beta.ISearchCasesRequest, + protos.google.cloud.support.v2beta.ISearchCasesResponse|null|undefined, + protos.google.cloud.support.v2beta.ICase>): + Promise<[ + protos.google.cloud.support.v2beta.ICase[], + protos.google.cloud.support.v2beta.ISearchCasesRequest|null, + protos.google.cloud.support.v2beta.ISearchCasesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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.support.v2beta.ISearchCasesRequest, + protos.google.cloud.support.v2beta.ISearchCasesResponse|null|undefined, + protos.google.cloud.support.v2beta.ICase>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchCases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchCases request %j', request); + return this.innerApiCalls + .searchCases(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.support.v2beta.ICase[], + protos.google.cloud.support.v2beta.ISearchCasesRequest|null, + protos.google.cloud.support.v2beta.ISearchCasesResponse + ]) => { + this._log.info('searchCases values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `searchCases`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The name of the parent resource to search for cases under. + * @param {string} request.query + * An expression used to filter cases. + * + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * + * - `organization`: An organization name in the form + * `organizations/`. + * - `project`: A project name in the form `projects/`. + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * You must specify either `organization` or `project`. + * + * To search across `displayName`, `description`, and comments, use a global + * restriction with no keyword or operator. For example, `"my search"`. + * + * To search only cases updated after a certain date, use `update_time` + * restricted with that particular date, time, and timezone in ISO datetime + * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + * `update_time` only supports the greater than operator (`>`). + * + * Examples: + * + * - `organization="organizations/123456789"` + * - `project="projects/my-project-id"` + * - `project="projects/123456789"` + * - `organization="organizations/123456789" AND state=CLOSED` + * - `project="projects/my-project-id" AND creator.email="tester@example.com"` + * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. The default page + * size is 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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.support.v2beta.Case|Case} 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 `searchCasesAsync()` + * 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. + */ + searchCasesStream( + request?: protos.google.cloud.support.v2beta.ISearchCasesRequest, + 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['searchCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('searchCases stream %j', request); + return this.descriptors.page.searchCases.createStream( + this.innerApiCalls.searchCases as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchCases`, 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 + * The name of the parent resource to search for cases under. + * @param {string} request.query + * An expression used to filter cases. + * + * Expressions use the following fields separated by `AND` and specified with + * `=`: + * + * - `organization`: An organization name in the form + * `organizations/`. + * - `project`: A project name in the form `projects/`. + * - `state`: Can be `OPEN` or `CLOSED`. + * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * You must specify either `organization` or `project`. + * + * To search across `displayName`, `description`, and comments, use a global + * restriction with no keyword or operator. For example, `"my search"`. + * + * To search only cases updated after a certain date, use `update_time` + * restricted with that particular date, time, and timezone in ISO datetime + * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + * `update_time` only supports the greater than operator (`>`). + * + * Examples: + * + * - `organization="organizations/123456789"` + * - `project="projects/my-project-id"` + * - `project="projects/123456789"` + * - `organization="organizations/123456789" AND state=CLOSED` + * - `project="projects/my-project-id" AND creator.email="tester@example.com"` + * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. The default page + * size is 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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.support.v2beta.Case|Case}. 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/v2beta/case_service.search_cases.js + * region_tag:cloudsupport_v2beta_generated_CaseService_SearchCases_async + */ + searchCasesAsync( + request?: protos.google.cloud.support.v2beta.ISearchCasesRequest, + 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['searchCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('searchCases iterate %j', request); + return this.descriptors.page.searchCases.asyncIterate( + this.innerApiCalls['searchCases'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Retrieve valid classifications to use when creating a support case. + * + * Classifications are hierarchical. Each classification is a string + * containing all levels of the hierarchy separated by `" > "`. For example, + * `"Technical Issue > Compute > Compute Engine"`. + * + * Classification IDs returned by this endpoint are valid for at least six + * months. When a classification is deactivated, this endpoint immediately + * stops returning it. After six months, `case.create` requests using the + * classification will fail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.query + * An expression used to filter case classifications. + * + * If it's an empty string, then no filtering happens. Otherwise, case + * classifications will be returned that match the filter. + * @param {number} request.pageSize + * The maximum number of classifications fetched with each request. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {google.cloud.support.v2beta.Product} [request.product] + * Optional. The product to return case classifications 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 Array of {@link protos.google.cloud.support.v2beta.CaseClassification|CaseClassification}. + * 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 `searchCaseClassificationsAsync()` + * 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. + */ + searchCaseClassifications( + request?: protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.ICaseClassification[], + protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest|null, + protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse + ]>; + searchCaseClassifications( + request: protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, + protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse|null|undefined, + protos.google.cloud.support.v2beta.ICaseClassification>): void; + searchCaseClassifications( + request: protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, + protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse|null|undefined, + protos.google.cloud.support.v2beta.ICaseClassification>): void; + searchCaseClassifications( + request?: protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, + protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse|null|undefined, + protos.google.cloud.support.v2beta.ICaseClassification>, + callback?: PaginationCallback< + protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, + protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse|null|undefined, + protos.google.cloud.support.v2beta.ICaseClassification>): + Promise<[ + protos.google.cloud.support.v2beta.ICaseClassification[], + protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest|null, + protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, + protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse|null|undefined, + protos.google.cloud.support.v2beta.ICaseClassification>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchCaseClassifications values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchCaseClassifications request %j', request); + return this.innerApiCalls + .searchCaseClassifications(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.support.v2beta.ICaseClassification[], + protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest|null, + protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse + ]) => { + this._log.info('searchCaseClassifications values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `searchCaseClassifications`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.query + * An expression used to filter case classifications. + * + * If it's an empty string, then no filtering happens. Otherwise, case + * classifications will be returned that match the filter. + * @param {number} request.pageSize + * The maximum number of classifications fetched with each request. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {google.cloud.support.v2beta.Product} [request.product] + * Optional. The product to return case classifications for. + * @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.support.v2beta.CaseClassification|CaseClassification} 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 `searchCaseClassificationsAsync()` + * 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. + */ + searchCaseClassificationsStream( + request?: protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchCaseClassifications']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('searchCaseClassifications stream %j', request); + return this.descriptors.page.searchCaseClassifications.createStream( + this.innerApiCalls.searchCaseClassifications as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchCaseClassifications`, 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.query + * An expression used to filter case classifications. + * + * If it's an empty string, then no filtering happens. Otherwise, case + * classifications will be returned that match the filter. + * @param {number} request.pageSize + * The maximum number of classifications fetched with each request. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {google.cloud.support.v2beta.Product} [request.product] + * Optional. The product to return case classifications for. + * @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.support.v2beta.CaseClassification|CaseClassification}. 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/v2beta/case_service.search_case_classifications.js + * region_tag:cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_async + */ + searchCaseClassificationsAsync( + request?: protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchCaseClassifications']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('searchCaseClassifications iterate %j', request); + return this.descriptors.page.searchCaseClassifications.asyncIterate( + this.innerApiCalls['searchCaseClassifications'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization:string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName).organization; + } + + /** + * Return a fully-qualified organizationCase resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @returns {string} Resource name string. + */ + organizationCasePath(organization:string,caseParam:string) { + return this.pathTemplates.organizationCasePathTemplate.render({ + organization: organization, + case: caseParam, + }); + } + + /** + * Parse the organization from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; + } + + /** + * Parse the case from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; + } + + /** + * Return a fully-qualified organizationCaseAttachmentId resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ + organization: organization, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the organization from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; + } + + /** + * Parse the case from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified organizationCaseComment resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.render({ + organization: organization, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the organization from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; + } + + /** + * Parse the case from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; + } + + /** + * Parse the comment from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; + } + + /** + * Return a fully-qualified organizationCaseEmailMessages resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} email_message + * @returns {string} Resource name string. + */ + organizationCaseEmailMessagesPath(organization:string,caseParam:string,emailMessage:string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.render({ + organization: organization, + case: caseParam, + email_message: emailMessage, + }); + } + + /** + * Parse the organization from OrganizationCaseEmailMessages resource. + * + * @param {string} organizationCaseEmailMessagesName + * A fully-qualified path representing organization_case_emailMessages resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).organization; + } + + /** + * Parse the case from OrganizationCaseEmailMessages resource. + * + * @param {string} organizationCaseEmailMessagesName + * A fully-qualified path representing organization_case_emailMessages resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).case; + } + + /** + * Parse the email_message from OrganizationCaseEmailMessages resource. + * + * @param {string} organizationCaseEmailMessagesName + * A fully-qualified path representing organization_case_emailMessages resource. + * @returns {string} A string representing the email_message. + */ + matchEmailMessageFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).email_message; + } + + /** + * Return a fully-qualified projectCase resource name string. + * + * @param {string} project + * @param {string} caseParam + * @returns {string} Resource name string. + */ + projectCasePath(project:string,caseParam:string) { + return this.pathTemplates.projectCasePathTemplate.render({ + project: project, + case: caseParam, + }); + } + + /** + * Parse the project from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; + } + + /** + * Parse the case from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; + } + + /** + * Return a fully-qualified projectCaseAttachmentId resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ + project: project, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the project from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; + } + + /** + * Parse the case from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified projectCaseComment resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + projectCaseCommentPath(project:string,caseParam:string,comment:string) { + return this.pathTemplates.projectCaseCommentPathTemplate.render({ + project: project, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the project from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; + } + + /** + * Parse the case from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; + } + + /** + * Parse the comment from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; + } + + /** + * Return a fully-qualified projectCaseEmailMessages resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} email_message + * @returns {string} Resource name string. + */ + projectCaseEmailMessagesPath(project:string,caseParam:string,emailMessage:string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.render({ + project: project, + case: caseParam, + email_message: emailMessage, + }); + } + + /** + * Parse the project from ProjectCaseEmailMessages resource. + * + * @param {string} projectCaseEmailMessagesName + * A fully-qualified path representing project_case_emailMessages resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).project; + } + + /** + * Parse the case from ProjectCaseEmailMessages resource. + * + * @param {string} projectCaseEmailMessagesName + * A fully-qualified path representing project_case_emailMessages resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).case; + } + + /** + * Parse the email_message from ProjectCaseEmailMessages resource. + * + * @param {string} projectCaseEmailMessagesName + * A fully-qualified path representing project_case_emailMessages resource. + * @returns {string} A string representing the email_message. + */ + matchEmailMessageFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).email_message; + } + + /** + * 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.caseServiceStub && !this._terminated) { + return this.caseServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/case_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2beta/case_service_client_config.json new file mode 100644 index 00000000000..bede0d8c3e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/case_service_client_config.json @@ -0,0 +1,78 @@ +{ + "interfaces": { + "google.cloud.support.v2beta.CaseService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetCase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "SearchCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateCase": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCase": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "EscalateCase": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CloseCase": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchCaseClassifications": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/case_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2beta/case_service_proto_list.json new file mode 100644 index 00000000000..a623d27a7fd --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/case_service_proto_list.json @@ -0,0 +1,14 @@ +[ + "../../protos/google/cloud/support/v2beta/actor.proto", + "../../protos/google/cloud/support/v2beta/attachment.proto", + "../../protos/google/cloud/support/v2beta/attachment_service.proto", + "../../protos/google/cloud/support/v2beta/case.proto", + "../../protos/google/cloud/support/v2beta/case_service.proto", + "../../protos/google/cloud/support/v2beta/comment.proto", + "../../protos/google/cloud/support/v2beta/comment_service.proto", + "../../protos/google/cloud/support/v2beta/content.proto", + "../../protos/google/cloud/support/v2beta/email_message.proto", + "../../protos/google/cloud/support/v2beta/escalation.proto", + "../../protos/google/cloud/support/v2beta/feed_item.proto", + "../../protos/google/cloud/support/v2beta/feed_service.proto" +] diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client.ts new file mode 100644 index 00000000000..f7c02630c2c --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client.ts @@ -0,0 +1,1133 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, PaginationCallback, GaxCall} 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/v2beta/comment_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './comment_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service to manage comments on cases. + * @class + * @memberof v2beta + */ +export class CommentServiceClient { + 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('support'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + commentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CommentServiceClient. + * + * @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 CommentServiceClient({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 CommentServiceClient; + 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 = 'cloudsupport.' + 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; + } + + // 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 = { + organizationCasePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}' + ), + organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' + ), + organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/comments/{comment}' + ), + organizationCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/emailMessages/{email_message}' + ), + projectCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}' + ), + projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/attachments/{attachment_id}' + ), + projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/comments/{comment}' + ), + projectCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/emailMessages/{email_message}' + ), + }; + + // 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 = { + listComments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'comments') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.support.v2beta.CommentService', 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.commentServiceStub) { + return this.commentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.support.v2beta.CommentService. + this.commentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.support.v2beta.CommentService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.support.v2beta.CommentService, + 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 commentServiceStubMethods = + ['listComments', 'createComment', 'getComment']; + for (const methodName of commentServiceStubMethods) { + const callPromise = this.commentServiceStub.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] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.commentServiceStub; + } + + /** + * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Add a new comment to a case. + * + * The comment must have the following fields set: `body`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case to which the comment should be added. + * @param {google.cloud.support.v2beta.Comment} request.comment + * Required. The comment to be added. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2beta.Comment|Comment}. + * 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/v2beta/comment_service.create_comment.js + * region_tag:cloudsupport_v2beta_generated_CommentService_CreateComment_async + */ + createComment( + request?: protos.google.cloud.support.v2beta.ICreateCommentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.ICreateCommentRequest|undefined, {}|undefined + ]>; + createComment( + request: protos.google.cloud.support.v2beta.ICreateCommentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.ICreateCommentRequest|null|undefined, + {}|null|undefined>): void; + createComment( + request: protos.google.cloud.support.v2beta.ICreateCommentRequest, + callback: Callback< + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.ICreateCommentRequest|null|undefined, + {}|null|undefined>): void; + createComment( + request?: protos.google.cloud.support.v2beta.ICreateCommentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.ICreateCommentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.ICreateCommentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.ICreateCommentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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('createComment request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.ICreateCommentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createComment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createComment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.ICreateCommentRequest|undefined, + {}|undefined + ]) => { + this._log.info('createComment 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 a comment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the comment 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.support.v2beta.Comment|Comment}. + * 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/v2beta/comment_service.get_comment.js + * region_tag:cloudsupport_v2beta_generated_CommentService_GetComment_async + */ + getComment( + request?: protos.google.cloud.support.v2beta.IGetCommentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.IGetCommentRequest|undefined, {}|undefined + ]>; + getComment( + request: protos.google.cloud.support.v2beta.IGetCommentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.IGetCommentRequest|null|undefined, + {}|null|undefined>): void; + getComment( + request: protos.google.cloud.support.v2beta.IGetCommentRequest, + callback: Callback< + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.IGetCommentRequest|null|undefined, + {}|null|undefined>): void; + getComment( + request?: protos.google.cloud.support.v2beta.IGetCommentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.IGetCommentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.IGetCommentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.IGetCommentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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('getComment request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.IGetCommentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getComment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getComment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.support.v2beta.IComment, + protos.google.cloud.support.v2beta.IGetCommentRequest|undefined, + {}|undefined + ]) => { + this._log.info('getComment 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; + }); + } + + /** + * List all the comments associated with a case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case for which to list comments. + * @param {number} request.pageSize + * The maximum number of comments to fetch. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is 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 Array of {@link protos.google.cloud.support.v2beta.Comment|Comment}. + * 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 `listCommentsAsync()` + * 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. + */ + listComments( + request?: protos.google.cloud.support.v2beta.IListCommentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.IComment[], + protos.google.cloud.support.v2beta.IListCommentsRequest|null, + protos.google.cloud.support.v2beta.IListCommentsResponse + ]>; + listComments( + request: protos.google.cloud.support.v2beta.IListCommentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2beta.IListCommentsRequest, + protos.google.cloud.support.v2beta.IListCommentsResponse|null|undefined, + protos.google.cloud.support.v2beta.IComment>): void; + listComments( + request: protos.google.cloud.support.v2beta.IListCommentsRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2beta.IListCommentsRequest, + protos.google.cloud.support.v2beta.IListCommentsResponse|null|undefined, + protos.google.cloud.support.v2beta.IComment>): void; + listComments( + request?: protos.google.cloud.support.v2beta.IListCommentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.support.v2beta.IListCommentsRequest, + protos.google.cloud.support.v2beta.IListCommentsResponse|null|undefined, + protos.google.cloud.support.v2beta.IComment>, + callback?: PaginationCallback< + protos.google.cloud.support.v2beta.IListCommentsRequest, + protos.google.cloud.support.v2beta.IListCommentsResponse|null|undefined, + protos.google.cloud.support.v2beta.IComment>): + Promise<[ + protos.google.cloud.support.v2beta.IComment[], + protos.google.cloud.support.v2beta.IListCommentsRequest|null, + protos.google.cloud.support.v2beta.IListCommentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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.support.v2beta.IListCommentsRequest, + protos.google.cloud.support.v2beta.IListCommentsResponse|null|undefined, + protos.google.cloud.support.v2beta.IComment>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listComments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listComments request %j', request); + return this.innerApiCalls + .listComments(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.support.v2beta.IComment[], + protos.google.cloud.support.v2beta.IListCommentsRequest|null, + protos.google.cloud.support.v2beta.IListCommentsResponse + ]) => { + this._log.info('listComments values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listComments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case for which to list comments. + * @param {number} request.pageSize + * The maximum number of comments to fetch. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is returned. + * @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.support.v2beta.Comment|Comment} 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 `listCommentsAsync()` + * 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. + */ + listCommentsStream( + request?: protos.google.cloud.support.v2beta.IListCommentsRequest, + 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['listComments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listComments stream %j', request); + return this.descriptors.page.listComments.createStream( + this.innerApiCalls.listComments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listComments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the case for which to list comments. + * @param {number} request.pageSize + * The maximum number of comments to fetch. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is returned. + * @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.support.v2beta.Comment|Comment}. 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/v2beta/comment_service.list_comments.js + * region_tag:cloudsupport_v2beta_generated_CommentService_ListComments_async + */ + listCommentsAsync( + request?: protos.google.cloud.support.v2beta.IListCommentsRequest, + 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['listComments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listComments iterate %j', request); + return this.descriptors.page.listComments.asyncIterate( + this.innerApiCalls['listComments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organizationCase resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @returns {string} Resource name string. + */ + organizationCasePath(organization:string,caseParam:string) { + return this.pathTemplates.organizationCasePathTemplate.render({ + organization: organization, + case: caseParam, + }); + } + + /** + * Parse the organization from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; + } + + /** + * Parse the case from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; + } + + /** + * Return a fully-qualified organizationCaseAttachmentId resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ + organization: organization, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the organization from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; + } + + /** + * Parse the case from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified organizationCaseComment resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.render({ + organization: organization, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the organization from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; + } + + /** + * Parse the case from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; + } + + /** + * Parse the comment from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; + } + + /** + * Return a fully-qualified organizationCaseEmailMessages resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} email_message + * @returns {string} Resource name string. + */ + organizationCaseEmailMessagesPath(organization:string,caseParam:string,emailMessage:string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.render({ + organization: organization, + case: caseParam, + email_message: emailMessage, + }); + } + + /** + * Parse the organization from OrganizationCaseEmailMessages resource. + * + * @param {string} organizationCaseEmailMessagesName + * A fully-qualified path representing organization_case_emailMessages resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).organization; + } + + /** + * Parse the case from OrganizationCaseEmailMessages resource. + * + * @param {string} organizationCaseEmailMessagesName + * A fully-qualified path representing organization_case_emailMessages resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).case; + } + + /** + * Parse the email_message from OrganizationCaseEmailMessages resource. + * + * @param {string} organizationCaseEmailMessagesName + * A fully-qualified path representing organization_case_emailMessages resource. + * @returns {string} A string representing the email_message. + */ + matchEmailMessageFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).email_message; + } + + /** + * Return a fully-qualified projectCase resource name string. + * + * @param {string} project + * @param {string} caseParam + * @returns {string} Resource name string. + */ + projectCasePath(project:string,caseParam:string) { + return this.pathTemplates.projectCasePathTemplate.render({ + project: project, + case: caseParam, + }); + } + + /** + * Parse the project from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; + } + + /** + * Parse the case from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; + } + + /** + * Return a fully-qualified projectCaseAttachmentId resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ + project: project, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the project from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; + } + + /** + * Parse the case from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified projectCaseComment resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + projectCaseCommentPath(project:string,caseParam:string,comment:string) { + return this.pathTemplates.projectCaseCommentPathTemplate.render({ + project: project, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the project from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; + } + + /** + * Parse the case from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; + } + + /** + * Parse the comment from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; + } + + /** + * Return a fully-qualified projectCaseEmailMessages resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} email_message + * @returns {string} Resource name string. + */ + projectCaseEmailMessagesPath(project:string,caseParam:string,emailMessage:string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.render({ + project: project, + case: caseParam, + email_message: emailMessage, + }); + } + + /** + * Parse the project from ProjectCaseEmailMessages resource. + * + * @param {string} projectCaseEmailMessagesName + * A fully-qualified path representing project_case_emailMessages resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).project; + } + + /** + * Parse the case from ProjectCaseEmailMessages resource. + * + * @param {string} projectCaseEmailMessagesName + * A fully-qualified path representing project_case_emailMessages resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).case; + } + + /** + * Parse the email_message from ProjectCaseEmailMessages resource. + * + * @param {string} projectCaseEmailMessagesName + * A fully-qualified path representing project_case_emailMessages resource. + * @returns {string} A string representing the email_message. + */ + matchEmailMessageFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).email_message; + } + + /** + * 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.commentServiceStub && !this._terminated) { + return this.commentServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client_config.json new file mode 100644 index 00000000000..3d574dddc65 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client_config.json @@ -0,0 +1,52 @@ +{ + "interfaces": { + "google.cloud.support.v2beta.CommentService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListComments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateComment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetComment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_proto_list.json new file mode 100644 index 00000000000..a623d27a7fd --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_proto_list.json @@ -0,0 +1,14 @@ +[ + "../../protos/google/cloud/support/v2beta/actor.proto", + "../../protos/google/cloud/support/v2beta/attachment.proto", + "../../protos/google/cloud/support/v2beta/attachment_service.proto", + "../../protos/google/cloud/support/v2beta/case.proto", + "../../protos/google/cloud/support/v2beta/case_service.proto", + "../../protos/google/cloud/support/v2beta/comment.proto", + "../../protos/google/cloud/support/v2beta/comment_service.proto", + "../../protos/google/cloud/support/v2beta/content.proto", + "../../protos/google/cloud/support/v2beta/email_message.proto", + "../../protos/google/cloud/support/v2beta/escalation.proto", + "../../protos/google/cloud/support/v2beta/feed_item.proto", + "../../protos/google/cloud/support/v2beta/feed_service.proto" +] diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client.ts new file mode 100644 index 00000000000..94bcb6de26d --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client.ts @@ -0,0 +1,966 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, PaginationCallback, GaxCall} 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/v2beta/feed_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './feed_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service to view case feed items. + * @class + * @memberof v2beta + */ +export class FeedServiceClient { + 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('support'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + feedServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FeedServiceClient. + * + * @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 FeedServiceClient({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 FeedServiceClient; + 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 = 'cloudsupport.' + 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; + } + + // 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 = { + organizationCasePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}' + ), + organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' + ), + organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/comments/{comment}' + ), + organizationCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/emailMessages/{email_message}' + ), + projectCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}' + ), + projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/attachments/{attachment_id}' + ), + projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/comments/{comment}' + ), + projectCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/emailMessages/{email_message}' + ), + }; + + // 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 = { + showFeed: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'feedItems') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.support.v2beta.FeedService', 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.feedServiceStub) { + return this.feedServiceStub; + } + + // Put together the "service stub" for + // google.cloud.support.v2beta.FeedService. + this.feedServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.support.v2beta.FeedService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.support.v2beta.FeedService, + 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 feedServiceStubMethods = + ['showFeed']; + for (const methodName of feedServiceStubMethods) { + const callPromise = this.feedServiceStub.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] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.feedServiceStub; + } + + /** + * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Show items in the feed of this case, including case emails, + * attachments, and comments. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the case for which feed items should be + * listed. + * @param {string} [request.orderBy] + * Optional. Field to order feed items by, followed by `asc` or `desc` + * postfix. The only valid field is + * `creation_time`. This list is case-insensitive, default sorting order is + * ascending, and the redundant space characters are insignificant. + * + * Example: `creation_time desc` + * @param {number} [request.pageSize] + * Optional. The maximum number of feed items fetched with each request. + * @param {string} [request.pageToken] + * Optional. A token identifying the page of results to return. If + * unspecified, it retrieves the first page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2beta.FeedItem|FeedItem}. + * 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 `showFeedAsync()` + * 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. + */ + showFeed( + request?: protos.google.cloud.support.v2beta.IShowFeedRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.support.v2beta.IFeedItem[], + protos.google.cloud.support.v2beta.IShowFeedRequest|null, + protos.google.cloud.support.v2beta.IShowFeedResponse + ]>; + showFeed( + request: protos.google.cloud.support.v2beta.IShowFeedRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2beta.IShowFeedRequest, + protos.google.cloud.support.v2beta.IShowFeedResponse|null|undefined, + protos.google.cloud.support.v2beta.IFeedItem>): void; + showFeed( + request: protos.google.cloud.support.v2beta.IShowFeedRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2beta.IShowFeedRequest, + protos.google.cloud.support.v2beta.IShowFeedResponse|null|undefined, + protos.google.cloud.support.v2beta.IFeedItem>): void; + showFeed( + request?: protos.google.cloud.support.v2beta.IShowFeedRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.support.v2beta.IShowFeedRequest, + protos.google.cloud.support.v2beta.IShowFeedResponse|null|undefined, + protos.google.cloud.support.v2beta.IFeedItem>, + callback?: PaginationCallback< + protos.google.cloud.support.v2beta.IShowFeedRequest, + protos.google.cloud.support.v2beta.IShowFeedResponse|null|undefined, + protos.google.cloud.support.v2beta.IFeedItem>): + Promise<[ + protos.google.cloud.support.v2beta.IFeedItem[], + protos.google.cloud.support.v2beta.IShowFeedRequest|null, + protos.google.cloud.support.v2beta.IShowFeedResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = 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.support.v2beta.IShowFeedRequest, + protos.google.cloud.support.v2beta.IShowFeedResponse|null|undefined, + protos.google.cloud.support.v2beta.IFeedItem>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('showFeed values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('showFeed request %j', request); + return this.innerApiCalls + .showFeed(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.support.v2beta.IFeedItem[], + protos.google.cloud.support.v2beta.IShowFeedRequest|null, + protos.google.cloud.support.v2beta.IShowFeedResponse + ]) => { + this._log.info('showFeed values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `showFeed`, 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 case for which feed items should be + * listed. + * @param {string} [request.orderBy] + * Optional. Field to order feed items by, followed by `asc` or `desc` + * postfix. The only valid field is + * `creation_time`. This list is case-insensitive, default sorting order is + * ascending, and the redundant space characters are insignificant. + * + * Example: `creation_time desc` + * @param {number} [request.pageSize] + * Optional. The maximum number of feed items fetched with each request. + * @param {string} [request.pageToken] + * Optional. A token identifying the page of results to return. If + * unspecified, it retrieves the first page. + * @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.support.v2beta.FeedItem|FeedItem} 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 `showFeedAsync()` + * 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. + */ + showFeedStream( + request?: protos.google.cloud.support.v2beta.IShowFeedRequest, + 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['showFeed']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('showFeed stream %j', request); + return this.descriptors.page.showFeed.createStream( + this.innerApiCalls.showFeed as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `showFeed`, 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 case for which feed items should be + * listed. + * @param {string} [request.orderBy] + * Optional. Field to order feed items by, followed by `asc` or `desc` + * postfix. The only valid field is + * `creation_time`. This list is case-insensitive, default sorting order is + * ascending, and the redundant space characters are insignificant. + * + * Example: `creation_time desc` + * @param {number} [request.pageSize] + * Optional. The maximum number of feed items fetched with each request. + * @param {string} [request.pageToken] + * Optional. A token identifying the page of results to return. If + * unspecified, it retrieves the first page. + * @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.support.v2beta.FeedItem|FeedItem}. 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/v2beta/feed_service.show_feed.js + * region_tag:cloudsupport_v2beta_generated_FeedService_ShowFeed_async + */ + showFeedAsync( + request?: protos.google.cloud.support.v2beta.IShowFeedRequest, + 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['showFeed']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('showFeed iterate %j', request); + return this.descriptors.page.showFeed.asyncIterate( + this.innerApiCalls['showFeed'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organizationCase resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @returns {string} Resource name string. + */ + organizationCasePath(organization:string,caseParam:string) { + return this.pathTemplates.organizationCasePathTemplate.render({ + organization: organization, + case: caseParam, + }); + } + + /** + * Parse the organization from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; + } + + /** + * Parse the case from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; + } + + /** + * Return a fully-qualified organizationCaseAttachmentId resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ + organization: organization, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the organization from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; + } + + /** + * Parse the case from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified organizationCaseComment resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.render({ + organization: organization, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the organization from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; + } + + /** + * Parse the case from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; + } + + /** + * Parse the comment from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; + } + + /** + * Return a fully-qualified organizationCaseEmailMessages resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} email_message + * @returns {string} Resource name string. + */ + organizationCaseEmailMessagesPath(organization:string,caseParam:string,emailMessage:string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.render({ + organization: organization, + case: caseParam, + email_message: emailMessage, + }); + } + + /** + * Parse the organization from OrganizationCaseEmailMessages resource. + * + * @param {string} organizationCaseEmailMessagesName + * A fully-qualified path representing organization_case_emailMessages resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).organization; + } + + /** + * Parse the case from OrganizationCaseEmailMessages resource. + * + * @param {string} organizationCaseEmailMessagesName + * A fully-qualified path representing organization_case_emailMessages resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).case; + } + + /** + * Parse the email_message from OrganizationCaseEmailMessages resource. + * + * @param {string} organizationCaseEmailMessagesName + * A fully-qualified path representing organization_case_emailMessages resource. + * @returns {string} A string representing the email_message. + */ + matchEmailMessageFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { + return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).email_message; + } + + /** + * Return a fully-qualified projectCase resource name string. + * + * @param {string} project + * @param {string} caseParam + * @returns {string} Resource name string. + */ + projectCasePath(project:string,caseParam:string) { + return this.pathTemplates.projectCasePathTemplate.render({ + project: project, + case: caseParam, + }); + } + + /** + * Parse the project from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; + } + + /** + * Parse the case from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; + } + + /** + * Return a fully-qualified projectCaseAttachmentId resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ + project: project, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the project from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; + } + + /** + * Parse the case from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; + } + + /** + * Parse the attachment_id from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; + } + + /** + * Return a fully-qualified projectCaseComment resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + projectCaseCommentPath(project:string,caseParam:string,comment:string) { + return this.pathTemplates.projectCaseCommentPathTemplate.render({ + project: project, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the project from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; + } + + /** + * Parse the case from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; + } + + /** + * Parse the comment from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; + } + + /** + * Return a fully-qualified projectCaseEmailMessages resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} email_message + * @returns {string} Resource name string. + */ + projectCaseEmailMessagesPath(project:string,caseParam:string,emailMessage:string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.render({ + project: project, + case: caseParam, + email_message: emailMessage, + }); + } + + /** + * Parse the project from ProjectCaseEmailMessages resource. + * + * @param {string} projectCaseEmailMessagesName + * A fully-qualified path representing project_case_emailMessages resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).project; + } + + /** + * Parse the case from ProjectCaseEmailMessages resource. + * + * @param {string} projectCaseEmailMessagesName + * A fully-qualified path representing project_case_emailMessages resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).case; + } + + /** + * Parse the email_message from ProjectCaseEmailMessages resource. + * + * @param {string} projectCaseEmailMessagesName + * A fully-qualified path representing project_case_emailMessages resource. + * @returns {string} A string representing the email_message. + */ + matchEmailMessageFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { + return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).email_message; + } + + /** + * 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.feedServiceStub && !this._terminated) { + return this.feedServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client_config.json new file mode 100644 index 00000000000..469b9ebc14f --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client_config.json @@ -0,0 +1,43 @@ +{ + "interfaces": { + "google.cloud.support.v2beta.FeedService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ShowFeed": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_proto_list.json new file mode 100644 index 00000000000..a623d27a7fd --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_proto_list.json @@ -0,0 +1,14 @@ +[ + "../../protos/google/cloud/support/v2beta/actor.proto", + "../../protos/google/cloud/support/v2beta/attachment.proto", + "../../protos/google/cloud/support/v2beta/attachment_service.proto", + "../../protos/google/cloud/support/v2beta/case.proto", + "../../protos/google/cloud/support/v2beta/case_service.proto", + "../../protos/google/cloud/support/v2beta/comment.proto", + "../../protos/google/cloud/support/v2beta/comment_service.proto", + "../../protos/google/cloud/support/v2beta/content.proto", + "../../protos/google/cloud/support/v2beta/email_message.proto", + "../../protos/google/cloud/support/v2beta/escalation.proto", + "../../protos/google/cloud/support/v2beta/feed_item.proto", + "../../protos/google/cloud/support/v2beta/feed_service.proto" +] diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/gapic_metadata.json b/owl-bot-staging/google-cloud-support/src/v2beta/gapic_metadata.json new file mode 100644 index 00000000000..94afc596001 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/gapic_metadata.json @@ -0,0 +1,229 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.support.v2beta", + "libraryPackage": "@google-cloud/support", + "services": { + "CaseAttachmentService": { + "clients": { + "grpc": { + "libraryClient": "CaseAttachmentServiceClient", + "rpcs": { + "GetAttachment": { + "methods": [ + "getAttachment" + ] + }, + "ListAttachments": { + "methods": [ + "listAttachments", + "listAttachmentsStream", + "listAttachmentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CaseAttachmentServiceClient", + "rpcs": { + "GetAttachment": { + "methods": [ + "getAttachment" + ] + }, + "ListAttachments": { + "methods": [ + "listAttachments", + "listAttachmentsStream", + "listAttachmentsAsync" + ] + } + } + } + } + }, + "CaseService": { + "clients": { + "grpc": { + "libraryClient": "CaseServiceClient", + "rpcs": { + "GetCase": { + "methods": [ + "getCase" + ] + }, + "CreateCase": { + "methods": [ + "createCase" + ] + }, + "UpdateCase": { + "methods": [ + "updateCase" + ] + }, + "EscalateCase": { + "methods": [ + "escalateCase" + ] + }, + "CloseCase": { + "methods": [ + "closeCase" + ] + }, + "ListCases": { + "methods": [ + "listCases", + "listCasesStream", + "listCasesAsync" + ] + }, + "SearchCases": { + "methods": [ + "searchCases", + "searchCasesStream", + "searchCasesAsync" + ] + }, + "SearchCaseClassifications": { + "methods": [ + "searchCaseClassifications", + "searchCaseClassificationsStream", + "searchCaseClassificationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CaseServiceClient", + "rpcs": { + "GetCase": { + "methods": [ + "getCase" + ] + }, + "CreateCase": { + "methods": [ + "createCase" + ] + }, + "UpdateCase": { + "methods": [ + "updateCase" + ] + }, + "EscalateCase": { + "methods": [ + "escalateCase" + ] + }, + "CloseCase": { + "methods": [ + "closeCase" + ] + }, + "ListCases": { + "methods": [ + "listCases", + "listCasesStream", + "listCasesAsync" + ] + }, + "SearchCases": { + "methods": [ + "searchCases", + "searchCasesStream", + "searchCasesAsync" + ] + }, + "SearchCaseClassifications": { + "methods": [ + "searchCaseClassifications", + "searchCaseClassificationsStream", + "searchCaseClassificationsAsync" + ] + } + } + } + } + }, + "CommentService": { + "clients": { + "grpc": { + "libraryClient": "CommentServiceClient", + "rpcs": { + "CreateComment": { + "methods": [ + "createComment" + ] + }, + "GetComment": { + "methods": [ + "getComment" + ] + }, + "ListComments": { + "methods": [ + "listComments", + "listCommentsStream", + "listCommentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CommentServiceClient", + "rpcs": { + "CreateComment": { + "methods": [ + "createComment" + ] + }, + "GetComment": { + "methods": [ + "getComment" + ] + }, + "ListComments": { + "methods": [ + "listComments", + "listCommentsStream", + "listCommentsAsync" + ] + } + } + } + } + }, + "FeedService": { + "clients": { + "grpc": { + "libraryClient": "FeedServiceClient", + "rpcs": { + "ShowFeed": { + "methods": [ + "showFeed", + "showFeedStream", + "showFeedAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FeedServiceClient", + "rpcs": { + "ShowFeed": { + "methods": [ + "showFeed", + "showFeedStream", + "showFeedAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/index.ts b/owl-bot-staging/google-cloud-support/src/v2beta/index.ts new file mode 100644 index 00000000000..987b0997e1a --- /dev/null +++ b/owl-bot-staging/google-cloud-support/src/v2beta/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 {CaseAttachmentServiceClient} from './case_attachment_service_client'; +export {CaseServiceClient} from './case_service_client'; +export {CommentServiceClient} from './comment_service_client'; +export {FeedServiceClient} from './feed_service_client'; diff --git a/owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..de71d5c9768 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.js @@ -0,0 +1,29 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 support = require('@google-cloud/support'); + +function main() { + const caseAttachmentServiceClient = new support.CaseAttachmentServiceClient(); + const caseServiceClient = new support.CaseServiceClient(); + const commentServiceClient = new support.CommentServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..f3b5a06d0b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.ts @@ -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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {CaseAttachmentServiceClient, CaseServiceClient, CommentServiceClient} from '@google-cloud/support'; + +// check that the client class type name can be used +function doStuffWithCaseAttachmentServiceClient(client: CaseAttachmentServiceClient) { + client.close(); +} +function doStuffWithCaseServiceClient(client: CaseServiceClient) { + client.close(); +} +function doStuffWithCommentServiceClient(client: CommentServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const caseAttachmentServiceClient = new CaseAttachmentServiceClient(); + doStuffWithCaseAttachmentServiceClient(caseAttachmentServiceClient); + // check that the client instance can be created + const caseServiceClient = new CaseServiceClient(); + doStuffWithCaseServiceClient(caseServiceClient); + // check that the client instance can be created + const commentServiceClient = new CommentServiceClient(); + doStuffWithCommentServiceClient(commentServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-support/system-test/install.ts b/owl-bot-staging/google-cloud-support/system-test/install.ts new file mode 100644 index 00000000000..394f3362d20 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/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-support/test/gapic_case_attachment_service_v2.ts b/owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2.ts new file mode 100644 index 00000000000..8950d03df9e --- /dev/null +++ b/owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2.ts @@ -0,0 +1,769 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 caseattachmentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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 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('v2.CaseAttachmentServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient(); + 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 = caseattachmentserviceModule.v2.CaseAttachmentServiceClient.servicePath; + assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = caseattachmentserviceModule.v2.CaseAttachmentServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 caseattachmentserviceModule.v2.CaseAttachmentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 caseattachmentserviceModule.v2.CaseAttachmentServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 caseattachmentserviceModule.v2.CaseAttachmentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = caseattachmentserviceModule.v2.CaseAttachmentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.caseAttachmentServiceStub, undefined); + await client.initialize(); + assert(client.caseAttachmentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.caseAttachmentServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.caseAttachmentServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + 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 caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + 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('listAttachments', () => { + it('invokes listAttachments without error', async () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + ]; + client.innerApiCalls.listAttachments = stubSimpleCall(expectedResponse); + const [response] = await client.listAttachments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAttachments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttachments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttachments without error using callback', async () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + ]; + client.innerApiCalls.listAttachments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAttachments( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2.IAttachment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAttachments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttachments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttachments with error', async () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAttachments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAttachments(request), expectedError); + const actualRequest = (client.innerApiCalls.listAttachments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttachments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttachmentsStream without error', async () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + ]; + client.descriptors.page.listAttachments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAttachmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Attachment[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.Attachment) => { + 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.listAttachments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAttachments, request)); + assert( + (client.descriptors.page.listAttachments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAttachmentsStream with error', async () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttachments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAttachmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Attachment[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.Attachment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAttachments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAttachments, request)); + assert( + (client.descriptors.page.listAttachments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttachments without error', async () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + ]; + client.descriptors.page.listAttachments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2.IAttachment[] = []; + const iterable = client.listAttachmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAttachments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAttachments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttachments with error', async () => { + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttachments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAttachmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2.IAttachment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAttachments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAttachments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('organizationCase', async () => { + const fakePath = "/rendered/path/organizationCase"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + }; + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCasePath', () => { + const result = client.organizationCasePath("organizationValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseName', () => { + const result = client.matchOrganizationFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseName', () => { + const result = client.matchCaseFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseAttachmentId', async () => { + const fakePath = "/rendered/path/organizationCaseAttachmentId"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseAttachmentIdPath', () => { + const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseComment', async () => { + const fakePath = "/rendered/path/organizationCaseComment"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseCommentPath', () => { + const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseCommentName', () => { + const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseCommentName', () => { + const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromOrganizationCaseCommentName', () => { + const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCase', async () => { + const fakePath = "/rendered/path/projectCase"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + }; + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCasePath', () => { + const result = client.projectCasePath("projectValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseName', () => { + const result = client.matchProjectFromProjectCaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseName', () => { + const result = client.matchCaseFromProjectCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseAttachmentId', async () => { + const fakePath = "/rendered/path/projectCaseAttachmentId"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseAttachmentIdPath', () => { + const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseAttachmentIdName', () => { + const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseAttachmentIdName', () => { + const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseComment', async () => { + const fakePath = "/rendered/path/projectCaseComment"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseCommentPath', () => { + const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseCommentName', () => { + const result = client.matchProjectFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseCommentName', () => { + const result = client.matchCaseFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromProjectCaseCommentName', () => { + const result = client.matchCommentFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2beta.ts b/owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2beta.ts new file mode 100644 index 00000000000..cdb95eee4b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2beta.ts @@ -0,0 +1,969 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 caseattachmentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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 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('v2beta.CaseAttachmentServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient(); + 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 = caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient.servicePath; + assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.caseAttachmentServiceStub, undefined); + await client.initialize(); + assert(client.caseAttachmentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.caseAttachmentServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.caseAttachmentServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + 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 caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + 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('getAttachment', () => { + it('invokes getAttachment without error', async () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.GetAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.GetAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Attachment() + ); + client.innerApiCalls.getAttachment = stubSimpleCall(expectedResponse); + const [response] = await client.getAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttachment without error using callback', async () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.GetAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.GetAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Attachment() + ); + client.innerApiCalls.getAttachment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAttachment( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.IAttachment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttachment with error', async () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.GetAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.GetAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAttachment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAttachment(request), expectedError); + const actualRequest = (client.innerApiCalls.getAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttachment with closed client', async () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.GetAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.GetAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getAttachment(request), expectedError); + }); + }); + + describe('listAttachments', () => { + it('invokes listAttachments without error', async () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), + ]; + client.innerApiCalls.listAttachments = stubSimpleCall(expectedResponse); + const [response] = await client.listAttachments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAttachments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttachments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttachments without error using callback', async () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), + ]; + client.innerApiCalls.listAttachments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAttachments( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.IAttachment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAttachments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttachments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttachments with error', async () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAttachments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAttachments(request), expectedError); + const actualRequest = (client.innerApiCalls.listAttachments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttachments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttachmentsStream without error', async () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), + ]; + client.descriptors.page.listAttachments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAttachmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2beta.Attachment[] = []; + stream.on('data', (response: protos.google.cloud.support.v2beta.Attachment) => { + 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.listAttachments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAttachments, request)); + assert( + (client.descriptors.page.listAttachments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAttachmentsStream with error', async () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttachments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAttachmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2beta.Attachment[] = []; + stream.on('data', (response: protos.google.cloud.support.v2beta.Attachment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAttachments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAttachments, request)); + assert( + (client.descriptors.page.listAttachments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttachments without error', async () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), + ]; + client.descriptors.page.listAttachments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2beta.IAttachment[] = []; + const iterable = client.listAttachmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAttachments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAttachments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttachments with error', async () => { + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttachments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAttachmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2beta.IAttachment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAttachments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAttachments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('organizationCase', async () => { + const fakePath = "/rendered/path/organizationCase"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + }; + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCasePath', () => { + const result = client.organizationCasePath("organizationValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseName', () => { + const result = client.matchOrganizationFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseName', () => { + const result = client.matchCaseFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseAttachmentId', async () => { + const fakePath = "/rendered/path/organizationCaseAttachmentId"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseAttachmentIdPath', () => { + const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseComment', async () => { + const fakePath = "/rendered/path/organizationCaseComment"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseCommentPath', () => { + const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseCommentName', () => { + const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseCommentName', () => { + const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromOrganizationCaseCommentName', () => { + const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseEmailMessages', async () => { + const fakePath = "/rendered/path/organizationCaseEmailMessages"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + email_message: "emailMessageValue", + }; + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseEmailMessagesPath', () => { + const result = client.organizationCaseEmailMessagesPath("organizationValue", "caseValue", "emailMessageValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseEmailMessagesName', () => { + const result = client.matchOrganizationFromOrganizationCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseEmailMessagesName', () => { + const result = client.matchCaseFromOrganizationCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEmailMessageFromOrganizationCaseEmailMessagesName', () => { + const result = client.matchEmailMessageFromOrganizationCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "emailMessageValue"); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCase', async () => { + const fakePath = "/rendered/path/projectCase"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + }; + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCasePath', () => { + const result = client.projectCasePath("projectValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseName', () => { + const result = client.matchProjectFromProjectCaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseName', () => { + const result = client.matchCaseFromProjectCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseAttachmentId', async () => { + const fakePath = "/rendered/path/projectCaseAttachmentId"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseAttachmentIdPath', () => { + const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseAttachmentIdName', () => { + const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseAttachmentIdName', () => { + const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseComment', async () => { + const fakePath = "/rendered/path/projectCaseComment"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseCommentPath', () => { + const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseCommentName', () => { + const result = client.matchProjectFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseCommentName', () => { + const result = client.matchCaseFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromProjectCaseCommentName', () => { + const result = client.matchCommentFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseEmailMessages', async () => { + const fakePath = "/rendered/path/projectCaseEmailMessages"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + email_message: "emailMessageValue", + }; + const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseEmailMessagesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseEmailMessagesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseEmailMessagesPath', () => { + const result = client.projectCaseEmailMessagesPath("projectValue", "caseValue", "emailMessageValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseEmailMessagesName', () => { + const result = client.matchProjectFromProjectCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseEmailMessagesName', () => { + const result = client.matchCaseFromProjectCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEmailMessageFromProjectCaseEmailMessagesName', () => { + const result = client.matchEmailMessageFromProjectCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "emailMessageValue"); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-support/test/gapic_case_service_v2.ts b/owl-bot-staging/google-cloud-support/test/gapic_case_service_v2.ts new file mode 100644 index 00000000000..791bd38a392 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/test/gapic_case_service_v2.ts @@ -0,0 +1,1763 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 caseserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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 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('v2.CaseServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new caseserviceModule.v2.CaseServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new caseserviceModule.v2.CaseServiceClient(); + 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 = caseserviceModule.v2.CaseServiceClient.servicePath; + assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = caseserviceModule.v2.CaseServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new caseserviceModule.v2.CaseServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new caseserviceModule.v2.CaseServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 caseserviceModule.v2.CaseServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 caseserviceModule.v2.CaseServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 caseserviceModule.v2.CaseServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = caseserviceModule.v2.CaseServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new caseserviceModule.v2.CaseServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.caseServiceStub, undefined); + await client.initialize(); + assert(client.caseServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.caseServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.caseServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new caseserviceModule.v2.CaseServiceClient({ + 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 caseserviceModule.v2.CaseServiceClient({ + 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('getCase', () => { + it('invokes getCase without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.GetCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.GetCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.getCase = stubSimpleCall(expectedResponse); + const [response] = await client.getCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCase without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.GetCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.GetCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.getCase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCase( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2.ICase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCase with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.GetCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.GetCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCase(request), expectedError); + const actualRequest = (client.innerApiCalls.getCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCase with closed client', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.GetCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.GetCaseRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getCase(request), expectedError); + }); + }); + + describe('createCase', () => { + it('invokes createCase without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.CreateCaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.createCase = stubSimpleCall(expectedResponse); + const [response] = await client.createCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCase without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.CreateCaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.createCase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCase( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2.ICase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCase with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.CreateCaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCase(request), expectedError); + const actualRequest = (client.innerApiCalls.createCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCase with closed client', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.CreateCaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createCase(request), expectedError); + }); + }); + + describe('updateCase', () => { + it('invokes updateCase without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.UpdateCaseRequest() + ); + request.case ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.UpdateCaseRequest', ['case', 'name']); + request.case.name = defaultValue1; + const expectedHeaderRequestParams = `case.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.updateCase = stubSimpleCall(expectedResponse); + const [response] = await client.updateCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCase without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.UpdateCaseRequest() + ); + request.case ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.UpdateCaseRequest', ['case', 'name']); + request.case.name = defaultValue1; + const expectedHeaderRequestParams = `case.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.updateCase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCase( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2.ICase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCase with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.UpdateCaseRequest() + ); + request.case ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.UpdateCaseRequest', ['case', 'name']); + request.case.name = defaultValue1; + const expectedHeaderRequestParams = `case.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCase(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCase with closed client', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.UpdateCaseRequest() + ); + request.case ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.UpdateCaseRequest', ['case', 'name']); + request.case.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateCase(request), expectedError); + }); + }); + + describe('escalateCase', () => { + it('invokes escalateCase without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.EscalateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.EscalateCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.escalateCase = stubSimpleCall(expectedResponse); + const [response] = await client.escalateCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.escalateCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.escalateCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes escalateCase without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.EscalateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.EscalateCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.escalateCase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.escalateCase( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2.ICase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.escalateCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.escalateCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes escalateCase with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.EscalateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.EscalateCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.escalateCase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.escalateCase(request), expectedError); + const actualRequest = (client.innerApiCalls.escalateCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.escalateCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes escalateCase with closed client', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.EscalateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.EscalateCaseRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.escalateCase(request), expectedError); + }); + }); + + describe('closeCase', () => { + it('invokes closeCase without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CloseCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.CloseCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.closeCase = stubSimpleCall(expectedResponse); + const [response] = await client.closeCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.closeCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.closeCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes closeCase without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CloseCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.CloseCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.closeCase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.closeCase( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2.ICase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.closeCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.closeCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes closeCase with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CloseCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.CloseCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.closeCase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.closeCase(request), expectedError); + const actualRequest = (client.innerApiCalls.closeCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.closeCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes closeCase with closed client', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CloseCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.CloseCaseRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.closeCase(request), expectedError); + }); + }); + + describe('listCases', () => { + it('invokes listCases without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.innerApiCalls.listCases = stubSimpleCall(expectedResponse); + const [response] = await client.listCases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCases without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.innerApiCalls.listCases = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCases( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2.ICase[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCases with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCases = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCases(request), expectedError); + const actualRequest = (client.innerApiCalls.listCases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCasesStream without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.descriptors.page.listCases.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Case[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.Case) => { + 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.listCases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCases, request)); + assert( + (client.descriptors.page.listCases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCasesStream with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCases.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Case[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.Case) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCases, request)); + assert( + (client.descriptors.page.listCases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCases without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.descriptors.page.listCases.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2.ICase[] = []; + const iterable = client.listCasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCases with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2.ICase[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchCases', () => { + it('invokes searchCases without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.innerApiCalls.searchCases = stubSimpleCall(expectedResponse); + const [response] = await client.searchCases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchCases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchCases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchCases without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.innerApiCalls.searchCases = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchCases( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2.ICase[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchCases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchCases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchCases with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchCases = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchCases(request), expectedError); + const actualRequest = (client.innerApiCalls.searchCases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchCases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchCasesStream without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.descriptors.page.searchCases.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Case[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.Case) => { + 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.searchCases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchCases, request)); + assert( + (client.descriptors.page.searchCases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchCasesStream with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.searchCases.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Case[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.Case) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchCases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchCases, request)); + assert( + (client.descriptors.page.searchCases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchCases without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.descriptors.page.searchCases.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2.ICase[] = []; + const iterable = client.searchCasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchCases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchCases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchCases with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.searchCases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchCasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2.ICase[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchCases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchCases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchCaseClassifications', () => { + it('invokes searchCaseClassifications without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), + ]; + client.innerApiCalls.searchCaseClassifications = stubSimpleCall(expectedResponse); + const [response] = await client.searchCaseClassifications(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchCaseClassifications without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), + ]; + client.innerApiCalls.searchCaseClassifications = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchCaseClassifications( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2.ICaseClassification[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchCaseClassifications with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.searchCaseClassifications = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchCaseClassifications(request), expectedError); + }); + + it('invokes searchCaseClassificationsStream without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), + ]; + client.descriptors.page.searchCaseClassifications.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchCaseClassificationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.CaseClassification[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.CaseClassification) => { + 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.searchCaseClassifications.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchCaseClassifications, request)); + }); + + it('invokes searchCaseClassificationsStream with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchCaseClassifications.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchCaseClassificationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.CaseClassification[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.CaseClassification) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchCaseClassifications.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchCaseClassifications, request)); + }); + + it('uses async iteration with searchCaseClassifications without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), + ]; + client.descriptors.page.searchCaseClassifications.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2.ICaseClassification[] = []; + const iterable = client.searchCaseClassificationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchCaseClassifications.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + + it('uses async iteration with searchCaseClassifications with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchCaseClassifications.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchCaseClassificationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2.ICaseClassification[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchCaseClassifications.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('organization', async () => { + const fakePath = "/rendered/path/organization"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath("organizationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCase', async () => { + const fakePath = "/rendered/path/organizationCase"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCasePath', () => { + const result = client.organizationCasePath("organizationValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseName', () => { + const result = client.matchOrganizationFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseName', () => { + const result = client.matchCaseFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseAttachmentId', async () => { + const fakePath = "/rendered/path/organizationCaseAttachmentId"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseAttachmentIdPath', () => { + const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseComment', async () => { + const fakePath = "/rendered/path/organizationCaseComment"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseCommentPath', () => { + const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseCommentName', () => { + const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseCommentName', () => { + const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromOrganizationCaseCommentName', () => { + const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCase', async () => { + const fakePath = "/rendered/path/projectCase"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCasePath', () => { + const result = client.projectCasePath("projectValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseName', () => { + const result = client.matchProjectFromProjectCaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseName', () => { + const result = client.matchCaseFromProjectCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseAttachmentId', async () => { + const fakePath = "/rendered/path/projectCaseAttachmentId"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseAttachmentIdPath', () => { + const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseAttachmentIdName', () => { + const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseAttachmentIdName', () => { + const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseComment', async () => { + const fakePath = "/rendered/path/projectCaseComment"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseCommentPath', () => { + const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseCommentName', () => { + const result = client.matchProjectFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseCommentName', () => { + const result = client.matchCaseFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromProjectCaseCommentName', () => { + const result = client.matchCommentFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-support/test/gapic_case_service_v2beta.ts b/owl-bot-staging/google-cloud-support/test/gapic_case_service_v2beta.ts new file mode 100644 index 00000000000..3ebffb51fb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/test/gapic_case_service_v2beta.ts @@ -0,0 +1,1855 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 caseserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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 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('v2beta.CaseServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new caseserviceModule.v2beta.CaseServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new caseserviceModule.v2beta.CaseServiceClient(); + 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 = caseserviceModule.v2beta.CaseServiceClient.servicePath; + assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = caseserviceModule.v2beta.CaseServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 caseserviceModule.v2beta.CaseServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 caseserviceModule.v2beta.CaseServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 caseserviceModule.v2beta.CaseServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = caseserviceModule.v2beta.CaseServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new caseserviceModule.v2beta.CaseServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.caseServiceStub, undefined); + await client.initialize(); + assert(client.caseServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.caseServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.caseServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new caseserviceModule.v2beta.CaseServiceClient({ + 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 caseserviceModule.v2beta.CaseServiceClient({ + 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('getCase', () => { + it('invokes getCase without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.GetCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.GetCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Case() + ); + client.innerApiCalls.getCase = stubSimpleCall(expectedResponse); + const [response] = await client.getCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCase without error using callback', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.GetCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.GetCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Case() + ); + client.innerApiCalls.getCase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCase( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCase with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.GetCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.GetCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCase(request), expectedError); + const actualRequest = (client.innerApiCalls.getCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCase with closed client', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.GetCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.GetCaseRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getCase(request), expectedError); + }); + }); + + describe('createCase', () => { + it('invokes createCase without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.CreateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.CreateCaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Case() + ); + client.innerApiCalls.createCase = stubSimpleCall(expectedResponse); + const [response] = await client.createCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCase without error using callback', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.CreateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.CreateCaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Case() + ); + client.innerApiCalls.createCase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCase( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCase with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.CreateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.CreateCaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCase(request), expectedError); + const actualRequest = (client.innerApiCalls.createCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCase with closed client', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.CreateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.CreateCaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createCase(request), expectedError); + }); + }); + + describe('updateCase', () => { + it('invokes updateCase without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.UpdateCaseRequest() + ); + request.case ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.UpdateCaseRequest', ['case', 'name']); + request.case.name = defaultValue1; + const expectedHeaderRequestParams = `case.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Case() + ); + client.innerApiCalls.updateCase = stubSimpleCall(expectedResponse); + const [response] = await client.updateCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCase without error using callback', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.UpdateCaseRequest() + ); + request.case ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.UpdateCaseRequest', ['case', 'name']); + request.case.name = defaultValue1; + const expectedHeaderRequestParams = `case.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Case() + ); + client.innerApiCalls.updateCase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCase( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCase with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.UpdateCaseRequest() + ); + request.case ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.UpdateCaseRequest', ['case', 'name']); + request.case.name = defaultValue1; + const expectedHeaderRequestParams = `case.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateCase(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCase with closed client', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.UpdateCaseRequest() + ); + request.case ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.UpdateCaseRequest', ['case', 'name']); + request.case.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateCase(request), expectedError); + }); + }); + + describe('escalateCase', () => { + it('invokes escalateCase without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.EscalateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.EscalateCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Case() + ); + client.innerApiCalls.escalateCase = stubSimpleCall(expectedResponse); + const [response] = await client.escalateCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.escalateCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.escalateCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes escalateCase without error using callback', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.EscalateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.EscalateCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Case() + ); + client.innerApiCalls.escalateCase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.escalateCase( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.escalateCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.escalateCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes escalateCase with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.EscalateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.EscalateCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.escalateCase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.escalateCase(request), expectedError); + const actualRequest = (client.innerApiCalls.escalateCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.escalateCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes escalateCase with closed client', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.EscalateCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.EscalateCaseRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.escalateCase(request), expectedError); + }); + }); + + describe('closeCase', () => { + it('invokes closeCase without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.CloseCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.CloseCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Case() + ); + client.innerApiCalls.closeCase = stubSimpleCall(expectedResponse); + const [response] = await client.closeCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.closeCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.closeCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes closeCase without error using callback', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.CloseCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.CloseCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Case() + ); + client.innerApiCalls.closeCase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.closeCase( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.closeCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.closeCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes closeCase with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.CloseCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.CloseCaseRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.closeCase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.closeCase(request), expectedError); + const actualRequest = (client.innerApiCalls.closeCase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.closeCase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes closeCase with closed client', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.CloseCaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.CloseCaseRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.closeCase(request), expectedError); + }); + }); + + describe('listCases', () => { + it('invokes listCases without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + ]; + client.innerApiCalls.listCases = stubSimpleCall(expectedResponse); + const [response] = await client.listCases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCases without error using callback', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + ]; + client.innerApiCalls.listCases = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCases( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listCases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCases with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCases = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCases(request), expectedError); + const actualRequest = (client.innerApiCalls.listCases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCasesStream without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + ]; + client.descriptors.page.listCases.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2beta.Case[] = []; + stream.on('data', (response: protos.google.cloud.support.v2beta.Case) => { + 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.listCases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCases, request)); + assert( + (client.descriptors.page.listCases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCasesStream with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCases.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2beta.Case[] = []; + stream.on('data', (response: protos.google.cloud.support.v2beta.Case) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCases, request)); + assert( + (client.descriptors.page.listCases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCases without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + ]; + client.descriptors.page.listCases.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2beta.ICase[] = []; + const iterable = client.listCasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCases with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listCases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2beta.ICase[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listCases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchCases', () => { + it('invokes searchCases without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + ]; + client.innerApiCalls.searchCases = stubSimpleCall(expectedResponse); + const [response] = await client.searchCases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchCases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchCases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchCases without error using callback', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + ]; + client.innerApiCalls.searchCases = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchCases( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchCases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchCases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchCases with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchCases = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchCases(request), expectedError); + const actualRequest = (client.innerApiCalls.searchCases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchCases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchCasesStream without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + ]; + client.descriptors.page.searchCases.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2beta.Case[] = []; + stream.on('data', (response: protos.google.cloud.support.v2beta.Case) => { + 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.searchCases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchCases, request)); + assert( + (client.descriptors.page.searchCases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchCasesStream with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.searchCases.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2beta.Case[] = []; + stream.on('data', (response: protos.google.cloud.support.v2beta.Case) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchCases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchCases, request)); + assert( + (client.descriptors.page.searchCases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchCases without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), + ]; + client.descriptors.page.searchCases.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2beta.ICase[] = []; + const iterable = client.searchCasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchCases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchCases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchCases with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.searchCases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchCasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2beta.ICase[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchCases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchCases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchCaseClassifications', () => { + it('invokes searchCaseClassifications without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), + ]; + client.innerApiCalls.searchCaseClassifications = stubSimpleCall(expectedResponse); + const [response] = await client.searchCaseClassifications(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchCaseClassifications without error using callback', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), + ]; + client.innerApiCalls.searchCaseClassifications = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchCaseClassifications( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICaseClassification[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchCaseClassifications with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.searchCaseClassifications = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchCaseClassifications(request), expectedError); + }); + + it('invokes searchCaseClassificationsStream without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), + ]; + client.descriptors.page.searchCaseClassifications.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchCaseClassificationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2beta.CaseClassification[] = []; + stream.on('data', (response: protos.google.cloud.support.v2beta.CaseClassification) => { + 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.searchCaseClassifications.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchCaseClassifications, request)); + }); + + it('invokes searchCaseClassificationsStream with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchCaseClassifications.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchCaseClassificationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2beta.CaseClassification[] = []; + stream.on('data', (response: protos.google.cloud.support.v2beta.CaseClassification) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchCaseClassifications.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchCaseClassifications, request)); + }); + + it('uses async iteration with searchCaseClassifications without error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), + generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), + ]; + client.descriptors.page.searchCaseClassifications.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2beta.ICaseClassification[] = []; + const iterable = client.searchCaseClassificationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchCaseClassifications.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + + it('uses async iteration with searchCaseClassifications with error', async () => { + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchCaseClassifications.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchCaseClassificationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2beta.ICaseClassification[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchCaseClassifications.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('organization', async () => { + const fakePath = "/rendered/path/organization"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath("organizationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCase', async () => { + const fakePath = "/rendered/path/organizationCase"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + }; + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCasePath', () => { + const result = client.organizationCasePath("organizationValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseName', () => { + const result = client.matchOrganizationFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseName', () => { + const result = client.matchCaseFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseAttachmentId', async () => { + const fakePath = "/rendered/path/organizationCaseAttachmentId"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseAttachmentIdPath', () => { + const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseComment', async () => { + const fakePath = "/rendered/path/organizationCaseComment"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseCommentPath', () => { + const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseCommentName', () => { + const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseCommentName', () => { + const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromOrganizationCaseCommentName', () => { + const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseEmailMessages', async () => { + const fakePath = "/rendered/path/organizationCaseEmailMessages"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + email_message: "emailMessageValue", + }; + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseEmailMessagesPath', () => { + const result = client.organizationCaseEmailMessagesPath("organizationValue", "caseValue", "emailMessageValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseEmailMessagesName', () => { + const result = client.matchOrganizationFromOrganizationCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseEmailMessagesName', () => { + const result = client.matchCaseFromOrganizationCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEmailMessageFromOrganizationCaseEmailMessagesName', () => { + const result = client.matchEmailMessageFromOrganizationCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "emailMessageValue"); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCase', async () => { + const fakePath = "/rendered/path/projectCase"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + }; + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCasePath', () => { + const result = client.projectCasePath("projectValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseName', () => { + const result = client.matchProjectFromProjectCaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseName', () => { + const result = client.matchCaseFromProjectCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseAttachmentId', async () => { + const fakePath = "/rendered/path/projectCaseAttachmentId"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseAttachmentIdPath', () => { + const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseAttachmentIdName', () => { + const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseAttachmentIdName', () => { + const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseComment', async () => { + const fakePath = "/rendered/path/projectCaseComment"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseCommentPath', () => { + const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseCommentName', () => { + const result = client.matchProjectFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseCommentName', () => { + const result = client.matchCaseFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromProjectCaseCommentName', () => { + const result = client.matchCommentFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseEmailMessages', async () => { + const fakePath = "/rendered/path/projectCaseEmailMessages"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + email_message: "emailMessageValue", + }; + const client = new caseserviceModule.v2beta.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseEmailMessagesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseEmailMessagesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseEmailMessagesPath', () => { + const result = client.projectCaseEmailMessagesPath("projectValue", "caseValue", "emailMessageValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseEmailMessagesName', () => { + const result = client.matchProjectFromProjectCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseEmailMessagesName', () => { + const result = client.matchCaseFromProjectCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEmailMessageFromProjectCaseEmailMessagesName', () => { + const result = client.matchEmailMessageFromProjectCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "emailMessageValue"); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2.ts b/owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2.ts new file mode 100644 index 00000000000..b686f324981 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2.ts @@ -0,0 +1,877 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 commentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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 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('v2.CommentServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new commentserviceModule.v2.CommentServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new commentserviceModule.v2.CommentServiceClient(); + 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 = commentserviceModule.v2.CommentServiceClient.servicePath; + assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = commentserviceModule.v2.CommentServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new commentserviceModule.v2.CommentServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new commentserviceModule.v2.CommentServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 commentserviceModule.v2.CommentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 commentserviceModule.v2.CommentServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 commentserviceModule.v2.CommentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = commentserviceModule.v2.CommentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new commentserviceModule.v2.CommentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.commentServiceStub, undefined); + await client.initialize(); + assert(client.commentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.commentServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.commentServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new commentserviceModule.v2.CommentServiceClient({ + 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 commentserviceModule.v2.CommentServiceClient({ + 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('createComment', () => { + it('invokes createComment without error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCommentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.CreateCommentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Comment() + ); + client.innerApiCalls.createComment = stubSimpleCall(expectedResponse); + const [response] = await client.createComment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createComment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createComment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createComment without error using callback', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCommentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.CreateCommentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Comment() + ); + client.innerApiCalls.createComment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createComment( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2.IComment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createComment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createComment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createComment with error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCommentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.CreateCommentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createComment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createComment(request), expectedError); + const actualRequest = (client.innerApiCalls.createComment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createComment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createComment with closed client', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCommentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.CreateCommentRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createComment(request), expectedError); + }); + }); + + describe('listComments', () => { + it('invokes listComments without error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + ]; + client.innerApiCalls.listComments = stubSimpleCall(expectedResponse); + const [response] = await client.listComments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listComments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listComments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listComments without error using callback', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + ]; + client.innerApiCalls.listComments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listComments( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2.IComment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listComments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listComments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listComments with error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listComments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listComments(request), expectedError); + const actualRequest = (client.innerApiCalls.listComments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listComments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCommentsStream without error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + ]; + client.descriptors.page.listComments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCommentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Comment[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.Comment) => { + 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.listComments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listComments, request)); + assert( + (client.descriptors.page.listComments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCommentsStream with error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listComments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCommentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Comment[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.Comment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listComments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listComments, request)); + assert( + (client.descriptors.page.listComments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listComments without error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + ]; + client.descriptors.page.listComments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2.IComment[] = []; + const iterable = client.listCommentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listComments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listComments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listComments with error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listComments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCommentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2.IComment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listComments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listComments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('organizationCase', async () => { + const fakePath = "/rendered/path/organizationCase"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + }; + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCasePath', () => { + const result = client.organizationCasePath("organizationValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseName', () => { + const result = client.matchOrganizationFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseName', () => { + const result = client.matchCaseFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseAttachmentId', async () => { + const fakePath = "/rendered/path/organizationCaseAttachmentId"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseAttachmentIdPath', () => { + const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseComment', async () => { + const fakePath = "/rendered/path/organizationCaseComment"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseCommentPath', () => { + const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseCommentName', () => { + const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseCommentName', () => { + const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromOrganizationCaseCommentName', () => { + const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCase', async () => { + const fakePath = "/rendered/path/projectCase"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + }; + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCasePath', () => { + const result = client.projectCasePath("projectValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseName', () => { + const result = client.matchProjectFromProjectCaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseName', () => { + const result = client.matchCaseFromProjectCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseAttachmentId', async () => { + const fakePath = "/rendered/path/projectCaseAttachmentId"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseAttachmentIdPath', () => { + const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseAttachmentIdName', () => { + const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseAttachmentIdName', () => { + const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseComment', async () => { + const fakePath = "/rendered/path/projectCaseComment"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseCommentPath', () => { + const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseCommentName', () => { + const result = client.matchProjectFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseCommentName', () => { + const result = client.matchCaseFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromProjectCaseCommentName', () => { + const result = client.matchCommentFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2beta.ts b/owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2beta.ts new file mode 100644 index 00000000000..448533a0f6e --- /dev/null +++ b/owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2beta.ts @@ -0,0 +1,1077 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 commentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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 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('v2beta.CommentServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new commentserviceModule.v2beta.CommentServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new commentserviceModule.v2beta.CommentServiceClient(); + 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 = commentserviceModule.v2beta.CommentServiceClient.servicePath; + assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = commentserviceModule.v2beta.CommentServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 commentserviceModule.v2beta.CommentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 commentserviceModule.v2beta.CommentServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 commentserviceModule.v2beta.CommentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = commentserviceModule.v2beta.CommentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new commentserviceModule.v2beta.CommentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.commentServiceStub, undefined); + await client.initialize(); + assert(client.commentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.commentServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.commentServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new commentserviceModule.v2beta.CommentServiceClient({ + 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 commentserviceModule.v2beta.CommentServiceClient({ + 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('createComment', () => { + it('invokes createComment without error', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.CreateCommentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.CreateCommentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Comment() + ); + client.innerApiCalls.createComment = stubSimpleCall(expectedResponse); + const [response] = await client.createComment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createComment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createComment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createComment without error using callback', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.CreateCommentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.CreateCommentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Comment() + ); + client.innerApiCalls.createComment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createComment( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.IComment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createComment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createComment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createComment with error', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.CreateCommentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.CreateCommentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createComment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createComment(request), expectedError); + const actualRequest = (client.innerApiCalls.createComment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createComment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createComment with closed client', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.CreateCommentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.CreateCommentRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createComment(request), expectedError); + }); + }); + + describe('getComment', () => { + it('invokes getComment without error', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.GetCommentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.GetCommentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Comment() + ); + client.innerApiCalls.getComment = stubSimpleCall(expectedResponse); + const [response] = await client.getComment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getComment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getComment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getComment without error using callback', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.GetCommentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.GetCommentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2beta.Comment() + ); + client.innerApiCalls.getComment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getComment( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.IComment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getComment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getComment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getComment with error', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.GetCommentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.GetCommentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getComment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getComment(request), expectedError); + const actualRequest = (client.innerApiCalls.getComment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getComment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getComment with closed client', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.GetCommentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.GetCommentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getComment(request), expectedError); + }); + }); + + describe('listComments', () => { + it('invokes listComments without error', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), + ]; + client.innerApiCalls.listComments = stubSimpleCall(expectedResponse); + const [response] = await client.listComments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listComments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listComments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listComments without error using callback', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), + ]; + client.innerApiCalls.listComments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listComments( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.IComment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listComments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listComments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listComments with error', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listComments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listComments(request), expectedError); + const actualRequest = (client.innerApiCalls.listComments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listComments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCommentsStream without error', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), + ]; + client.descriptors.page.listComments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCommentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2beta.Comment[] = []; + stream.on('data', (response: protos.google.cloud.support.v2beta.Comment) => { + 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.listComments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listComments, request)); + assert( + (client.descriptors.page.listComments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCommentsStream with error', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listComments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCommentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2beta.Comment[] = []; + stream.on('data', (response: protos.google.cloud.support.v2beta.Comment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listComments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listComments, request)); + assert( + (client.descriptors.page.listComments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listComments without error', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), + ]; + client.descriptors.page.listComments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2beta.IComment[] = []; + const iterable = client.listCommentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listComments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listComments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listComments with error', async () => { + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ListCommentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listComments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCommentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2beta.IComment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listComments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listComments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('organizationCase', async () => { + const fakePath = "/rendered/path/organizationCase"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + }; + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCasePath', () => { + const result = client.organizationCasePath("organizationValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseName', () => { + const result = client.matchOrganizationFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseName', () => { + const result = client.matchCaseFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseAttachmentId', async () => { + const fakePath = "/rendered/path/organizationCaseAttachmentId"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseAttachmentIdPath', () => { + const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseComment', async () => { + const fakePath = "/rendered/path/organizationCaseComment"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseCommentPath', () => { + const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseCommentName', () => { + const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseCommentName', () => { + const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromOrganizationCaseCommentName', () => { + const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseEmailMessages', async () => { + const fakePath = "/rendered/path/organizationCaseEmailMessages"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + email_message: "emailMessageValue", + }; + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseEmailMessagesPath', () => { + const result = client.organizationCaseEmailMessagesPath("organizationValue", "caseValue", "emailMessageValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseEmailMessagesName', () => { + const result = client.matchOrganizationFromOrganizationCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseEmailMessagesName', () => { + const result = client.matchCaseFromOrganizationCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEmailMessageFromOrganizationCaseEmailMessagesName', () => { + const result = client.matchEmailMessageFromOrganizationCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "emailMessageValue"); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCase', async () => { + const fakePath = "/rendered/path/projectCase"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + }; + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCasePath', () => { + const result = client.projectCasePath("projectValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseName', () => { + const result = client.matchProjectFromProjectCaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseName', () => { + const result = client.matchCaseFromProjectCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseAttachmentId', async () => { + const fakePath = "/rendered/path/projectCaseAttachmentId"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseAttachmentIdPath', () => { + const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseAttachmentIdName', () => { + const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseAttachmentIdName', () => { + const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseComment', async () => { + const fakePath = "/rendered/path/projectCaseComment"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseCommentPath', () => { + const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseCommentName', () => { + const result = client.matchProjectFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseCommentName', () => { + const result = client.matchCaseFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromProjectCaseCommentName', () => { + const result = client.matchCommentFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseEmailMessages', async () => { + const fakePath = "/rendered/path/projectCaseEmailMessages"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + email_message: "emailMessageValue", + }; + const client = new commentserviceModule.v2beta.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseEmailMessagesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseEmailMessagesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseEmailMessagesPath', () => { + const result = client.projectCaseEmailMessagesPath("projectValue", "caseValue", "emailMessageValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseEmailMessagesName', () => { + const result = client.matchProjectFromProjectCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseEmailMessagesName', () => { + const result = client.matchCaseFromProjectCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEmailMessageFromProjectCaseEmailMessagesName', () => { + const result = client.matchEmailMessageFromProjectCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "emailMessageValue"); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-support/test/gapic_feed_service_v2beta.ts b/owl-bot-staging/google-cloud-support/test/gapic_feed_service_v2beta.ts new file mode 100644 index 00000000000..dbb55ffde01 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/test/gapic_feed_service_v2beta.ts @@ -0,0 +1,861 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 feedserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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 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('v2beta.FeedServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new feedserviceModule.v2beta.FeedServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new feedserviceModule.v2beta.FeedServiceClient(); + 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 = feedserviceModule.v2beta.FeedServiceClient.servicePath; + assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = feedserviceModule.v2beta.FeedServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new feedserviceModule.v2beta.FeedServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new feedserviceModule.v2beta.FeedServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 feedserviceModule.v2beta.FeedServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 feedserviceModule.v2beta.FeedServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudsupport.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 feedserviceModule.v2beta.FeedServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = feedserviceModule.v2beta.FeedServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new feedserviceModule.v2beta.FeedServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new feedserviceModule.v2beta.FeedServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.feedServiceStub, undefined); + await client.initialize(); + assert(client.feedServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.feedServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.feedServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new feedserviceModule.v2beta.FeedServiceClient({ + 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 feedserviceModule.v2beta.FeedServiceClient({ + 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('showFeed', () => { + it('invokes showFeed without error', async () => { + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ShowFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), + generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), + generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), + ]; + client.innerApiCalls.showFeed = stubSimpleCall(expectedResponse); + const [response] = await client.showFeed(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.showFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.showFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes showFeed without error using callback', async () => { + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ShowFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), + generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), + generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), + ]; + client.innerApiCalls.showFeed = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.showFeed( + request, + (err?: Error|null, result?: protos.google.cloud.support.v2beta.IFeedItem[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.showFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.showFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes showFeed with error', async () => { + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ShowFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.showFeed = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.showFeed(request), expectedError); + const actualRequest = (client.innerApiCalls.showFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.showFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes showFeedStream without error', async () => { + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ShowFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), + generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), + generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), + ]; + client.descriptors.page.showFeed.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.showFeedStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2beta.FeedItem[] = []; + stream.on('data', (response: protos.google.cloud.support.v2beta.FeedItem) => { + 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.showFeed.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.showFeed, request)); + assert( + (client.descriptors.page.showFeed.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes showFeedStream with error', async () => { + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ShowFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.showFeed.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.showFeedStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2beta.FeedItem[] = []; + stream.on('data', (response: protos.google.cloud.support.v2beta.FeedItem) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.showFeed.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.showFeed, request)); + assert( + (client.descriptors.page.showFeed.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with showFeed without error', async () => { + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ShowFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), + generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), + generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), + ]; + client.descriptors.page.showFeed.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2beta.IFeedItem[] = []; + const iterable = client.showFeedAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.showFeed.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.showFeed.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with showFeed with error', async () => { + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2beta.ShowFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.showFeed.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.showFeedAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2beta.IFeedItem[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.showFeed.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.showFeed.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('organizationCase', async () => { + const fakePath = "/rendered/path/organizationCase"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + }; + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCasePath', () => { + const result = client.organizationCasePath("organizationValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseName', () => { + const result = client.matchOrganizationFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseName', () => { + const result = client.matchCaseFromOrganizationCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseAttachmentId', async () => { + const fakePath = "/rendered/path/organizationCaseAttachmentId"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseAttachmentIdPath', () => { + const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseComment', async () => { + const fakePath = "/rendered/path/organizationCaseComment"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseCommentPath', () => { + const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseCommentName', () => { + const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseCommentName', () => { + const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromOrganizationCaseCommentName', () => { + const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationCaseEmailMessages', async () => { + const fakePath = "/rendered/path/organizationCaseEmailMessages"; + const expectedParameters = { + organization: "organizationValue", + case: "caseValue", + email_message: "emailMessageValue", + }; + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseEmailMessagesPath', () => { + const result = client.organizationCaseEmailMessagesPath("organizationValue", "caseValue", "emailMessageValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationCaseEmailMessagesName', () => { + const result = client.matchOrganizationFromOrganizationCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromOrganizationCaseEmailMessagesName', () => { + const result = client.matchCaseFromOrganizationCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEmailMessageFromOrganizationCaseEmailMessagesName', () => { + const result = client.matchEmailMessageFromOrganizationCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "emailMessageValue"); + assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCase', async () => { + const fakePath = "/rendered/path/projectCase"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + }; + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCasePath', () => { + const result = client.projectCasePath("projectValue", "caseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseName', () => { + const result = client.matchProjectFromProjectCaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseName', () => { + const result = client.matchCaseFromProjectCaseName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseAttachmentId', async () => { + const fakePath = "/rendered/path/projectCaseAttachmentId"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + attachment_id: "attachmentIdValue", + }; + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseAttachmentIdPath', () => { + const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseAttachmentIdName', () => { + const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseAttachmentIdName', () => { + const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { + const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, "attachmentIdValue"); + assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseComment', async () => { + const fakePath = "/rendered/path/projectCaseComment"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + comment: "commentValue", + }; + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseCommentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseCommentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseCommentPath', () => { + const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseCommentName', () => { + const result = client.matchProjectFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseCommentName', () => { + const result = client.matchCaseFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCommentFromProjectCaseCommentName', () => { + const result = client.matchCommentFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, "commentValue"); + assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectCaseEmailMessages', async () => { + const fakePath = "/rendered/path/projectCaseEmailMessages"; + const expectedParameters = { + project: "projectValue", + case: "caseValue", + email_message: "emailMessageValue", + }; + const client = new feedserviceModule.v2beta.FeedServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCaseEmailMessagesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectCaseEmailMessagesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectCaseEmailMessagesPath', () => { + const result = client.projectCaseEmailMessagesPath("projectValue", "caseValue", "emailMessageValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectCaseEmailMessagesName', () => { + const result = client.matchProjectFromProjectCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCaseFromProjectCaseEmailMessagesName', () => { + const result = client.matchCaseFromProjectCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "caseValue"); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEmailMessageFromProjectCaseEmailMessagesName', () => { + const result = client.matchEmailMessageFromProjectCaseEmailMessagesName(fakePath); + assert.strictEqual(result, "emailMessageValue"); + assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-support/tsconfig.json b/owl-bot-staging/google-cloud-support/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/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-support/webpack.config.js b/owl-bot-staging/google-cloud-support/webpack.config.js new file mode 100644 index 00000000000..1fab5f9e237 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/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: 'CaseAttachmentService', + filename: './case-attachment-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 d63c652f644f482fde07b72da02f996727d5b544 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 5 Feb 2026 03:25:23 +0000 Subject: [PATCH 2/3] chore: Updating the year of the copyright PiperOrigin-RevId: 865612222 Source-Link: https://github.com/googleapis/googleapis/commit/aa950c94fca3ea74ab574d0538b9ff1d57187f91 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4d7b76c803e35ff146c7e19110a3802163448087 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXN1cHBvcnQvLk93bEJvdC55YW1sIiwiaCI6IjRkN2I3NmM4MDNlMzVmZjE0NmM3ZTE5MTEwYTM4MDIxNjM0NDgwODcifQ== --- .../protos/google/cloud/support/v2beta/actor.proto | 2 +- .../protos/google/cloud/support/v2beta/attachment.proto | 2 +- .../protos/google/cloud/support/v2beta/attachment_service.proto | 2 +- .../protos/google/cloud/support/v2beta/case.proto | 2 +- .../protos/google/cloud/support/v2beta/case_service.proto | 2 +- .../protos/google/cloud/support/v2beta/comment.proto | 2 +- .../protos/google/cloud/support/v2beta/comment_service.proto | 2 +- .../protos/google/cloud/support/v2beta/content.proto | 2 +- .../protos/google/cloud/support/v2beta/email_message.proto | 2 +- .../protos/google/cloud/support/v2beta/escalation.proto | 2 +- .../protos/google/cloud/support/v2beta/feed_item.proto | 2 +- .../protos/google/cloud/support/v2beta/feed_service.proto | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto index 908b94ad5fb..6effd8a3acf 100644 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto index 1ea39feaa84..918d006edbd 100644 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto index e488712eec1..acf53096443 100644 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case.proto index b042e9d95e4..10a2cb6c8c9 100644 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case.proto +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto index cd9894d2b97..8863f275036 100644 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto index 0bc668d095f..dd6b1ee2e0f 100644 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto index f0cd726cfb3..dff46126955 100644 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/content.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/content.proto index bd7c184bcd9..29750d7c24f 100644 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/content.proto +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/content.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto index f20350358d4..6321cf00645 100644 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto index e3cd802232f..abec570edec 100644 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto index 0540170772e..c275dbcc341 100644 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto index bcf447d31d4..02d36c19808 100644 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto +++ b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From bea2398279513f83775a35b091a9daa31ec873f3 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 5 Feb 2026 03:34:45 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-cloud-support/.eslintignore | 7 - .../google-cloud-support/.eslintrc.json | 3 - .../google-cloud-support/.gitattributes | 4 - .../google-cloud-support/.gitignore | 14 - .../google-cloud-support/.jsdoc.js | 55 - .../google-cloud-support/.mocharc.js | 33 - owl-bot-staging/google-cloud-support/.nycrc | 24 - .../google-cloud-support/.prettierignore | 6 - .../google-cloud-support/.prettierrc.js | 22 - .../google-cloud-support/CODE_OF_CONDUCT.md | 94 - .../google-cloud-support/CONTRIBUTING.md | 76 - owl-bot-staging/google-cloud-support/LICENSE | 202 - .../google-cloud-support/README.md | 140 - .../google/cloud/support/v2/actor.proto | 56 - .../google/cloud/support/v2/attachment.proto | 69 - .../cloud/support/v2/attachment_service.proto | 86 - .../protos/google/cloud/support/v2/case.proto | 197 - .../cloud/support/v2/case_service.proto | 351 - .../google/cloud/support/v2/comment.proto | 69 - .../cloud/support/v2/comment_service.proto | 107 - .../google/cloud/support/v2/escalation.proto | 53 - .../google/cloud/support/v2beta/actor.proto | 56 - .../cloud/support/v2beta/attachment.proto | 69 - .../support/v2beta/attachment_service.proto | 105 - .../google/cloud/support/v2beta/case.proto | 218 - .../cloud/support/v2beta/case_service.proto | 360 - .../google/cloud/support/v2beta/comment.proto | 69 - .../support/v2beta/comment_service.proto | 126 - .../google/cloud/support/v2beta/content.proto | 31 - .../cloud/support/v2beta/email_message.proto | 68 - .../cloud/support/v2beta/escalation.proto | 53 - .../cloud/support/v2beta/feed_item.proto | 56 - .../cloud/support/v2beta/feed_service.proto | 88 - .../google-cloud-support/protos/protos.d.ts | 13074 ------ .../google-cloud-support/protos/protos.js | 33942 ---------------- .../google-cloud-support/protos/protos.json | 3752 -- ...ase_attachment_service.list_attachments.js | 77 - .../generated/v2/case_service.close_case.js | 61 - .../generated/v2/case_service.create_case.js | 66 - .../v2/case_service.escalate_case.js | 65 - .../generated/v2/case_service.get_case.js | 61 - .../generated/v2/case_service.list_cases.js | 89 - ...ase_service.search_case_classifications.js | 73 - .../generated/v2/case_service.search_cases.js | 100 - .../generated/v2/case_service.update_case.js | 71 - .../v2/comment_service.create_comment.js | 66 - .../v2/comment_service.list_comments.js | 72 - ...ppet_metadata_google.cloud.support.v2.json | 519 - .../case_attachment_service.get_attachment.js | 61 - ...ase_attachment_service.list_attachments.js | 77 - .../v2beta/case_service.close_case.js | 61 - .../v2beta/case_service.create_case.js | 66 - .../v2beta/case_service.escalate_case.js | 65 - .../generated/v2beta/case_service.get_case.js | 61 - .../v2beta/case_service.list_cases.js | 94 - ...ase_service.search_case_classifications.js | 77 - .../v2beta/case_service.search_cases.js | 100 - .../v2beta/case_service.update_case.js | 71 - .../v2beta/comment_service.create_comment.js | 66 - .../v2beta/comment_service.get_comment.js | 61 - .../v2beta/comment_service.list_comments.js | 72 - .../v2beta/feed_service.show_feed.js | 81 - ..._metadata_google.cloud.support.v2beta.json | 659 - .../google-cloud-support/src/index.ts | 32 - .../src/v2/case_attachment_service_client.ts | 858 - ...case_attachment_service_client_config.json | 43 - .../case_attachment_service_proto_list.json | 10 - .../src/v2/case_service_client.ts | 1917 - .../src/v2/case_service_client_config.json | 78 - .../src/v2/case_service_proto_list.json | 10 - .../src/v2/comment_service_client.ts | 935 - .../src/v2/comment_service_client_config.json | 48 - .../src/v2/comment_service_proto_list.json | 10 - .../src/v2/gapic_metadata.json | 181 - .../google-cloud-support/src/v2/index.ts | 21 - .../v2beta/case_attachment_service_client.ts | 1056 - ...case_attachment_service_client_config.json | 47 - .../case_attachment_service_proto_list.json | 14 - .../src/v2beta/case_service_client.ts | 2036 - .../v2beta/case_service_client_config.json | 78 - .../src/v2beta/case_service_proto_list.json | 14 - .../src/v2beta/comment_service_client.ts | 1133 - .../v2beta/comment_service_client_config.json | 52 - .../v2beta/comment_service_proto_list.json | 14 - .../src/v2beta/feed_service_client.ts | 966 - .../v2beta/feed_service_client_config.json | 43 - .../src/v2beta/feed_service_proto_list.json | 14 - .../src/v2beta/gapic_metadata.json | 229 - .../google-cloud-support/src/v2beta/index.ts | 22 - .../system-test/fixtures/sample/src/index.js | 29 - .../system-test/fixtures/sample/src/index.ts | 44 - .../system-test/install.ts | 49 - .../test/gapic_case_attachment_service_v2.ts | 769 - .../gapic_case_attachment_service_v2beta.ts | 969 - .../test/gapic_case_service_v2.ts | 1763 - .../test/gapic_case_service_v2beta.ts | 1855 - .../test/gapic_comment_service_v2.ts | 877 - .../test/gapic_comment_service_v2beta.ts | 1077 - .../test/gapic_feed_service_v2beta.ts | 861 - .../google-cloud-support/tsconfig.json | 22 - .../google-cloud-support/webpack.config.js | 64 - .../google/cloud/support/v2/actor.proto | 2 +- .../google/cloud/support/v2/attachment.proto | 2 +- .../cloud/support/v2/attachment_service.proto | 2 +- .../protos/google/cloud/support/v2/case.proto | 2 +- .../cloud/support/v2/case_service.proto | 2 +- .../google/cloud/support/v2/comment.proto | 2 +- .../cloud/support/v2/comment_service.proto | 2 +- .../google/cloud/support/v2/escalation.proto | 2 +- .../google/cloud/support/v2beta/actor.proto | 2 +- .../cloud/support/v2beta/attachment.proto | 2 +- .../support/v2beta/attachment_service.proto | 2 +- .../google/cloud/support/v2beta/case.proto | 2 +- .../cloud/support/v2beta/case_service.proto | 2 +- .../google/cloud/support/v2beta/comment.proto | 2 +- .../support/v2beta/comment_service.proto | 2 +- .../google/cloud/support/v2beta/content.proto | 2 +- .../cloud/support/v2beta/email_message.proto | 2 +- .../cloud/support/v2beta/escalation.proto | 2 +- .../cloud/support/v2beta/feed_item.proto | 2 +- .../cloud/support/v2beta/feed_service.proto | 2 +- 121 files changed, 20 insertions(+), 74987 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-support/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-support/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-support/.gitattributes delete mode 100644 owl-bot-staging/google-cloud-support/.gitignore delete mode 100644 owl-bot-staging/google-cloud-support/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-support/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-support/.nycrc delete mode 100644 owl-bot-staging/google-cloud-support/.prettierignore delete mode 100644 owl-bot-staging/google-cloud-support/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-support/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/google-cloud-support/CONTRIBUTING.md delete mode 100644 owl-bot-staging/google-cloud-support/LICENSE delete mode 100644 owl-bot-staging/google-cloud-support/README.md delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/actor.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case_service.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/escalation.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/content.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto delete mode 100644 owl-bot-staging/google-cloud-support/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-support/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-support/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.close_case.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.create_case.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.escalate_case.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.get_case.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.list_cases.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_cases.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.update_case.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.create_comment.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.list_comments.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2/snippet_metadata_google.cloud.support.v2.json delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.get_attachment.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.list_attachments.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.close_case.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.create_case.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.escalate_case.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.get_case.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.list_cases.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_case_classifications.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_cases.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.update_case.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.create_comment.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.get_comment.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.list_comments.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/feed_service.show_feed.js delete mode 100644 owl-bot-staging/google-cloud-support/samples/generated/v2beta/snippet_metadata_google.cloud.support.v2beta.json delete mode 100644 owl-bot-staging/google-cloud-support/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2/case_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-support/src/v2/case_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2/case_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2/comment_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-support/src/v2/comment_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2/comment_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2/index.ts delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/case_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/case_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/case_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/comment_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/feed_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-support/src/v2beta/index.ts delete mode 100644 owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-support/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2.ts delete mode 100644 owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2beta.ts delete mode 100644 owl-bot-staging/google-cloud-support/test/gapic_case_service_v2.ts delete mode 100644 owl-bot-staging/google-cloud-support/test/gapic_case_service_v2beta.ts delete mode 100644 owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2.ts delete mode 100644 owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2beta.ts delete mode 100644 owl-bot-staging/google-cloud-support/test/gapic_feed_service_v2beta.ts delete mode 100644 owl-bot-staging/google-cloud-support/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-support/webpack.config.js diff --git a/owl-bot-staging/google-cloud-support/.eslintignore b/owl-bot-staging/google-cloud-support/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-support/.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-support/.eslintrc.json b/owl-bot-staging/google-cloud-support/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-support/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-support/.gitattributes b/owl-bot-staging/google-cloud-support/.gitattributes deleted file mode 100644 index 33739cb74e4..00000000000 --- a/owl-bot-staging/google-cloud-support/.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-support/.gitignore b/owl-bot-staging/google-cloud-support/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-support/.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-support/.jsdoc.js b/owl-bot-staging/google-cloud-support/.jsdoc.js deleted file mode 100644 index 86a15a2c062..00000000000 --- a/owl-bot-staging/google-cloud-support/.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/support', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-support/.mocharc.js b/owl-bot-staging/google-cloud-support/.mocharc.js deleted file mode 100644 index 5eb34e86c87..00000000000 --- a/owl-bot-staging/google-cloud-support/.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-support/.nycrc b/owl-bot-staging/google-cloud-support/.nycrc deleted file mode 100644 index 81a95fc94b0..00000000000 --- a/owl-bot-staging/google-cloud-support/.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-support/.prettierignore b/owl-bot-staging/google-cloud-support/.prettierignore deleted file mode 100644 index 9340ad9b86d..00000000000 --- a/owl-bot-staging/google-cloud-support/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/google-cloud-support/.prettierrc.js b/owl-bot-staging/google-cloud-support/.prettierrc.js deleted file mode 100644 index 7649ee3c254..00000000000 --- a/owl-bot-staging/google-cloud-support/.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-support/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-support/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a81..00000000000 --- a/owl-bot-staging/google-cloud-support/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-support/CONTRIBUTING.md b/owl-bot-staging/google-cloud-support/CONTRIBUTING.md deleted file mode 100644 index e4e064c8af9..00000000000 --- a/owl-bot-staging/google-cloud-support/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 Support 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=cloudsupport.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-support/LICENSE b/owl-bot-staging/google-cloud-support/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/owl-bot-staging/google-cloud-support/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-support/README.md b/owl-bot-staging/google-cloud-support/README.md deleted file mode 100644 index 6ddbe43a7fb..00000000000 --- a/owl-bot-staging/google-cloud-support/README.md +++ /dev/null @@ -1,140 +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 - -# [Google Cloud Support API: Nodejs Client][homepage] - -This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways -unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **stable** libraries -are addressed with the highest priority - -[![npm version](https://img.shields.io/npm/v/@google-cloud/support.svg)](https://www.npmjs.org/package/@google-cloud/support) - -Google Cloud Support API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Google Cloud Support API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/support/latest) -* [Google Cloud Support API Documentation](https://cloud.google.com/support/docs/reference/support-api) - -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 Google Cloud Support 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/support -``` - -[//]: # "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 | -| --------------------------- | --------------------------------- | -| list attachments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js) | -| close case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.close_case.js) | -| create case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.create_case.js) | -| escalate case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.escalate_case.js) | -| get case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.get_case.js) | -| list cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.list_cases.js) | -| search case classifications | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js) | -| search cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.search_cases.js) | -| update case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.update_case.js) | -| create comment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/comment_service.create_comment.js) | -| list comments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/comment_service.list_comments.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/snippet_metadata_google.cloud.support.v2.json) | -| get attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_attachment_service.get_attachment.js) | -| list attachments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_attachment_service.list_attachments.js) | -| close case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.close_case.js) | -| create case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.create_case.js) | -| escalate case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.escalate_case.js) | -| get case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.get_case.js) | -| list cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.list_cases.js) | -| search case classifications | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.search_case_classifications.js) | -| search cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.search_cases.js) | -| update case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_service.update_case.js) | -| create comment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/comment_service.create_comment.js) | -| get comment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/comment_service.get_comment.js) | -| list comments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/comment_service.list_comments.js) | -| show feed | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/feed_service.show_feed.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/snippet_metadata_google.cloud.support.v2beta.json) | - - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/support@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-support/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-support/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=cloudsupport.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-support/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/actor.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/actor.proto deleted file mode 100644 index 3dfb5de103e..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/actor.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.support.v2; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2"; -option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "ActorProto"; -option java_package = "com.google.cloud.support.v2"; -option php_namespace = "Google\\Cloud\\Support\\V2"; -option ruby_package = "Google::Cloud::Support::V2"; - -// An Actor represents an entity that performed an action. For example, an actor -// could be a user who posted a comment on a support case, a user who -// uploaded an attachment, or a service account that created a support case. -message Actor { - // The name to display for the actor. If not provided, it is inferred from - // credentials supplied during case creation. When an email is provided, a - // display name must also be provided. This will be obfuscated if the user - // is a Google Support agent. - string display_name = 1; - - // The email address of the actor. If not provided, it is inferred from the - // credentials supplied during case creation. When a name is provided, an - // email must also be provided. If the user is a Google Support agent, this is - // obfuscated. - // - // This field is deprecated. Use `username` instead. - string email = 2 [deprecated = true]; - - // Output only. Whether the actor is a Google support actor. - bool google_support = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The username of the actor. It may look like an email or other - // format provided by the identity provider. If not provided, it is inferred - // from the credentials supplied. When a name is provided, a username must - // also be provided. If the user is a Google Support agent, this will not be - // set. - string username = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment.proto deleted file mode 100644 index 9039620b314..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment.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.support.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2/actor.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2"; -option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "AttachmentProto"; -option java_package = "com.google.cloud.support.v2"; -option php_namespace = "Google\\Cloud\\Support\\V2"; -option ruby_package = "Google::Cloud::Support::V2"; - -// An Attachment contains metadata about a file that was uploaded to a -// case - it is NOT a file itself. That being said, the name of an Attachment -// object can be used to download its accompanying file through the -// `media.download` endpoint. -// -// While attachments can be uploaded in the console at the -// same time as a comment, they're associated on a "case" level, not a -// "comment" level. -message Attachment { - option (google.api.resource) = { - type: "cloudsupport.googleapis.com/Attachment" - pattern: "organizations/{organization}/cases/{case}/attachments/{attachment_id}" - pattern: "projects/{project}/cases/{case}/attachments/{attachment_id}" - }; - - // Output only. Identifier. The resource name of the attachment. - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = IDENTIFIER - ]; - - // Output only. The time at which the attachment was created. - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The user who uploaded the attachment. Note, the name and email - // will be obfuscated if the attachment was uploaded by Google support. - Actor creator = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The filename of the attachment (e.g. `"graph.jpg"`). - string filename = 4; - - // Output only. The MIME type of the attachment (e.g. text/plain). - string mime_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The size of the attachment in bytes. - int64 size_bytes = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto deleted file mode 100644 index 5c63b8dc101..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto +++ /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 -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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.support.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2/attachment.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2"; -option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "AttachmentServiceProto"; -option java_package = "com.google.cloud.support.v2"; -option php_namespace = "Google\\Cloud\\Support\\V2"; -option ruby_package = "Google::Cloud::Support::V2"; - -// A service to manage file attachments for Google Cloud support cases. -service CaseAttachmentService { - option (google.api.default_host) = "cloudsupport.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // List all the attachments associated with a support case. - rpc ListAttachments(ListAttachmentsRequest) - returns (ListAttachmentsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/cases/*}/attachments" - additional_bindings { - get: "/v2/{parent=organizations/*/cases/*}/attachments" - } - }; - option (google.api.method_signature) = "parent"; - } -} - -// The request message for the ListAttachments endpoint. -message ListAttachmentsRequest { - // Required. The name of the case for which attachments should be listed. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; - - // The maximum number of attachments fetched with each request. - // - // If not provided, the default is 10. The maximum page size that will be - // returned is 100. - // - // The size of each page can be smaller than the requested page size and can - // include zero. For example, you could request 100 attachments on one page, - // receive 0, and then on the next page, receive 90. - int32 page_size = 2; - - // A token identifying the page of results to return. If unspecified, the - // first page is retrieved. - string page_token = 3; -} - -// The response message for the ListAttachments endpoint. -message ListAttachmentsResponse { - // The list of attachments associated with a case. - repeated Attachment attachments = 1; - - // A token to retrieve the next page of results. Set this in the `page_token` - // field of subsequent `cases.attachments.list` requests. If unspecified, - // there are no more results to retrieve. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case.proto deleted file mode 100644 index b14160b4c90..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case.proto +++ /dev/null @@ -1,197 +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.support.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2/actor.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2"; -option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "CaseProto"; -option java_package = "com.google.cloud.support.v2"; -option php_namespace = "Google\\Cloud\\Support\\V2"; -option ruby_package = "Google::Cloud::Support::V2"; - -// A Case is an object that contains the details of a support case. It -// contains fields for the time it was created, its priority, its -// classification, and more. Cases can also have comments and attachments that -// get added over time. -// -// A case is parented by a Google Cloud organization or project. -// -// Organizations are identified by a number, so the name of a case parented by -// an organization would look like this: -// -// ``` -// organizations/123/cases/456 -// ``` -// -// Projects have two unique identifiers, an ID and a number, and they look like -// this: -// -// ``` -// projects/abc/cases/456 -// ``` -// -// ``` -// projects/123/cases/456 -// ``` -// -// You can use either of them when calling the API. To learn more -// about project identifiers, see [AIP-2510](https://google.aip.dev/cloud/2510). -message Case { - option (google.api.resource) = { - type: "cloudsupport.googleapis.com/Case" - pattern: "organizations/{organization}/cases/{case}" - pattern: "projects/{project}/cases/{case}" - }; - - // The status of a support case. - enum State { - // Case is in an unknown state. - STATE_UNSPECIFIED = 0; - - // The case has been created but no one is assigned to work on it yet. - NEW = 1; - - // The case is currently being handled by Google support. - IN_PROGRESS_GOOGLE_SUPPORT = 2; - - // Google is waiting for a response. - ACTION_REQUIRED = 3; - - // A solution has been offered for the case, but it isn't yet closed. - SOLUTION_PROVIDED = 4; - - // The case has been resolved. - CLOSED = 5; - } - - // The case Priority. P0 is most urgent and P4 the least. - enum Priority { - // Priority is undefined or has not been set yet. - PRIORITY_UNSPECIFIED = 0; - - // Extreme impact on a production service. Service is hard down. - P0 = 1; - - // Critical impact on a production service. Service is currently unusable. - P1 = 2; - - // Severe impact on a production service. Service is usable but greatly - // impaired. - P2 = 3; - - // Medium impact on a production service. Service is available, but - // moderately impaired. - P3 = 4; - - // General questions or minor issues. Production service is fully - // available. - P4 = 5; - } - - // Identifier. The resource name for the case. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // The short summary of the issue reported in this case. - string display_name = 2; - - // A broad description of the issue. - string description = 3; - - // The issue classification applicable to this case. - CaseClassification classification = 4; - - // The timezone of the user who created the support case. - // It should be in a format IANA recognizes: https://www.iana.org/time-zones. - // There is no additional validation done by the API. - string time_zone = 8; - - // The email addresses to receive updates on this case. - repeated string subscriber_email_addresses = 9; - - // Output only. The current status of the support case. - State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time this case was created. - google.protobuf.Timestamp create_time = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time this case was last updated. - google.protobuf.Timestamp update_time = 14 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The user who created the case. - // - // Note: The name and email will be obfuscated if the case was created by - // Google Support. - Actor creator = 15; - - // A user-supplied email address to send case update notifications for. This - // should only be used in BYOID flows, where we cannot infer the user's email - // address directly from their EUCs. - string contact_email = 35; - - // Whether the case is currently escalated. - bool escalated = 17; - - // Whether this case was created for internal API testing and should not be - // acted on by the support team. - bool test_case = 19; - - // The language the user has requested to receive support in. This should be a - // BCP 47 language code (e.g., `"en"`, `"zh-CN"`, `"zh-TW"`, `"ja"`, `"ko"`). - // If no language or an unsupported language is specified, this field defaults - // to English (en). - // - // Language selection during case creation may affect your available support - // options. For a list of supported languages and their support working hours, - // see: https://cloud.google.com/support/docs/language-working-hours - string language_code = 23; - - // The priority of this case. - Priority priority = 32; -} - -// A Case Classification represents the topic that a case is about. It's very -// important to use accurate classifications, because they're -// used to route your cases to specialists who can help you. -// -// A classification always has an ID that is its unique identifier. -// A valid ID is required when creating a case. -message CaseClassification { - // The unique ID for a classification. Must be specified for case creation. - // - // To retrieve valid classification IDs for case creation, use - // `caseClassifications.search`. - // - // Classification IDs returned by `caseClassifications.search` are guaranteed - // to be valid for at least 6 months. If a given classification is - // deactiveated, it will immediately stop being returned. After 6 months, - // `case.create` requests using the classification ID will fail. - string id = 3; - - // A display name for the classification. - // - // The display name is not static and can change. To uniquely and consistently - // identify classifications, use the `CaseClassification.id` field. - string display_name = 4; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case_service.proto deleted file mode 100644 index 4030bc1cafe..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/case_service.proto +++ /dev/null @@ -1,351 +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.support.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2/case.proto"; -import "google/cloud/support/v2/escalation.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2"; -option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "CaseServiceProto"; -option java_package = "com.google.cloud.support.v2"; -option php_namespace = "Google\\Cloud\\Support\\V2"; -option ruby_package = "Google::Cloud::Support::V2"; - -// A service to manage Google Cloud support cases. -service CaseService { - option (google.api.default_host) = "cloudsupport.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Retrieve a case. - rpc GetCase(GetCaseRequest) returns (Case) { - option (google.api.http) = { - get: "/v2/{name=projects/*/cases/*}" - additional_bindings { get: "/v2/{name=organizations/*/cases/*}" } - }; - option (google.api.method_signature) = "name"; - } - - // Retrieve all cases under a parent, but not its children. - // - // For example, listing cases under an organization only returns the cases - // that are directly parented by that organization. To retrieve cases - // under an organization and its projects, use `cases.search`. - rpc ListCases(ListCasesRequest) returns (ListCasesResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*}/cases" - additional_bindings { get: "/v2/{parent=organizations/*}/cases" } - }; - option (google.api.method_signature) = "parent"; - } - - // Search for cases using a query. - rpc SearchCases(SearchCasesRequest) returns (SearchCasesResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*}/cases:search" - additional_bindings { get: "/v2/{parent=organizations/*}/cases:search" } - }; - } - - // Create a new case and associate it with a parent. - // - // It must have the following fields set: `display_name`, `description`, - // `classification`, and `priority`. If you're just testing the API and don't - // want to route your case to an agent, set `testCase=true`. - rpc CreateCase(CreateCaseRequest) returns (Case) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/cases" - body: "case" - additional_bindings { - post: "/v2/{parent=organizations/*}/cases" - body: "case" - } - }; - option (google.api.method_signature) = "parent,case"; - } - - // Update a case. Only some fields can be updated. - rpc UpdateCase(UpdateCaseRequest) returns (Case) { - option (google.api.http) = { - patch: "/v2/{case.name=projects/*/cases/*}" - body: "case" - additional_bindings { - patch: "/v2/{case.name=organizations/*/cases/*}" - body: "case" - } - }; - option (google.api.method_signature) = "case,update_mask"; - } - - // Escalate a case, starting the Google Cloud Support escalation management - // process. - // - // This operation is only available for some support services. Go to - // https://cloud.google.com/support and look for 'Technical support - // escalations' in the feature list to find out which ones let you - // do that. - rpc EscalateCase(EscalateCaseRequest) returns (Case) { - option (google.api.http) = { - post: "/v2/{name=projects/*/cases/*}:escalate" - body: "*" - additional_bindings { - post: "/v2/{name=organizations/*/cases/*}:escalate" - body: "*" - } - }; - } - - // Close a case. - rpc CloseCase(CloseCaseRequest) returns (Case) { - option (google.api.http) = { - post: "/v2/{name=projects/*/cases/*}:close" - body: "*" - additional_bindings { - post: "/v2/{name=organizations/*/cases/*}:close" - body: "*" - } - }; - } - - // Retrieve valid classifications to use when creating a support case. - // - // Classifications are hierarchical. Each classification is a string - // containing all levels of the hierarchy separated by `" > "`. For example, - // `"Technical Issue > Compute > Compute Engine"`. - // - // Classification IDs returned by this endpoint are valid for at least six - // months. When a classification is deactivated, this endpoint immediately - // stops returning it. After six months, `case.create` requests using the - // classification will fail. - rpc SearchCaseClassifications(SearchCaseClassificationsRequest) - returns (SearchCaseClassificationsResponse) { - option (google.api.http) = { - get: "/v2/caseClassifications:search" - }; - } -} - -// The request message for the GetCase endpoint. -message GetCaseRequest { - // Required. The full name of a case to be retrieved. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; -} - -// The request message for the CreateCase endpoint. -message CreateCaseRequest { - // Required. The name of the parent under which the case should be created. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudsupport.googleapis.com/Case" - } - ]; - - // Required. The case to be created. - Case case = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The request message for the ListCases endpoint. -message ListCasesRequest { - // Required. The name of a parent to list cases under. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudsupport.googleapis.com/Case" - } - ]; - - // An expression used to filter cases. - // - // If it's an empty string, then no filtering happens. Otherwise, the endpoint - // returns the cases that match the filter. - // - // Expressions use the following fields separated by `AND` and specified with - // `=`: - // - // - `state`: Can be `OPEN` or `CLOSED`. - // - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - // can specify multiple values for priority using the `OR` operator. For - // example, `priority=P1 OR priority=P2`. - // - `creator.email`: The email address of the case creator. - // - // EXAMPLES: - // - // - `state=CLOSED` - // - `state=OPEN AND creator.email="tester@example.com"` - // - `state=OPEN AND (priority=P0 OR priority=P1)` - string filter = 2; - - // The maximum number of cases fetched with each request. Defaults to 10. - int32 page_size = 4; - - // A token identifying the page of results to return. If unspecified, the - // first page is retrieved. - string page_token = 5; -} - -// The response message for the ListCases endpoint. -message ListCasesResponse { - // The list of cases associated with the parent after any - // filters have been applied. - repeated Case cases = 1; - - // A token to retrieve the next page of results. Set this in the `page_token` - // field of subsequent `cases.list` requests. If unspecified, there are no - // more results to retrieve. - string next_page_token = 2; -} - -// The request message for the SearchCases endpoint. -message SearchCasesRequest { - // The name of the parent resource to search for cases under. - string parent = 4; - - // An expression used to filter cases. - // - // Expressions use the following fields separated by `AND` and specified with - // `=`: - // - // - `organization`: An organization name in the form - // `organizations/`. - // - `project`: A project name in the form `projects/`. - // - `state`: Can be `OPEN` or `CLOSED`. - // - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - // can specify multiple values for priority using the `OR` operator. For - // example, `priority=P1 OR priority=P2`. - // - `creator.email`: The email address of the case creator. - // - // You must specify either `organization` or `project`. - // - // To search across `displayName`, `description`, and comments, use a global - // restriction with no keyword or operator. For example, `"my search"`. - // - // To search only cases updated after a certain date, use `update_time` - // restricted with that particular date, time, and timezone in ISO datetime - // format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - // `update_time` only supports the greater than operator (`>`). - // - // Examples: - // - // - `organization="organizations/123456789"` - // - `project="projects/my-project-id"` - // - `project="projects/123456789"` - // - `organization="organizations/123456789" AND state=CLOSED` - // - `project="projects/my-project-id" AND creator.email="tester@example.com"` - // - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - string query = 1; - - // The maximum number of cases fetched with each request. The default page - // size is 10. - int32 page_size = 2; - - // A token identifying the page of results to return. If unspecified, the - // first page is retrieved. - string page_token = 3; -} - -// The response message for the SearchCases endpoint. -message SearchCasesResponse { - // The list of cases associated with the parent after any - // filters have been applied. - repeated Case cases = 1; - - // A token to retrieve the next page of results. Set this in the - // `page_token` field of subsequent `cases.search` requests. If unspecified, - // there are no more results to retrieve. - string next_page_token = 2; -} - -// The request message for the EscalateCase endpoint. -message EscalateCaseRequest { - // Required. The name of the case to be escalated. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; - - // The escalation information to be sent with the escalation request. - Escalation escalation = 2; -} - -// The request message for the UpdateCase endpoint -message UpdateCaseRequest { - // Required. The case to update. - Case case = 1 [(google.api.field_behavior) = REQUIRED]; - - // A list of attributes of the case that should be updated. Supported values - // are `priority`, `display_name`, and `subscriber_email_addresses`. If no - // fields are specified, all supported fields are updated. - // - // Be careful - if you do not provide a field mask, then you might - // accidentally clear some fields. For example, if you leave the field mask - // empty and do not provide a value for `subscriber_email_addresses`, then - // `subscriber_email_addresses` is updated to empty. - google.protobuf.FieldMask update_mask = 2; -} - -// The request message for the CloseCase endpoint. -message CloseCaseRequest { - // Required. The name of the case to close. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; -} - -// The request message for the SearchCaseClassifications endpoint. -message SearchCaseClassificationsRequest { - // An expression used to filter case classifications. - // - // If it's an empty string, then no filtering happens. Otherwise, case - // classifications will be returned that match the filter. - string query = 1; - - // The maximum number of classifications fetched with each request. - int32 page_size = 2; - - // A token identifying the page of results to return. If unspecified, the - // first page is retrieved. - string page_token = 3; -} - -// The response message for SearchCaseClassifications endpoint. -message SearchCaseClassificationsResponse { - // The classifications retrieved. - repeated CaseClassification case_classifications = 1; - - // A token to retrieve the next page of results. Set this in the `page_token` - // field of subsequent `caseClassifications.list` requests. If unspecified, - // there are no more results to retrieve. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment.proto deleted file mode 100644 index 85c6f6076c8..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment.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.support.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2/actor.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2"; -option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "CommentProto"; -option java_package = "com.google.cloud.support.v2"; -option php_namespace = "Google\\Cloud\\Support\\V2"; -option ruby_package = "Google::Cloud::Support::V2"; - -// A comment associated with a support case. -// -// Case comments are the primary way for Google Support to communicate with a -// user who has opened a case. When a user responds to Google Support, the -// user's responses also appear as comments. -message Comment { - option (google.api.resource) = { - type: "cloudsupport.googleapis.com/Comment" - pattern: "organizations/{organization}/cases/{case}/comments/{comment}" - pattern: "projects/{project}/cases/{case}/comments/{comment}" - }; - - // Output only. Identifier. The resource name of the comment. - string name = 1 [ - (google.api.field_behavior) = IDENTIFIER, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. The time when the comment was created. - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The user or Google Support agent who created the comment. - Actor creator = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The full comment body. - // - // Maximum of 12800 characters. - string body = 4; - - // Output only. DEPRECATED. DO NOT USE. - // - // A duplicate of the `body` field. - // - // This field is only present for legacy reasons. - string plain_text_body = 5 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto deleted file mode 100644 index 6321b52b620..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto +++ /dev/null @@ -1,107 +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.support.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2/comment.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2"; -option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "CommentServiceProto"; -option java_package = "com.google.cloud.support.v2"; -option php_namespace = "Google\\Cloud\\Support\\V2"; -option ruby_package = "Google::Cloud::Support::V2"; - -// A service to manage comments on cases. -service CommentService { - option (google.api.default_host) = "cloudsupport.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // List all the comments associated with a case. - rpc ListComments(ListCommentsRequest) returns (ListCommentsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/cases/*}/comments" - additional_bindings { - get: "/v2/{parent=organizations/*/cases/*}/comments" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Add a new comment to a case. - // - // The comment must have the following fields set: `body`. - rpc CreateComment(CreateCommentRequest) returns (Comment) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/cases/*}/comments" - body: "comment" - additional_bindings { - post: "/v2/{parent=organizations/*/cases/*}/comments" - body: "comment" - } - }; - option (google.api.method_signature) = "parent,comment"; - } -} - -// The request message for the ListComments endpoint. -message ListCommentsRequest { - // Required. The name of the case for which to list comments. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; - - // The maximum number of comments to fetch. Defaults to 10. - int32 page_size = 4; - - // A token identifying the page of results to return. If unspecified, the - // first page is returned. - string page_token = 5; -} - -// The response message for the ListComments endpoint. -message ListCommentsResponse { - // List of the comments associated with the case. - repeated Comment comments = 1; - - // A token to retrieve the next page of results. Set this in the `page_token` - // field of subsequent `cases.comments.list` requests. If unspecified, there - // are no more results to retrieve. - string next_page_token = 2; -} - -// The request message for the CreateComment endpoint. -message CreateCommentRequest { - // Required. The name of the case to which the comment should be added. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; - - // Required. The comment to be added. - Comment comment = 2 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/escalation.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/escalation.proto deleted file mode 100644 index ffc79d9e11f..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2/escalation.proto +++ /dev/null @@ -1,53 +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.support.v2; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2"; -option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "EscalationProto"; -option java_package = "com.google.cloud.support.v2"; -option php_namespace = "Google\\Cloud\\Support\\V2"; -option ruby_package = "Google::Cloud::Support::V2"; - -// An escalation of a support case. -message Escalation { - // An enum detailing the possible reasons a case may be escalated. - enum Reason { - // The escalation reason is in an unknown state or has not been specified. - REASON_UNSPECIFIED = 0; - - // The case is taking too long to resolve. - RESOLUTION_TIME = 1; - - // The support agent does not have the expertise required to successfully - // resolve the issue. - TECHNICAL_EXPERTISE = 2; - - // The issue is having a significant business impact. - BUSINESS_IMPACT = 3; - } - - // Required. The reason why the Case is being escalated. - Reason reason = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. A free text description to accompany the `reason` field above. - // Provides additional context on why the case is being escalated. - string justification = 5 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto deleted file mode 100644 index 6effd8a3acf..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/actor.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.support.v2beta; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2Beta"; -option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "ActorProto"; -option java_package = "com.google.cloud.support.v2beta"; -option php_namespace = "Google\\Cloud\\Support\\V2beta"; -option ruby_package = "Google::Cloud::Support::V2beta"; - -// An Actor represents an entity that performed an action. For example, an actor -// could be a user who posted a comment on a support case, a user who -// uploaded an attachment, or a service account that created a support case. -message Actor { - // The name to display for the actor. If not provided, it is inferred from - // credentials supplied during case creation. When an email is provided, a - // display name must also be provided. This will be obfuscated if the user - // is a Google Support agent. - string display_name = 1; - - // The email address of the actor. If not provided, it is inferred from the - // credentials supplied during case creation. When a name is provided, an - // email must also be provided. If the user is a Google Support agent, this is - // obfuscated. - // - // This field is deprecated. Use `username` instead. - string email = 2 [deprecated = true]; - - // Output only. Whether the actor is a Google support actor. - bool google_support = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The username of the actor. It may look like an email or other - // format provided by the identity provider. If not provided, it is inferred - // from the credentials supplied. When a name is provided, a username must - // also be provided. If the user is a Google Support agent, this will not be - // set. - string username = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto deleted file mode 100644 index 918d006edbd..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment.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.support.v2beta; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2beta/actor.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2Beta"; -option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "AttachmentProto"; -option java_package = "com.google.cloud.support.v2beta"; -option php_namespace = "Google\\Cloud\\Support\\V2beta"; -option ruby_package = "Google::Cloud::Support::V2beta"; - -// An Attachment contains metadata about a file that was uploaded to a -// case - it is NOT a file itself. That being said, the name of an Attachment -// object can be used to download its accompanying file through the -// `media.download` endpoint. -// -// While attachments can be uploaded in the console at the -// same time as a comment, they're associated on a "case" level, not a -// "comment" level. -message Attachment { - option (google.api.resource) = { - type: "cloudsupport.googleapis.com/Attachment" - pattern: "organizations/{organization}/cases/{case}/attachments/{attachment_id}" - pattern: "projects/{project}/cases/{case}/attachments/{attachment_id}" - }; - - // Output only. Identifier. The resource name of the attachment. - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = IDENTIFIER - ]; - - // Output only. The time at which the attachment was created. - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The user who uploaded the attachment. Note, the name and email - // will be obfuscated if the attachment was uploaded by Google support. - Actor creator = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The filename of the attachment (e.g. `"graph.jpg"`). - string filename = 4; - - // Output only. The MIME type of the attachment (e.g. text/plain). - string mime_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The size of the attachment in bytes. - int64 size_bytes = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto deleted file mode 100644 index acf53096443..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto +++ /dev/null @@ -1,105 +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.support.v2beta; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2beta/attachment.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2Beta"; -option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "AttachmentServiceProto"; -option java_package = "com.google.cloud.support.v2beta"; -option php_namespace = "Google\\Cloud\\Support\\V2beta"; -option ruby_package = "Google::Cloud::Support::V2beta"; - -// A service to manage file attachments for Google Cloud support cases. -service CaseAttachmentService { - option (google.api.default_host) = "cloudsupport.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // List all the attachments associated with a support case. - rpc ListAttachments(ListAttachmentsRequest) - returns (ListAttachmentsResponse) { - option (google.api.http) = { - get: "/v2beta/{parent=projects/*/cases/*}/attachments" - additional_bindings { - get: "/v2beta/{parent=organizations/*/cases/*}/attachments" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Retrieve an attachment. - rpc GetAttachment(GetAttachmentRequest) returns (Attachment) { - option (google.api.http) = { - get: "/v2beta/{name=*/*/cases/*/attachments/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// The request message for the ListAttachments endpoint. -message ListAttachmentsRequest { - // Required. The name of the case for which attachments should be listed. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; - - // The maximum number of attachments fetched with each request. - // - // If not provided, the default is 10. The maximum page size that will be - // returned is 100. - // - // The size of each page can be smaller than the requested page size and can - // include zero. For example, you could request 100 attachments on one page, - // receive 0, and then on the next page, receive 90. - int32 page_size = 2; - - // A token identifying the page of results to return. If unspecified, the - // first page is retrieved. - string page_token = 3; -} - -// Request for getting an attachment. -message GetAttachmentRequest { - // Required. The name of the attachment to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Attachment" - } - ]; -} - -// The response message for the ListAttachments endpoint. -message ListAttachmentsResponse { - // The list of attachments associated with a case. - repeated Attachment attachments = 1; - - // A token to retrieve the next page of results. Set this in the `page_token` - // field of subsequent `cases.attachments.list` requests. If unspecified, - // there are no more results to retrieve. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case.proto deleted file mode 100644 index 10a2cb6c8c9..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case.proto +++ /dev/null @@ -1,218 +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.support.v2beta; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2beta/actor.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2Beta"; -option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "CaseProto"; -option java_package = "com.google.cloud.support.v2beta"; -option php_namespace = "Google\\Cloud\\Support\\V2beta"; -option ruby_package = "Google::Cloud::Support::V2beta"; - -// The product line a support case may be associated with. -enum ProductLine { - // Unknown product type. - PRODUCT_LINE_UNSPECIFIED = 0; - - // Google Cloud - GOOGLE_CLOUD = 1; - - // Google Maps - GOOGLE_MAPS = 2; -} - -// A Case is an object that contains the details of a support case. It -// contains fields for the time it was created, its priority, its -// classification, and more. Cases can also have comments and attachments that -// get added over time. -// -// A case is parented by a Google Cloud organization or project. -// -// Organizations are identified by a number, so the name of a case parented by -// an organization would look like this: -// -// ``` -// organizations/123/cases/456 -// ``` -// -// Projects have two unique identifiers, an ID and a number, and they look like -// this: -// -// ``` -// projects/abc/cases/456 -// ``` -// -// ``` -// projects/123/cases/456 -// ``` -// -// You can use either of them when calling the API. To learn more -// about project identifiers, see [AIP-2510](https://google.aip.dev/cloud/2510). -message Case { - option (google.api.resource) = { - type: "cloudsupport.googleapis.com/Case" - pattern: "organizations/{organization}/cases/{case}" - pattern: "projects/{project}/cases/{case}" - }; - - // The status of a support case. - enum State { - // Case is in an unknown state. - STATE_UNSPECIFIED = 0; - - // The case has been created but no one is assigned to work on it yet. - NEW = 1; - - // The case is currently being handled by Google support. - IN_PROGRESS_GOOGLE_SUPPORT = 2; - - // Google is waiting for a response. - ACTION_REQUIRED = 3; - - // A solution has been offered for the case, but it isn't yet closed. - SOLUTION_PROVIDED = 4; - - // The case has been resolved. - CLOSED = 5; - } - - // The case Priority. P0 is most urgent and P4 the least. - enum Priority { - // Priority is undefined or has not been set yet. - PRIORITY_UNSPECIFIED = 0; - - // Extreme impact on a production service. Service is hard down. - P0 = 1; - - // Critical impact on a production service. Service is currently unusable. - P1 = 2; - - // Severe impact on a production service. Service is usable but greatly - // impaired. - P2 = 3; - - // Medium impact on a production service. Service is available, but - // moderately impaired. - P3 = 4; - - // General questions or minor issues. Production service is fully - // available. - P4 = 5; - } - - // Identifier. The resource name for the case. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // The short summary of the issue reported in this case. - string display_name = 2; - - // A broad description of the issue. - string description = 3; - - // The issue classification applicable to this case. - CaseClassification classification = 4; - - // The timezone of the user who created the support case. - // It should be in a format IANA recognizes: https://www.iana.org/time-zones. - // There is no additional validation done by the API. - string time_zone = 8; - - // The email addresses to receive updates on this case. - repeated string subscriber_email_addresses = 9; - - // Output only. The current status of the support case. - State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time this case was created. - google.protobuf.Timestamp create_time = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time this case was last updated. - google.protobuf.Timestamp update_time = 14 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The user who created the case. - // - // Note: The name and email will be obfuscated if the case was created by - // Google Support. - Actor creator = 15; - - // A user-supplied email address to send case update notifications for. This - // should only be used in BYOID flows, where we cannot infer the user's email - // address directly from their EUCs. - string contact_email = 35; - - // Whether the case is currently escalated. - bool escalated = 17; - - // Whether this case was created for internal API testing and should not be - // acted on by the support team. - bool test_case = 19; - - // The language the user has requested to receive support in. This should be a - // BCP 47 language code (e.g., `"en"`, `"zh-CN"`, `"zh-TW"`, `"ja"`, `"ko"`). - // If no language or an unsupported language is specified, this field defaults - // to English (en). - // - // Language selection during case creation may affect your available support - // options. For a list of supported languages and their support working hours, - // see: https://cloud.google.com/support/docs/language-working-hours - string language_code = 23; - - // The priority of this case. - Priority priority = 32; -} - -// A Case Classification represents the topic that a case is about. It's very -// important to use accurate classifications, because they're -// used to route your cases to specialists who can help you. -// -// A classification always has an ID that is its unique identifier. -// A valid ID is required when creating a case. -message CaseClassification { - // The unique ID for a classification. Must be specified for case creation. - // - // To retrieve valid classification IDs for case creation, use - // `caseClassifications.search`. - // - // Classification IDs returned by `caseClassifications.search` are guaranteed - // to be valid for at least 6 months. If a given classification is - // deactiveated, it will immediately stop being returned. After 6 months, - // `case.create` requests using the classification ID will fail. - string id = 3; - - // A display name for the classification. - // - // The display name is not static and can change. To uniquely and consistently - // identify classifications, use the `CaseClassification.id` field. - string display_name = 4; - - // The full product the classification corresponds to. - Product product = 10; -} - -// The product a case may be associated with. -message Product { - // The product line of the Product. - ProductLine product_line = 1; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto deleted file mode 100644 index 8863f275036..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto +++ /dev/null @@ -1,360 +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.support.v2beta; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2beta/case.proto"; -import "google/cloud/support/v2beta/escalation.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2Beta"; -option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "CaseServiceProto"; -option java_package = "com.google.cloud.support.v2beta"; -option php_namespace = "Google\\Cloud\\Support\\V2beta"; -option ruby_package = "Google::Cloud::Support::V2beta"; - -// A service to manage Google Cloud support cases. -service CaseService { - option (google.api.default_host) = "cloudsupport.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Retrieve a case. - rpc GetCase(GetCaseRequest) returns (Case) { - option (google.api.http) = { - get: "/v2beta/{name=projects/*/cases/*}" - additional_bindings { get: "/v2beta/{name=organizations/*/cases/*}" } - }; - option (google.api.method_signature) = "name"; - } - - // Retrieve all cases under a parent, but not its children. - // - // For example, listing cases under an organization only returns the cases - // that are directly parented by that organization. To retrieve cases - // under an organization and its projects, use `cases.search`. - rpc ListCases(ListCasesRequest) returns (ListCasesResponse) { - option (google.api.http) = { - get: "/v2beta/{parent=projects/*}/cases" - additional_bindings { get: "/v2beta/{parent=organizations/*}/cases" } - }; - option (google.api.method_signature) = "parent"; - } - - // Search for cases using a query. - rpc SearchCases(SearchCasesRequest) returns (SearchCasesResponse) { - option (google.api.http) = { - get: "/v2beta/{parent=projects/*}/cases:search" - additional_bindings { - get: "/v2beta/{parent=organizations/*}/cases:search" - } - }; - } - - // Create a new case and associate it with a parent. - // - // It must have the following fields set: `display_name`, `description`, - // `classification`, and `priority`. If you're just testing the API and don't - // want to route your case to an agent, set `testCase=true`. - rpc CreateCase(CreateCaseRequest) returns (Case) { - option (google.api.http) = { - post: "/v2beta/{parent=projects/*}/cases" - body: "case" - additional_bindings { - post: "/v2beta/{parent=organizations/*}/cases" - body: "case" - } - }; - option (google.api.method_signature) = "parent,case"; - } - - // Update a case. Only some fields can be updated. - rpc UpdateCase(UpdateCaseRequest) returns (Case) { - option (google.api.http) = { - patch: "/v2beta/{case.name=projects/*/cases/*}" - body: "case" - additional_bindings { - patch: "/v2beta/{case.name=organizations/*/cases/*}" - body: "case" - } - }; - option (google.api.method_signature) = "case,update_mask"; - } - - // Escalate a case, starting the Google Cloud Support escalation management - // process. - // - // This operation is only available for some support services. Go to - // https://cloud.google.com/support and look for 'Technical support - // escalations' in the feature list to find out which ones let you - // do that. - rpc EscalateCase(EscalateCaseRequest) returns (Case) { - option (google.api.http) = { - post: "/v2beta/{name=projects/*/cases/*}:escalate" - body: "*" - additional_bindings { - post: "/v2beta/{name=organizations/*/cases/*}:escalate" - body: "*" - } - }; - } - - // Close a case. - rpc CloseCase(CloseCaseRequest) returns (Case) { - option (google.api.http) = { - post: "/v2beta/{name=projects/*/cases/*}:close" - body: "*" - additional_bindings { - post: "/v2beta/{name=organizations/*/cases/*}:close" - body: "*" - } - }; - } - - // Retrieve valid classifications to use when creating a support case. - // - // Classifications are hierarchical. Each classification is a string - // containing all levels of the hierarchy separated by `" > "`. For example, - // `"Technical Issue > Compute > Compute Engine"`. - // - // Classification IDs returned by this endpoint are valid for at least six - // months. When a classification is deactivated, this endpoint immediately - // stops returning it. After six months, `case.create` requests using the - // classification will fail. - rpc SearchCaseClassifications(SearchCaseClassificationsRequest) - returns (SearchCaseClassificationsResponse) { - option (google.api.http) = { - get: "/v2beta/caseClassifications:search" - }; - } -} - -// The request message for the GetCase endpoint. -message GetCaseRequest { - // Required. The full name of a case to be retrieved. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; -} - -// The request message for the CreateCase endpoint. -message CreateCaseRequest { - // Required. The name of the parent under which the case should be created. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudsupport.googleapis.com/Case" - } - ]; - - // Required. The case to be created. - Case case = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The request message for the ListCases endpoint. -message ListCasesRequest { - // Required. The name of a parent to list cases under. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudsupport.googleapis.com/Case" - } - ]; - - // An expression used to filter cases. - // - // If it's an empty string, then no filtering happens. Otherwise, the endpoint - // returns the cases that match the filter. - // - // Expressions use the following fields separated by `AND` and specified with - // `=`: - // - // - `state`: Can be `OPEN` or `CLOSED`. - // - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - // can specify multiple values for priority using the `OR` operator. For - // example, `priority=P1 OR priority=P2`. - // - `creator.email`: The email address of the case creator. - // - // EXAMPLES: - // - // - `state=CLOSED` - // - `state=OPEN AND creator.email="tester@example.com"` - // - `state=OPEN AND (priority=P0 OR priority=P1)` - string filter = 2; - - // The maximum number of cases fetched with each request. Defaults to 10. - int32 page_size = 4; - - // A token identifying the page of results to return. If unspecified, the - // first page is retrieved. - string page_token = 5; - - // The product line to request cases for. If unspecified, only - // Google Cloud cases will be returned. - optional ProductLine product_line = 8; -} - -// The response message for the ListCases endpoint. -message ListCasesResponse { - // The list of cases associated with the parent after any - // filters have been applied. - repeated Case cases = 1; - - // A token to retrieve the next page of results. Set this in the `page_token` - // field of subsequent `cases.list` requests. If unspecified, there are no - // more results to retrieve. - string next_page_token = 2; -} - -// The request message for the SearchCases endpoint. -message SearchCasesRequest { - // The name of the parent resource to search for cases under. - string parent = 4; - - // An expression used to filter cases. - // - // Expressions use the following fields separated by `AND` and specified with - // `=`: - // - // - `organization`: An organization name in the form - // `organizations/`. - // - `project`: A project name in the form `projects/`. - // - `state`: Can be `OPEN` or `CLOSED`. - // - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - // can specify multiple values for priority using the `OR` operator. For - // example, `priority=P1 OR priority=P2`. - // - `creator.email`: The email address of the case creator. - // - // You must specify either `organization` or `project`. - // - // To search across `displayName`, `description`, and comments, use a global - // restriction with no keyword or operator. For example, `"my search"`. - // - // To search only cases updated after a certain date, use `update_time` - // restricted with that particular date, time, and timezone in ISO datetime - // format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - // `update_time` only supports the greater than operator (`>`). - // - // Examples: - // - // - `organization="organizations/123456789"` - // - `project="projects/my-project-id"` - // - `project="projects/123456789"` - // - `organization="organizations/123456789" AND state=CLOSED` - // - `project="projects/my-project-id" AND creator.email="tester@example.com"` - // - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - string query = 1; - - // The maximum number of cases fetched with each request. The default page - // size is 10. - int32 page_size = 2; - - // A token identifying the page of results to return. If unspecified, the - // first page is retrieved. - string page_token = 3; -} - -// The response message for the SearchCases endpoint. -message SearchCasesResponse { - // The list of cases associated with the parent after any - // filters have been applied. - repeated Case cases = 1; - - // A token to retrieve the next page of results. Set this in the - // `page_token` field of subsequent `cases.search` requests. If unspecified, - // there are no more results to retrieve. - string next_page_token = 2; -} - -// The request message for the EscalateCase endpoint. -message EscalateCaseRequest { - // Required. The name of the case to be escalated. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; - - // The escalation information to be sent with the escalation request. - Escalation escalation = 2; -} - -// The request message for the UpdateCase endpoint -message UpdateCaseRequest { - // Required. The case to update. - Case case = 1 [(google.api.field_behavior) = REQUIRED]; - - // A list of attributes of the case that should be updated. Supported values - // are `priority`, `display_name`, and `subscriber_email_addresses`. If no - // fields are specified, all supported fields are updated. - // - // Be careful - if you do not provide a field mask, then you might - // accidentally clear some fields. For example, if you leave the field mask - // empty and do not provide a value for `subscriber_email_addresses`, then - // `subscriber_email_addresses` is updated to empty. - google.protobuf.FieldMask update_mask = 2; -} - -// The request message for the CloseCase endpoint. -message CloseCaseRequest { - // Required. The name of the case to close. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; -} - -// The request message for the SearchCaseClassifications endpoint. -message SearchCaseClassificationsRequest { - // An expression used to filter case classifications. - // - // If it's an empty string, then no filtering happens. Otherwise, case - // classifications will be returned that match the filter. - string query = 1; - - // The maximum number of classifications fetched with each request. - int32 page_size = 2; - - // A token identifying the page of results to return. If unspecified, the - // first page is retrieved. - string page_token = 3; - - // Optional. The product to return case classifications for. - Product product = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response message for SearchCaseClassifications endpoint. -message SearchCaseClassificationsResponse { - // The classifications retrieved. - repeated CaseClassification case_classifications = 1; - - // A token to retrieve the next page of results. Set this in the `page_token` - // field of subsequent `caseClassifications.list` requests. If unspecified, - // there are no more results to retrieve. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto deleted file mode 100644 index dd6b1ee2e0f..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment.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.support.v2beta; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2beta/actor.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2Beta"; -option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "CommentProto"; -option java_package = "com.google.cloud.support.v2beta"; -option php_namespace = "Google\\Cloud\\Support\\V2beta"; -option ruby_package = "Google::Cloud::Support::V2beta"; - -// A comment associated with a support case. -// -// Case comments are the primary way for Google Support to communicate with a -// user who has opened a case. When a user responds to Google Support, the -// user's responses also appear as comments. -message Comment { - option (google.api.resource) = { - type: "cloudsupport.googleapis.com/Comment" - pattern: "organizations/{organization}/cases/{case}/comments/{comment}" - pattern: "projects/{project}/cases/{case}/comments/{comment}" - }; - - // Output only. Identifier. The resource name of the comment. - string name = 1 [ - (google.api.field_behavior) = IDENTIFIER, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. The time when the comment was created. - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The user or Google Support agent who created the comment. - Actor creator = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The full comment body. - // - // Maximum of 12800 characters. - string body = 4; - - // Output only. DEPRECATED. DO NOT USE. - // - // A duplicate of the `body` field. - // - // This field is only present for legacy reasons. - string plain_text_body = 5 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto deleted file mode 100644 index dff46126955..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto +++ /dev/null @@ -1,126 +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.support.v2beta; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2beta/comment.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2Beta"; -option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "CommentServiceProto"; -option java_package = "com.google.cloud.support.v2beta"; -option php_namespace = "Google\\Cloud\\Support\\V2beta"; -option ruby_package = "Google::Cloud::Support::V2beta"; - -// A service to manage comments on cases. -service CommentService { - option (google.api.default_host) = "cloudsupport.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // List all the comments associated with a case. - rpc ListComments(ListCommentsRequest) returns (ListCommentsResponse) { - option (google.api.http) = { - get: "/v2beta/{parent=projects/*/cases/*}/comments" - additional_bindings { - get: "/v2beta/{parent=organizations/*/cases/*}/comments" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Add a new comment to a case. - // - // The comment must have the following fields set: `body`. - rpc CreateComment(CreateCommentRequest) returns (Comment) { - option (google.api.http) = { - post: "/v2beta/{parent=projects/*/cases/*}/comments" - body: "comment" - additional_bindings { - post: "/v2beta/{parent=organizations/*/cases/*}/comments" - body: "comment" - } - }; - option (google.api.method_signature) = "parent,comment"; - } - - // Retrieve a comment. - rpc GetComment(GetCommentRequest) returns (Comment) { - option (google.api.http) = { - get: "/v2beta/{name=*/*/cases/*/comments/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// The request message for the ListComments endpoint. -message ListCommentsRequest { - // Required. The name of the case for which to list comments. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; - - // The maximum number of comments to fetch. Defaults to 10. - int32 page_size = 4; - - // A token identifying the page of results to return. If unspecified, the - // first page is returned. - string page_token = 5; -} - -// The response message for the ListComments endpoint. -message ListCommentsResponse { - // List of the comments associated with the case. - repeated Comment comments = 1; - - // A token to retrieve the next page of results. Set this in the `page_token` - // field of subsequent `cases.comments.list` requests. If unspecified, there - // are no more results to retrieve. - string next_page_token = 2; -} - -// The request message for the CreateComment endpoint. -message CreateCommentRequest { - // Required. The name of the case to which the comment should be added. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; - - // Required. The comment to be added. - Comment comment = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The request message for the GetComment endpoint. -message GetCommentRequest { - // Required. The name of the comment to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Comment" - } - ]; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/content.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/content.proto deleted file mode 100644 index 29750d7c24f..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/content.proto +++ /dev/null @@ -1,31 +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.support.v2beta; - -option csharp_namespace = "Google.Cloud.Support.V2Beta"; -option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "ContentProto"; -option java_package = "com.google.cloud.support.v2beta"; -option php_namespace = "Google\\Cloud\\Support\\V2beta"; -option ruby_package = "Google::Cloud::Support::V2beta"; - -// Stores text attached to a support object. -message TextContent { - // Content in this field should be rendered and interpreted as-is. - string plain_text = 1; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto deleted file mode 100644 index 6321cf00645..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto +++ /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 -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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.support.v2beta; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2beta/actor.proto"; -import "google/cloud/support/v2beta/content.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2Beta"; -option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "EmailMessageProto"; -option java_package = "com.google.cloud.support.v2beta"; -option php_namespace = "Google\\Cloud\\Support\\V2beta"; -option ruby_package = "Google::Cloud::Support::V2beta"; - -// An email associated with a support case. -message EmailMessage { - option (google.api.resource) = { - type: "cloudsupport.googleapis.com/EmailMessage" - pattern: "projects/{project}/cases/{case}/emailMessages/{email_message}" - pattern: "organizations/{organization}/cases/{case}/emailMessages/{email_message}" - plural: "emailMessages" - singular: "emailMessage" - }; - - // Identifier. Resource name for the email message. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. Time when this email message object was created. - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The user or Google Support agent that created this email - // message. This is inferred from the headers on the email message. - Actor actor = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Subject of the email. - string subject = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email addresses the email was sent to. - repeated string recipient_email_addresses = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email addresses CCed on the email. - repeated string cc_email_addresses = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The full email message body. A best-effort attempt is made to - // remove extraneous reply threads. - TextContent body_content = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto deleted file mode 100644 index abec570edec..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto +++ /dev/null @@ -1,53 +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.support.v2beta; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2Beta"; -option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "EscalationProto"; -option java_package = "com.google.cloud.support.v2beta"; -option php_namespace = "Google\\Cloud\\Support\\V2beta"; -option ruby_package = "Google::Cloud::Support::V2beta"; - -// An escalation of a support case. -message Escalation { - // An enum detailing the possible reasons a case may be escalated. - enum Reason { - // The escalation reason is in an unknown state or has not been specified. - REASON_UNSPECIFIED = 0; - - // The case is taking too long to resolve. - RESOLUTION_TIME = 1; - - // The support agent does not have the expertise required to successfully - // resolve the issue. - TECHNICAL_EXPERTISE = 2; - - // The issue is having a significant business impact. - BUSINESS_IMPACT = 3; - } - - // Required. The reason why the Case is being escalated. - Reason reason = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. A free text description to accompany the `reason` field above. - // Provides additional context on why the case is being escalated. - string justification = 5 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto deleted file mode 100644 index c275dbcc341..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.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.support.v2beta; - -import "google/api/field_behavior.proto"; -import "google/cloud/support/v2beta/attachment.proto"; -import "google/cloud/support/v2beta/comment.proto"; -import "google/cloud/support/v2beta/email_message.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2Beta"; -option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "FeedItemProto"; -option java_package = "com.google.cloud.support.v2beta"; -option php_namespace = "Google\\Cloud\\Support\\V2beta"; -option ruby_package = "Google::Cloud::Support::V2beta"; - -// A feed item associated with a support case. -message FeedItem { - // The object corresponding to the event. - oneof event_object { - // Output only. A comment added to the case. - Comment comment = 100 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. An attachment attached to the case. - Attachment attachment = 101 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. An email message received in reply to the case. - EmailMessage email_message = 102 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A deleted attachment that used to be associated with the - // support case. - Attachment deleted_attachment = 103 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. Time corresponding to the event of this item. - google.protobuf.Timestamp event_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto b/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto deleted file mode 100644 index 02d36c19808..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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.support.v2beta; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/support/v2beta/feed_item.proto"; - -option csharp_namespace = "Google.Cloud.Support.V2Beta"; -option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb"; -option java_multiple_files = true; -option java_outer_classname = "FeedServiceProto"; -option java_package = "com.google.cloud.support.v2beta"; -option php_namespace = "Google\\Cloud\\Support\\V2beta"; -option ruby_package = "Google::Cloud::Support::V2beta"; - -// A service to view case feed items. -service FeedService { - option (google.api.default_host) = "cloudsupport.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Show items in the feed of this case, including case emails, - // attachments, and comments. - rpc ShowFeed(ShowFeedRequest) returns (ShowFeedResponse) { - option (google.api.http) = { - get: "/v2beta/{parent=projects/*/cases/*}:showFeed" - additional_bindings { - get: "/v2beta/{parent=organizations/*/cases/*}:showFeed" - } - }; - option (google.api.method_signature) = "parent"; - } -} - -// The request message for the ShowFeed endpoint. -message ShowFeedRequest { - // Required. The resource name of the case for which feed items should be - // listed. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudsupport.googleapis.com/Case" - } - ]; - - // Optional. Field to order feed items by, followed by `asc` or `desc` - // postfix. The only valid field is - // `creation_time`. This list is case-insensitive, default sorting order is - // ascending, and the redundant space characters are insignificant. - // - // Example: `creation_time desc` - string order_by = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of feed items fetched with each request. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying the page of results to return. If - // unspecified, it retrieves the first page. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response message for the ShowFeed endpoint. -message ShowFeedResponse { - // The list of feed items associated with the given Case. - repeated FeedItem feed_items = 1; - - // A token to retrieve the next page of results. This should be set in the - // `page_token` field of subsequent `ShowFeedRequests`. - // If unspecified, there are no more results to retrieve. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-cloud-support/protos/protos.d.ts b/owl-bot-staging/google-cloud-support/protos/protos.d.ts deleted file mode 100644 index bda14d751a7..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/protos.d.ts +++ /dev/null @@ -1,13074 +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 support. */ - namespace support { - - /** Namespace v2. */ - namespace v2 { - - /** Properties of an Actor. */ - interface IActor { - - /** Actor displayName */ - displayName?: (string|null); - - /** Actor email */ - email?: (string|null); - - /** Actor googleSupport */ - googleSupport?: (boolean|null); - - /** Actor username */ - username?: (string|null); - } - - /** Represents an Actor. */ - class Actor implements IActor { - - /** - * Constructs a new Actor. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IActor); - - /** Actor displayName. */ - public displayName: string; - - /** Actor email. */ - public email: string; - - /** Actor googleSupport. */ - public googleSupport: boolean; - - /** Actor username. */ - public username: string; - - /** - * Creates a new Actor instance using the specified properties. - * @param [properties] Properties to set - * @returns Actor instance - */ - public static create(properties?: google.cloud.support.v2.IActor): google.cloud.support.v2.Actor; - - /** - * Encodes the specified Actor message. Does not implicitly {@link google.cloud.support.v2.Actor.verify|verify} messages. - * @param message Actor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IActor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Actor message, length delimited. Does not implicitly {@link google.cloud.support.v2.Actor.verify|verify} messages. - * @param message Actor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IActor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Actor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Actor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Actor; - - /** - * Decodes an Actor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Actor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Actor; - - /** - * Verifies an Actor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Actor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Actor - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Actor; - - /** - * Creates a plain object from an Actor message. Also converts values to other types if specified. - * @param message Actor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.Actor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Actor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Actor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Attachment. */ - interface IAttachment { - - /** Attachment name */ - name?: (string|null); - - /** Attachment createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Attachment creator */ - creator?: (google.cloud.support.v2.IActor|null); - - /** Attachment filename */ - filename?: (string|null); - - /** Attachment mimeType */ - mimeType?: (string|null); - - /** Attachment sizeBytes */ - sizeBytes?: (number|Long|string|null); - } - - /** Represents an Attachment. */ - class Attachment implements IAttachment { - - /** - * Constructs a new Attachment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IAttachment); - - /** Attachment name. */ - public name: string; - - /** Attachment createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Attachment creator. */ - public creator?: (google.cloud.support.v2.IActor|null); - - /** Attachment filename. */ - public filename: string; - - /** Attachment mimeType. */ - public mimeType: string; - - /** Attachment sizeBytes. */ - public sizeBytes: (number|Long|string); - - /** - * Creates a new Attachment instance using the specified properties. - * @param [properties] Properties to set - * @returns Attachment instance - */ - public static create(properties?: google.cloud.support.v2.IAttachment): google.cloud.support.v2.Attachment; - - /** - * Encodes the specified Attachment message. Does not implicitly {@link google.cloud.support.v2.Attachment.verify|verify} messages. - * @param message Attachment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IAttachment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.cloud.support.v2.Attachment.verify|verify} messages. - * @param message Attachment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IAttachment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Attachment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Attachment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Attachment; - - /** - * Decodes an Attachment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Attachment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Attachment; - - /** - * Verifies an Attachment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Attachment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Attachment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Attachment; - - /** - * Creates a plain object from an Attachment message. Also converts values to other types if specified. - * @param message Attachment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.Attachment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Attachment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Attachment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a CaseAttachmentService */ - class CaseAttachmentService extends $protobuf.rpc.Service { - - /** - * Constructs a new CaseAttachmentService 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 CaseAttachmentService 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): CaseAttachmentService; - - /** - * Calls ListAttachments. - * @param request ListAttachmentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAttachmentsResponse - */ - public listAttachments(request: google.cloud.support.v2.IListAttachmentsRequest, callback: google.cloud.support.v2.CaseAttachmentService.ListAttachmentsCallback): void; - - /** - * Calls ListAttachments. - * @param request ListAttachmentsRequest message or plain object - * @returns Promise - */ - public listAttachments(request: google.cloud.support.v2.IListAttachmentsRequest): Promise; - } - - namespace CaseAttachmentService { - - /** - * Callback as used by {@link google.cloud.support.v2.CaseAttachmentService|listAttachments}. - * @param error Error, if any - * @param [response] ListAttachmentsResponse - */ - type ListAttachmentsCallback = (error: (Error|null), response?: google.cloud.support.v2.ListAttachmentsResponse) => void; - } - - /** Properties of a ListAttachmentsRequest. */ - interface IListAttachmentsRequest { - - /** ListAttachmentsRequest parent */ - parent?: (string|null); - - /** ListAttachmentsRequest pageSize */ - pageSize?: (number|null); - - /** ListAttachmentsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListAttachmentsRequest. */ - class ListAttachmentsRequest implements IListAttachmentsRequest { - - /** - * Constructs a new ListAttachmentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IListAttachmentsRequest); - - /** ListAttachmentsRequest parent. */ - public parent: string; - - /** ListAttachmentsRequest pageSize. */ - public pageSize: number; - - /** ListAttachmentsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListAttachmentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAttachmentsRequest instance - */ - public static create(properties?: google.cloud.support.v2.IListAttachmentsRequest): google.cloud.support.v2.ListAttachmentsRequest; - - /** - * Encodes the specified ListAttachmentsRequest message. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsRequest.verify|verify} messages. - * @param message ListAttachmentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IListAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsRequest.verify|verify} messages. - * @param message ListAttachmentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IListAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAttachmentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAttachmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListAttachmentsRequest; - - /** - * Decodes a ListAttachmentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAttachmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListAttachmentsRequest; - - /** - * Verifies a ListAttachmentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAttachmentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAttachmentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListAttachmentsRequest; - - /** - * Creates a plain object from a ListAttachmentsRequest message. Also converts values to other types if specified. - * @param message ListAttachmentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.ListAttachmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAttachmentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAttachmentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAttachmentsResponse. */ - interface IListAttachmentsResponse { - - /** ListAttachmentsResponse attachments */ - attachments?: (google.cloud.support.v2.IAttachment[]|null); - - /** ListAttachmentsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAttachmentsResponse. */ - class ListAttachmentsResponse implements IListAttachmentsResponse { - - /** - * Constructs a new ListAttachmentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IListAttachmentsResponse); - - /** ListAttachmentsResponse attachments. */ - public attachments: google.cloud.support.v2.IAttachment[]; - - /** ListAttachmentsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAttachmentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAttachmentsResponse instance - */ - public static create(properties?: google.cloud.support.v2.IListAttachmentsResponse): google.cloud.support.v2.ListAttachmentsResponse; - - /** - * Encodes the specified ListAttachmentsResponse message. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsResponse.verify|verify} messages. - * @param message ListAttachmentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IListAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsResponse.verify|verify} messages. - * @param message ListAttachmentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IListAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAttachmentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAttachmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListAttachmentsResponse; - - /** - * Decodes a ListAttachmentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAttachmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListAttachmentsResponse; - - /** - * Verifies a ListAttachmentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAttachmentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAttachmentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListAttachmentsResponse; - - /** - * Creates a plain object from a ListAttachmentsResponse message. Also converts values to other types if specified. - * @param message ListAttachmentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.ListAttachmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAttachmentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAttachmentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Case. */ - interface ICase { - - /** Case name */ - name?: (string|null); - - /** Case displayName */ - displayName?: (string|null); - - /** Case description */ - description?: (string|null); - - /** Case classification */ - classification?: (google.cloud.support.v2.ICaseClassification|null); - - /** Case timeZone */ - timeZone?: (string|null); - - /** Case subscriberEmailAddresses */ - subscriberEmailAddresses?: (string[]|null); - - /** Case state */ - state?: (google.cloud.support.v2.Case.State|keyof typeof google.cloud.support.v2.Case.State|null); - - /** Case createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Case updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Case creator */ - creator?: (google.cloud.support.v2.IActor|null); - - /** Case contactEmail */ - contactEmail?: (string|null); - - /** Case escalated */ - escalated?: (boolean|null); - - /** Case testCase */ - testCase?: (boolean|null); - - /** Case languageCode */ - languageCode?: (string|null); - - /** Case priority */ - priority?: (google.cloud.support.v2.Case.Priority|keyof typeof google.cloud.support.v2.Case.Priority|null); - } - - /** Represents a Case. */ - class Case implements ICase { - - /** - * Constructs a new Case. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.ICase); - - /** Case name. */ - public name: string; - - /** Case displayName. */ - public displayName: string; - - /** Case description. */ - public description: string; - - /** Case classification. */ - public classification?: (google.cloud.support.v2.ICaseClassification|null); - - /** Case timeZone. */ - public timeZone: string; - - /** Case subscriberEmailAddresses. */ - public subscriberEmailAddresses: string[]; - - /** Case state. */ - public state: (google.cloud.support.v2.Case.State|keyof typeof google.cloud.support.v2.Case.State); - - /** Case createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Case updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Case creator. */ - public creator?: (google.cloud.support.v2.IActor|null); - - /** Case contactEmail. */ - public contactEmail: string; - - /** Case escalated. */ - public escalated: boolean; - - /** Case testCase. */ - public testCase: boolean; - - /** Case languageCode. */ - public languageCode: string; - - /** Case priority. */ - public priority: (google.cloud.support.v2.Case.Priority|keyof typeof google.cloud.support.v2.Case.Priority); - - /** - * Creates a new Case instance using the specified properties. - * @param [properties] Properties to set - * @returns Case instance - */ - public static create(properties?: google.cloud.support.v2.ICase): google.cloud.support.v2.Case; - - /** - * Encodes the specified Case message. Does not implicitly {@link google.cloud.support.v2.Case.verify|verify} messages. - * @param message Case message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.ICase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.support.v2.Case.verify|verify} messages. - * @param message Case message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.ICase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Case message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Case - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Case; - - /** - * Decodes a Case message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Case - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Case; - - /** - * Verifies a Case message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Case message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Case - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Case; - - /** - * Creates a plain object from a Case message. Also converts values to other types if specified. - * @param message Case - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.Case, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Case to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Case - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Case { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - NEW = 1, - IN_PROGRESS_GOOGLE_SUPPORT = 2, - ACTION_REQUIRED = 3, - SOLUTION_PROVIDED = 4, - CLOSED = 5 - } - - /** Priority enum. */ - enum Priority { - PRIORITY_UNSPECIFIED = 0, - P0 = 1, - P1 = 2, - P2 = 3, - P3 = 4, - P4 = 5 - } - } - - /** Properties of a CaseClassification. */ - interface ICaseClassification { - - /** CaseClassification id */ - id?: (string|null); - - /** CaseClassification displayName */ - displayName?: (string|null); - } - - /** Represents a CaseClassification. */ - class CaseClassification implements ICaseClassification { - - /** - * Constructs a new CaseClassification. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.ICaseClassification); - - /** CaseClassification id. */ - public id: string; - - /** CaseClassification displayName. */ - public displayName: string; - - /** - * Creates a new CaseClassification instance using the specified properties. - * @param [properties] Properties to set - * @returns CaseClassification instance - */ - public static create(properties?: google.cloud.support.v2.ICaseClassification): google.cloud.support.v2.CaseClassification; - - /** - * Encodes the specified CaseClassification message. Does not implicitly {@link google.cloud.support.v2.CaseClassification.verify|verify} messages. - * @param message CaseClassification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.ICaseClassification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CaseClassification message, length delimited. Does not implicitly {@link google.cloud.support.v2.CaseClassification.verify|verify} messages. - * @param message CaseClassification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.ICaseClassification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CaseClassification message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CaseClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.CaseClassification; - - /** - * Decodes a CaseClassification message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CaseClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.CaseClassification; - - /** - * Verifies a CaseClassification message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CaseClassification message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CaseClassification - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.CaseClassification; - - /** - * Creates a plain object from a CaseClassification message. Also converts values to other types if specified. - * @param message CaseClassification - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.CaseClassification, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CaseClassification to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CaseClassification - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a CaseService */ - class CaseService extends $protobuf.rpc.Service { - - /** - * Constructs a new CaseService 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 CaseService 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): CaseService; - - /** - * Calls GetCase. - * @param request GetCaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Case - */ - public getCase(request: google.cloud.support.v2.IGetCaseRequest, callback: google.cloud.support.v2.CaseService.GetCaseCallback): void; - - /** - * Calls GetCase. - * @param request GetCaseRequest message or plain object - * @returns Promise - */ - public getCase(request: google.cloud.support.v2.IGetCaseRequest): Promise; - - /** - * Calls ListCases. - * @param request ListCasesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCasesResponse - */ - public listCases(request: google.cloud.support.v2.IListCasesRequest, callback: google.cloud.support.v2.CaseService.ListCasesCallback): void; - - /** - * Calls ListCases. - * @param request ListCasesRequest message or plain object - * @returns Promise - */ - public listCases(request: google.cloud.support.v2.IListCasesRequest): Promise; - - /** - * Calls SearchCases. - * @param request SearchCasesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchCasesResponse - */ - public searchCases(request: google.cloud.support.v2.ISearchCasesRequest, callback: google.cloud.support.v2.CaseService.SearchCasesCallback): void; - - /** - * Calls SearchCases. - * @param request SearchCasesRequest message or plain object - * @returns Promise - */ - public searchCases(request: google.cloud.support.v2.ISearchCasesRequest): Promise; - - /** - * Calls CreateCase. - * @param request CreateCaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Case - */ - public createCase(request: google.cloud.support.v2.ICreateCaseRequest, callback: google.cloud.support.v2.CaseService.CreateCaseCallback): void; - - /** - * Calls CreateCase. - * @param request CreateCaseRequest message or plain object - * @returns Promise - */ - public createCase(request: google.cloud.support.v2.ICreateCaseRequest): Promise; - - /** - * Calls UpdateCase. - * @param request UpdateCaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Case - */ - public updateCase(request: google.cloud.support.v2.IUpdateCaseRequest, callback: google.cloud.support.v2.CaseService.UpdateCaseCallback): void; - - /** - * Calls UpdateCase. - * @param request UpdateCaseRequest message or plain object - * @returns Promise - */ - public updateCase(request: google.cloud.support.v2.IUpdateCaseRequest): Promise; - - /** - * Calls EscalateCase. - * @param request EscalateCaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Case - */ - public escalateCase(request: google.cloud.support.v2.IEscalateCaseRequest, callback: google.cloud.support.v2.CaseService.EscalateCaseCallback): void; - - /** - * Calls EscalateCase. - * @param request EscalateCaseRequest message or plain object - * @returns Promise - */ - public escalateCase(request: google.cloud.support.v2.IEscalateCaseRequest): Promise; - - /** - * Calls CloseCase. - * @param request CloseCaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Case - */ - public closeCase(request: google.cloud.support.v2.ICloseCaseRequest, callback: google.cloud.support.v2.CaseService.CloseCaseCallback): void; - - /** - * Calls CloseCase. - * @param request CloseCaseRequest message or plain object - * @returns Promise - */ - public closeCase(request: google.cloud.support.v2.ICloseCaseRequest): Promise; - - /** - * Calls SearchCaseClassifications. - * @param request SearchCaseClassificationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchCaseClassificationsResponse - */ - public searchCaseClassifications(request: google.cloud.support.v2.ISearchCaseClassificationsRequest, callback: google.cloud.support.v2.CaseService.SearchCaseClassificationsCallback): void; - - /** - * Calls SearchCaseClassifications. - * @param request SearchCaseClassificationsRequest message or plain object - * @returns Promise - */ - public searchCaseClassifications(request: google.cloud.support.v2.ISearchCaseClassificationsRequest): Promise; - } - - namespace CaseService { - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|getCase}. - * @param error Error, if any - * @param [response] Case - */ - type GetCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|listCases}. - * @param error Error, if any - * @param [response] ListCasesResponse - */ - type ListCasesCallback = (error: (Error|null), response?: google.cloud.support.v2.ListCasesResponse) => void; - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|searchCases}. - * @param error Error, if any - * @param [response] SearchCasesResponse - */ - type SearchCasesCallback = (error: (Error|null), response?: google.cloud.support.v2.SearchCasesResponse) => void; - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|createCase}. - * @param error Error, if any - * @param [response] Case - */ - type CreateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|updateCase}. - * @param error Error, if any - * @param [response] Case - */ - type UpdateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|escalateCase}. - * @param error Error, if any - * @param [response] Case - */ - type EscalateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|closeCase}. - * @param error Error, if any - * @param [response] Case - */ - type CloseCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|searchCaseClassifications}. - * @param error Error, if any - * @param [response] SearchCaseClassificationsResponse - */ - type SearchCaseClassificationsCallback = (error: (Error|null), response?: google.cloud.support.v2.SearchCaseClassificationsResponse) => void; - } - - /** Properties of a GetCaseRequest. */ - interface IGetCaseRequest { - - /** GetCaseRequest name */ - name?: (string|null); - } - - /** Represents a GetCaseRequest. */ - class GetCaseRequest implements IGetCaseRequest { - - /** - * Constructs a new GetCaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IGetCaseRequest); - - /** GetCaseRequest name. */ - public name: string; - - /** - * Creates a new GetCaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCaseRequest instance - */ - public static create(properties?: google.cloud.support.v2.IGetCaseRequest): google.cloud.support.v2.GetCaseRequest; - - /** - * Encodes the specified GetCaseRequest message. Does not implicitly {@link google.cloud.support.v2.GetCaseRequest.verify|verify} messages. - * @param message GetCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IGetCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.GetCaseRequest.verify|verify} messages. - * @param message GetCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IGetCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.GetCaseRequest; - - /** - * Decodes a GetCaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.GetCaseRequest; - - /** - * Verifies a GetCaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetCaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.GetCaseRequest; - - /** - * Creates a plain object from a GetCaseRequest message. Also converts values to other types if specified. - * @param message GetCaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.GetCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateCaseRequest. */ - interface ICreateCaseRequest { - - /** CreateCaseRequest parent */ - parent?: (string|null); - - /** CreateCaseRequest case */ - "case"?: (google.cloud.support.v2.ICase|null); - } - - /** Represents a CreateCaseRequest. */ - class CreateCaseRequest implements ICreateCaseRequest { - - /** - * Constructs a new CreateCaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.ICreateCaseRequest); - - /** CreateCaseRequest parent. */ - public parent: string; - - /** CreateCaseRequest case. */ - public case?: (google.cloud.support.v2.ICase|null); - - /** - * Creates a new CreateCaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCaseRequest instance - */ - public static create(properties?: google.cloud.support.v2.ICreateCaseRequest): google.cloud.support.v2.CreateCaseRequest; - - /** - * Encodes the specified CreateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.CreateCaseRequest.verify|verify} messages. - * @param message CreateCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.ICreateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CreateCaseRequest.verify|verify} messages. - * @param message CreateCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.ICreateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.CreateCaseRequest; - - /** - * Decodes a CreateCaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.CreateCaseRequest; - - /** - * Verifies a CreateCaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateCaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.CreateCaseRequest; - - /** - * Creates a plain object from a CreateCaseRequest message. Also converts values to other types if specified. - * @param message CreateCaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.CreateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCasesRequest. */ - interface IListCasesRequest { - - /** ListCasesRequest parent */ - parent?: (string|null); - - /** ListCasesRequest filter */ - filter?: (string|null); - - /** ListCasesRequest pageSize */ - pageSize?: (number|null); - - /** ListCasesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListCasesRequest. */ - class ListCasesRequest implements IListCasesRequest { - - /** - * Constructs a new ListCasesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IListCasesRequest); - - /** ListCasesRequest parent. */ - public parent: string; - - /** ListCasesRequest filter. */ - public filter: string; - - /** ListCasesRequest pageSize. */ - public pageSize: number; - - /** ListCasesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListCasesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCasesRequest instance - */ - public static create(properties?: google.cloud.support.v2.IListCasesRequest): google.cloud.support.v2.ListCasesRequest; - - /** - * Encodes the specified ListCasesRequest message. Does not implicitly {@link google.cloud.support.v2.ListCasesRequest.verify|verify} messages. - * @param message ListCasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IListCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCasesRequest.verify|verify} messages. - * @param message ListCasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IListCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCasesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListCasesRequest; - - /** - * Decodes a ListCasesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListCasesRequest; - - /** - * Verifies a ListCasesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCasesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCasesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListCasesRequest; - - /** - * Creates a plain object from a ListCasesRequest message. Also converts values to other types if specified. - * @param message ListCasesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.ListCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCasesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCasesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCasesResponse. */ - interface IListCasesResponse { - - /** ListCasesResponse cases */ - cases?: (google.cloud.support.v2.ICase[]|null); - - /** ListCasesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListCasesResponse. */ - class ListCasesResponse implements IListCasesResponse { - - /** - * Constructs a new ListCasesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IListCasesResponse); - - /** ListCasesResponse cases. */ - public cases: google.cloud.support.v2.ICase[]; - - /** ListCasesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListCasesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCasesResponse instance - */ - public static create(properties?: google.cloud.support.v2.IListCasesResponse): google.cloud.support.v2.ListCasesResponse; - - /** - * Encodes the specified ListCasesResponse message. Does not implicitly {@link google.cloud.support.v2.ListCasesResponse.verify|verify} messages. - * @param message ListCasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IListCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCasesResponse.verify|verify} messages. - * @param message ListCasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IListCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCasesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListCasesResponse; - - /** - * Decodes a ListCasesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListCasesResponse; - - /** - * Verifies a ListCasesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCasesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCasesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListCasesResponse; - - /** - * Creates a plain object from a ListCasesResponse message. Also converts values to other types if specified. - * @param message ListCasesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.ListCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCasesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCasesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SearchCasesRequest. */ - interface ISearchCasesRequest { - - /** SearchCasesRequest parent */ - parent?: (string|null); - - /** SearchCasesRequest query */ - query?: (string|null); - - /** SearchCasesRequest pageSize */ - pageSize?: (number|null); - - /** SearchCasesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a SearchCasesRequest. */ - class SearchCasesRequest implements ISearchCasesRequest { - - /** - * Constructs a new SearchCasesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.ISearchCasesRequest); - - /** SearchCasesRequest parent. */ - public parent: string; - - /** SearchCasesRequest query. */ - public query: string; - - /** SearchCasesRequest pageSize. */ - public pageSize: number; - - /** SearchCasesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new SearchCasesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchCasesRequest instance - */ - public static create(properties?: google.cloud.support.v2.ISearchCasesRequest): google.cloud.support.v2.SearchCasesRequest; - - /** - * Encodes the specified SearchCasesRequest message. Does not implicitly {@link google.cloud.support.v2.SearchCasesRequest.verify|verify} messages. - * @param message SearchCasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.ISearchCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCasesRequest.verify|verify} messages. - * @param message SearchCasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.ISearchCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchCasesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.SearchCasesRequest; - - /** - * Decodes a SearchCasesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.SearchCasesRequest; - - /** - * Verifies a SearchCasesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SearchCasesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchCasesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.SearchCasesRequest; - - /** - * Creates a plain object from a SearchCasesRequest message. Also converts values to other types if specified. - * @param message SearchCasesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.SearchCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchCasesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchCasesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SearchCasesResponse. */ - interface ISearchCasesResponse { - - /** SearchCasesResponse cases */ - cases?: (google.cloud.support.v2.ICase[]|null); - - /** SearchCasesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a SearchCasesResponse. */ - class SearchCasesResponse implements ISearchCasesResponse { - - /** - * Constructs a new SearchCasesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.ISearchCasesResponse); - - /** SearchCasesResponse cases. */ - public cases: google.cloud.support.v2.ICase[]; - - /** SearchCasesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new SearchCasesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchCasesResponse instance - */ - public static create(properties?: google.cloud.support.v2.ISearchCasesResponse): google.cloud.support.v2.SearchCasesResponse; - - /** - * Encodes the specified SearchCasesResponse message. Does not implicitly {@link google.cloud.support.v2.SearchCasesResponse.verify|verify} messages. - * @param message SearchCasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.ISearchCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCasesResponse.verify|verify} messages. - * @param message SearchCasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.ISearchCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchCasesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.SearchCasesResponse; - - /** - * Decodes a SearchCasesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.SearchCasesResponse; - - /** - * Verifies a SearchCasesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SearchCasesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchCasesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.SearchCasesResponse; - - /** - * Creates a plain object from a SearchCasesResponse message. Also converts values to other types if specified. - * @param message SearchCasesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.SearchCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchCasesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchCasesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EscalateCaseRequest. */ - interface IEscalateCaseRequest { - - /** EscalateCaseRequest name */ - name?: (string|null); - - /** EscalateCaseRequest escalation */ - escalation?: (google.cloud.support.v2.IEscalation|null); - } - - /** Represents an EscalateCaseRequest. */ - class EscalateCaseRequest implements IEscalateCaseRequest { - - /** - * Constructs a new EscalateCaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IEscalateCaseRequest); - - /** EscalateCaseRequest name. */ - public name: string; - - /** EscalateCaseRequest escalation. */ - public escalation?: (google.cloud.support.v2.IEscalation|null); - - /** - * Creates a new EscalateCaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns EscalateCaseRequest instance - */ - public static create(properties?: google.cloud.support.v2.IEscalateCaseRequest): google.cloud.support.v2.EscalateCaseRequest; - - /** - * Encodes the specified EscalateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.EscalateCaseRequest.verify|verify} messages. - * @param message EscalateCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IEscalateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EscalateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.EscalateCaseRequest.verify|verify} messages. - * @param message EscalateCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IEscalateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EscalateCaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EscalateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.EscalateCaseRequest; - - /** - * Decodes an EscalateCaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EscalateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.EscalateCaseRequest; - - /** - * Verifies an EscalateCaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EscalateCaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EscalateCaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.EscalateCaseRequest; - - /** - * Creates a plain object from an EscalateCaseRequest message. Also converts values to other types if specified. - * @param message EscalateCaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.EscalateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EscalateCaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EscalateCaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCaseRequest. */ - interface IUpdateCaseRequest { - - /** UpdateCaseRequest case */ - "case"?: (google.cloud.support.v2.ICase|null); - - /** UpdateCaseRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateCaseRequest. */ - class UpdateCaseRequest implements IUpdateCaseRequest { - - /** - * Constructs a new UpdateCaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IUpdateCaseRequest); - - /** UpdateCaseRequest case. */ - public case?: (google.cloud.support.v2.ICase|null); - - /** UpdateCaseRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateCaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCaseRequest instance - */ - public static create(properties?: google.cloud.support.v2.IUpdateCaseRequest): google.cloud.support.v2.UpdateCaseRequest; - - /** - * Encodes the specified UpdateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.UpdateCaseRequest.verify|verify} messages. - * @param message UpdateCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IUpdateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.UpdateCaseRequest.verify|verify} messages. - * @param message UpdateCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IUpdateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.UpdateCaseRequest; - - /** - * Decodes an UpdateCaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.UpdateCaseRequest; - - /** - * Verifies an UpdateCaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateCaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.UpdateCaseRequest; - - /** - * Creates a plain object from an UpdateCaseRequest message. Also converts values to other types if specified. - * @param message UpdateCaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.UpdateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloseCaseRequest. */ - interface ICloseCaseRequest { - - /** CloseCaseRequest name */ - name?: (string|null); - } - - /** Represents a CloseCaseRequest. */ - class CloseCaseRequest implements ICloseCaseRequest { - - /** - * Constructs a new CloseCaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.ICloseCaseRequest); - - /** CloseCaseRequest name. */ - public name: string; - - /** - * Creates a new CloseCaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CloseCaseRequest instance - */ - public static create(properties?: google.cloud.support.v2.ICloseCaseRequest): google.cloud.support.v2.CloseCaseRequest; - - /** - * Encodes the specified CloseCaseRequest message. Does not implicitly {@link google.cloud.support.v2.CloseCaseRequest.verify|verify} messages. - * @param message CloseCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.ICloseCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloseCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CloseCaseRequest.verify|verify} messages. - * @param message CloseCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.ICloseCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloseCaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloseCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.CloseCaseRequest; - - /** - * Decodes a CloseCaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloseCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.CloseCaseRequest; - - /** - * Verifies a CloseCaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloseCaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloseCaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.CloseCaseRequest; - - /** - * Creates a plain object from a CloseCaseRequest message. Also converts values to other types if specified. - * @param message CloseCaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.CloseCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloseCaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloseCaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SearchCaseClassificationsRequest. */ - interface ISearchCaseClassificationsRequest { - - /** SearchCaseClassificationsRequest query */ - query?: (string|null); - - /** SearchCaseClassificationsRequest pageSize */ - pageSize?: (number|null); - - /** SearchCaseClassificationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a SearchCaseClassificationsRequest. */ - class SearchCaseClassificationsRequest implements ISearchCaseClassificationsRequest { - - /** - * Constructs a new SearchCaseClassificationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.ISearchCaseClassificationsRequest); - - /** SearchCaseClassificationsRequest query. */ - public query: string; - - /** SearchCaseClassificationsRequest pageSize. */ - public pageSize: number; - - /** SearchCaseClassificationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new SearchCaseClassificationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchCaseClassificationsRequest instance - */ - public static create(properties?: google.cloud.support.v2.ISearchCaseClassificationsRequest): google.cloud.support.v2.SearchCaseClassificationsRequest; - - /** - * Encodes the specified SearchCaseClassificationsRequest message. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsRequest.verify|verify} messages. - * @param message SearchCaseClassificationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.ISearchCaseClassificationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchCaseClassificationsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsRequest.verify|verify} messages. - * @param message SearchCaseClassificationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.ISearchCaseClassificationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchCaseClassificationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.SearchCaseClassificationsRequest; - - /** - * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchCaseClassificationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.SearchCaseClassificationsRequest; - - /** - * Verifies a SearchCaseClassificationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SearchCaseClassificationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchCaseClassificationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.SearchCaseClassificationsRequest; - - /** - * Creates a plain object from a SearchCaseClassificationsRequest message. Also converts values to other types if specified. - * @param message SearchCaseClassificationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.SearchCaseClassificationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchCaseClassificationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchCaseClassificationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SearchCaseClassificationsResponse. */ - interface ISearchCaseClassificationsResponse { - - /** SearchCaseClassificationsResponse caseClassifications */ - caseClassifications?: (google.cloud.support.v2.ICaseClassification[]|null); - - /** SearchCaseClassificationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a SearchCaseClassificationsResponse. */ - class SearchCaseClassificationsResponse implements ISearchCaseClassificationsResponse { - - /** - * Constructs a new SearchCaseClassificationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.ISearchCaseClassificationsResponse); - - /** SearchCaseClassificationsResponse caseClassifications. */ - public caseClassifications: google.cloud.support.v2.ICaseClassification[]; - - /** SearchCaseClassificationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new SearchCaseClassificationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchCaseClassificationsResponse instance - */ - public static create(properties?: google.cloud.support.v2.ISearchCaseClassificationsResponse): google.cloud.support.v2.SearchCaseClassificationsResponse; - - /** - * Encodes the specified SearchCaseClassificationsResponse message. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsResponse.verify|verify} messages. - * @param message SearchCaseClassificationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.ISearchCaseClassificationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchCaseClassificationsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsResponse.verify|verify} messages. - * @param message SearchCaseClassificationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.ISearchCaseClassificationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchCaseClassificationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.SearchCaseClassificationsResponse; - - /** - * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchCaseClassificationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.SearchCaseClassificationsResponse; - - /** - * Verifies a SearchCaseClassificationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SearchCaseClassificationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchCaseClassificationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.SearchCaseClassificationsResponse; - - /** - * Creates a plain object from a SearchCaseClassificationsResponse message. Also converts values to other types if specified. - * @param message SearchCaseClassificationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.SearchCaseClassificationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchCaseClassificationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchCaseClassificationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Escalation. */ - interface IEscalation { - - /** Escalation reason */ - reason?: (google.cloud.support.v2.Escalation.Reason|keyof typeof google.cloud.support.v2.Escalation.Reason|null); - - /** Escalation justification */ - justification?: (string|null); - } - - /** Represents an Escalation. */ - class Escalation implements IEscalation { - - /** - * Constructs a new Escalation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IEscalation); - - /** Escalation reason. */ - public reason: (google.cloud.support.v2.Escalation.Reason|keyof typeof google.cloud.support.v2.Escalation.Reason); - - /** Escalation justification. */ - public justification: string; - - /** - * Creates a new Escalation instance using the specified properties. - * @param [properties] Properties to set - * @returns Escalation instance - */ - public static create(properties?: google.cloud.support.v2.IEscalation): google.cloud.support.v2.Escalation; - - /** - * Encodes the specified Escalation message. Does not implicitly {@link google.cloud.support.v2.Escalation.verify|verify} messages. - * @param message Escalation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IEscalation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Escalation message, length delimited. Does not implicitly {@link google.cloud.support.v2.Escalation.verify|verify} messages. - * @param message Escalation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IEscalation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Escalation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Escalation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Escalation; - - /** - * Decodes an Escalation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Escalation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Escalation; - - /** - * Verifies an Escalation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Escalation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Escalation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Escalation; - - /** - * Creates a plain object from an Escalation message. Also converts values to other types if specified. - * @param message Escalation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.Escalation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Escalation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Escalation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Escalation { - - /** Reason enum. */ - enum Reason { - REASON_UNSPECIFIED = 0, - RESOLUTION_TIME = 1, - TECHNICAL_EXPERTISE = 2, - BUSINESS_IMPACT = 3 - } - } - - /** Properties of a Comment. */ - interface IComment { - - /** Comment name */ - name?: (string|null); - - /** Comment createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Comment creator */ - creator?: (google.cloud.support.v2.IActor|null); - - /** Comment body */ - body?: (string|null); - - /** Comment plainTextBody */ - plainTextBody?: (string|null); - } - - /** Represents a Comment. */ - class Comment implements IComment { - - /** - * Constructs a new Comment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IComment); - - /** Comment name. */ - public name: string; - - /** Comment createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Comment creator. */ - public creator?: (google.cloud.support.v2.IActor|null); - - /** Comment body. */ - public body: string; - - /** Comment plainTextBody. */ - public plainTextBody: string; - - /** - * Creates a new Comment instance using the specified properties. - * @param [properties] Properties to set - * @returns Comment instance - */ - public static create(properties?: google.cloud.support.v2.IComment): google.cloud.support.v2.Comment; - - /** - * Encodes the specified Comment message. Does not implicitly {@link google.cloud.support.v2.Comment.verify|verify} messages. - * @param message Comment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IComment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Comment message, length delimited. Does not implicitly {@link google.cloud.support.v2.Comment.verify|verify} messages. - * @param message Comment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IComment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Comment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Comment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Comment; - - /** - * Decodes a Comment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Comment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Comment; - - /** - * Verifies a Comment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Comment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Comment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Comment; - - /** - * Creates a plain object from a Comment message. Also converts values to other types if specified. - * @param message Comment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.Comment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Comment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Comment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a CommentService */ - class CommentService extends $protobuf.rpc.Service { - - /** - * Constructs a new CommentService 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 CommentService 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): CommentService; - - /** - * Calls ListComments. - * @param request ListCommentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCommentsResponse - */ - public listComments(request: google.cloud.support.v2.IListCommentsRequest, callback: google.cloud.support.v2.CommentService.ListCommentsCallback): void; - - /** - * Calls ListComments. - * @param request ListCommentsRequest message or plain object - * @returns Promise - */ - public listComments(request: google.cloud.support.v2.IListCommentsRequest): Promise; - - /** - * Calls CreateComment. - * @param request CreateCommentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Comment - */ - public createComment(request: google.cloud.support.v2.ICreateCommentRequest, callback: google.cloud.support.v2.CommentService.CreateCommentCallback): void; - - /** - * Calls CreateComment. - * @param request CreateCommentRequest message or plain object - * @returns Promise - */ - public createComment(request: google.cloud.support.v2.ICreateCommentRequest): Promise; - } - - namespace CommentService { - - /** - * Callback as used by {@link google.cloud.support.v2.CommentService|listComments}. - * @param error Error, if any - * @param [response] ListCommentsResponse - */ - type ListCommentsCallback = (error: (Error|null), response?: google.cloud.support.v2.ListCommentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.support.v2.CommentService|createComment}. - * @param error Error, if any - * @param [response] Comment - */ - type CreateCommentCallback = (error: (Error|null), response?: google.cloud.support.v2.Comment) => void; - } - - /** Properties of a ListCommentsRequest. */ - interface IListCommentsRequest { - - /** ListCommentsRequest parent */ - parent?: (string|null); - - /** ListCommentsRequest pageSize */ - pageSize?: (number|null); - - /** ListCommentsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListCommentsRequest. */ - class ListCommentsRequest implements IListCommentsRequest { - - /** - * Constructs a new ListCommentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IListCommentsRequest); - - /** ListCommentsRequest parent. */ - public parent: string; - - /** ListCommentsRequest pageSize. */ - public pageSize: number; - - /** ListCommentsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListCommentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCommentsRequest instance - */ - public static create(properties?: google.cloud.support.v2.IListCommentsRequest): google.cloud.support.v2.ListCommentsRequest; - - /** - * Encodes the specified ListCommentsRequest message. Does not implicitly {@link google.cloud.support.v2.ListCommentsRequest.verify|verify} messages. - * @param message ListCommentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IListCommentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCommentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCommentsRequest.verify|verify} messages. - * @param message ListCommentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IListCommentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCommentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCommentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListCommentsRequest; - - /** - * Decodes a ListCommentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCommentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListCommentsRequest; - - /** - * Verifies a ListCommentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCommentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCommentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListCommentsRequest; - - /** - * Creates a plain object from a ListCommentsRequest message. Also converts values to other types if specified. - * @param message ListCommentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.ListCommentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCommentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCommentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCommentsResponse. */ - interface IListCommentsResponse { - - /** ListCommentsResponse comments */ - comments?: (google.cloud.support.v2.IComment[]|null); - - /** ListCommentsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListCommentsResponse. */ - class ListCommentsResponse implements IListCommentsResponse { - - /** - * Constructs a new ListCommentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.IListCommentsResponse); - - /** ListCommentsResponse comments. */ - public comments: google.cloud.support.v2.IComment[]; - - /** ListCommentsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListCommentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCommentsResponse instance - */ - public static create(properties?: google.cloud.support.v2.IListCommentsResponse): google.cloud.support.v2.ListCommentsResponse; - - /** - * Encodes the specified ListCommentsResponse message. Does not implicitly {@link google.cloud.support.v2.ListCommentsResponse.verify|verify} messages. - * @param message ListCommentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.IListCommentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCommentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCommentsResponse.verify|verify} messages. - * @param message ListCommentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.IListCommentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCommentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCommentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListCommentsResponse; - - /** - * Decodes a ListCommentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCommentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListCommentsResponse; - - /** - * Verifies a ListCommentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCommentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCommentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListCommentsResponse; - - /** - * Creates a plain object from a ListCommentsResponse message. Also converts values to other types if specified. - * @param message ListCommentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.ListCommentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCommentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCommentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateCommentRequest. */ - interface ICreateCommentRequest { - - /** CreateCommentRequest parent */ - parent?: (string|null); - - /** CreateCommentRequest comment */ - comment?: (google.cloud.support.v2.IComment|null); - } - - /** Represents a CreateCommentRequest. */ - class CreateCommentRequest implements ICreateCommentRequest { - - /** - * Constructs a new CreateCommentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2.ICreateCommentRequest); - - /** CreateCommentRequest parent. */ - public parent: string; - - /** CreateCommentRequest comment. */ - public comment?: (google.cloud.support.v2.IComment|null); - - /** - * Creates a new CreateCommentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCommentRequest instance - */ - public static create(properties?: google.cloud.support.v2.ICreateCommentRequest): google.cloud.support.v2.CreateCommentRequest; - - /** - * Encodes the specified CreateCommentRequest message. Does not implicitly {@link google.cloud.support.v2.CreateCommentRequest.verify|verify} messages. - * @param message CreateCommentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2.ICreateCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CreateCommentRequest.verify|verify} messages. - * @param message CreateCommentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2.ICreateCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCommentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCommentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.CreateCommentRequest; - - /** - * Decodes a CreateCommentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCommentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.CreateCommentRequest; - - /** - * Verifies a CreateCommentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateCommentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCommentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.CreateCommentRequest; - - /** - * Creates a plain object from a CreateCommentRequest message. Also converts values to other types if specified. - * @param message CreateCommentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2.CreateCommentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCommentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCommentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace v2beta. */ - namespace v2beta { - - /** Properties of an Actor. */ - interface IActor { - - /** Actor displayName */ - displayName?: (string|null); - - /** Actor email */ - email?: (string|null); - - /** Actor googleSupport */ - googleSupport?: (boolean|null); - - /** Actor username */ - username?: (string|null); - } - - /** Represents an Actor. */ - class Actor implements IActor { - - /** - * Constructs a new Actor. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IActor); - - /** Actor displayName. */ - public displayName: string; - - /** Actor email. */ - public email: string; - - /** Actor googleSupport. */ - public googleSupport: boolean; - - /** Actor username. */ - public username: string; - - /** - * Creates a new Actor instance using the specified properties. - * @param [properties] Properties to set - * @returns Actor instance - */ - public static create(properties?: google.cloud.support.v2beta.IActor): google.cloud.support.v2beta.Actor; - - /** - * Encodes the specified Actor message. Does not implicitly {@link google.cloud.support.v2beta.Actor.verify|verify} messages. - * @param message Actor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IActor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Actor message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Actor.verify|verify} messages. - * @param message Actor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IActor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Actor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Actor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.Actor; - - /** - * Decodes an Actor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Actor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.Actor; - - /** - * Verifies an Actor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Actor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Actor - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.Actor; - - /** - * Creates a plain object from an Actor message. Also converts values to other types if specified. - * @param message Actor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.Actor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Actor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Actor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Attachment. */ - interface IAttachment { - - /** Attachment name */ - name?: (string|null); - - /** Attachment createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Attachment creator */ - creator?: (google.cloud.support.v2beta.IActor|null); - - /** Attachment filename */ - filename?: (string|null); - - /** Attachment mimeType */ - mimeType?: (string|null); - - /** Attachment sizeBytes */ - sizeBytes?: (number|Long|string|null); - } - - /** Represents an Attachment. */ - class Attachment implements IAttachment { - - /** - * Constructs a new Attachment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IAttachment); - - /** Attachment name. */ - public name: string; - - /** Attachment createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Attachment creator. */ - public creator?: (google.cloud.support.v2beta.IActor|null); - - /** Attachment filename. */ - public filename: string; - - /** Attachment mimeType. */ - public mimeType: string; - - /** Attachment sizeBytes. */ - public sizeBytes: (number|Long|string); - - /** - * Creates a new Attachment instance using the specified properties. - * @param [properties] Properties to set - * @returns Attachment instance - */ - public static create(properties?: google.cloud.support.v2beta.IAttachment): google.cloud.support.v2beta.Attachment; - - /** - * Encodes the specified Attachment message. Does not implicitly {@link google.cloud.support.v2beta.Attachment.verify|verify} messages. - * @param message Attachment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IAttachment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Attachment.verify|verify} messages. - * @param message Attachment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IAttachment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Attachment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Attachment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.Attachment; - - /** - * Decodes an Attachment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Attachment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.Attachment; - - /** - * Verifies an Attachment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Attachment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Attachment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.Attachment; - - /** - * Creates a plain object from an Attachment message. Also converts values to other types if specified. - * @param message Attachment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.Attachment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Attachment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Attachment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a CaseAttachmentService */ - class CaseAttachmentService extends $protobuf.rpc.Service { - - /** - * Constructs a new CaseAttachmentService 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 CaseAttachmentService 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): CaseAttachmentService; - - /** - * Calls ListAttachments. - * @param request ListAttachmentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAttachmentsResponse - */ - public listAttachments(request: google.cloud.support.v2beta.IListAttachmentsRequest, callback: google.cloud.support.v2beta.CaseAttachmentService.ListAttachmentsCallback): void; - - /** - * Calls ListAttachments. - * @param request ListAttachmentsRequest message or plain object - * @returns Promise - */ - public listAttachments(request: google.cloud.support.v2beta.IListAttachmentsRequest): Promise; - - /** - * Calls GetAttachment. - * @param request GetAttachmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Attachment - */ - public getAttachment(request: google.cloud.support.v2beta.IGetAttachmentRequest, callback: google.cloud.support.v2beta.CaseAttachmentService.GetAttachmentCallback): void; - - /** - * Calls GetAttachment. - * @param request GetAttachmentRequest message or plain object - * @returns Promise - */ - public getAttachment(request: google.cloud.support.v2beta.IGetAttachmentRequest): Promise; - } - - namespace CaseAttachmentService { - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseAttachmentService|listAttachments}. - * @param error Error, if any - * @param [response] ListAttachmentsResponse - */ - type ListAttachmentsCallback = (error: (Error|null), response?: google.cloud.support.v2beta.ListAttachmentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseAttachmentService|getAttachment}. - * @param error Error, if any - * @param [response] Attachment - */ - type GetAttachmentCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Attachment) => void; - } - - /** Properties of a ListAttachmentsRequest. */ - interface IListAttachmentsRequest { - - /** ListAttachmentsRequest parent */ - parent?: (string|null); - - /** ListAttachmentsRequest pageSize */ - pageSize?: (number|null); - - /** ListAttachmentsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListAttachmentsRequest. */ - class ListAttachmentsRequest implements IListAttachmentsRequest { - - /** - * Constructs a new ListAttachmentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IListAttachmentsRequest); - - /** ListAttachmentsRequest parent. */ - public parent: string; - - /** ListAttachmentsRequest pageSize. */ - public pageSize: number; - - /** ListAttachmentsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListAttachmentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAttachmentsRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.IListAttachmentsRequest): google.cloud.support.v2beta.ListAttachmentsRequest; - - /** - * Encodes the specified ListAttachmentsRequest message. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsRequest.verify|verify} messages. - * @param message ListAttachmentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IListAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsRequest.verify|verify} messages. - * @param message ListAttachmentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IListAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAttachmentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAttachmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ListAttachmentsRequest; - - /** - * Decodes a ListAttachmentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAttachmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ListAttachmentsRequest; - - /** - * Verifies a ListAttachmentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAttachmentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAttachmentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ListAttachmentsRequest; - - /** - * Creates a plain object from a ListAttachmentsRequest message. Also converts values to other types if specified. - * @param message ListAttachmentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.ListAttachmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAttachmentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAttachmentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetAttachmentRequest. */ - interface IGetAttachmentRequest { - - /** GetAttachmentRequest name */ - name?: (string|null); - } - - /** Represents a GetAttachmentRequest. */ - class GetAttachmentRequest implements IGetAttachmentRequest { - - /** - * Constructs a new GetAttachmentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IGetAttachmentRequest); - - /** GetAttachmentRequest name. */ - public name: string; - - /** - * Creates a new GetAttachmentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAttachmentRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.IGetAttachmentRequest): google.cloud.support.v2beta.GetAttachmentRequest; - - /** - * Encodes the specified GetAttachmentRequest message. Does not implicitly {@link google.cloud.support.v2beta.GetAttachmentRequest.verify|verify} messages. - * @param message GetAttachmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IGetAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.GetAttachmentRequest.verify|verify} messages. - * @param message GetAttachmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IGetAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetAttachmentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAttachmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.GetAttachmentRequest; - - /** - * Decodes a GetAttachmentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAttachmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.GetAttachmentRequest; - - /** - * Verifies a GetAttachmentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetAttachmentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAttachmentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.GetAttachmentRequest; - - /** - * Creates a plain object from a GetAttachmentRequest message. Also converts values to other types if specified. - * @param message GetAttachmentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.GetAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetAttachmentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetAttachmentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAttachmentsResponse. */ - interface IListAttachmentsResponse { - - /** ListAttachmentsResponse attachments */ - attachments?: (google.cloud.support.v2beta.IAttachment[]|null); - - /** ListAttachmentsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAttachmentsResponse. */ - class ListAttachmentsResponse implements IListAttachmentsResponse { - - /** - * Constructs a new ListAttachmentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IListAttachmentsResponse); - - /** ListAttachmentsResponse attachments. */ - public attachments: google.cloud.support.v2beta.IAttachment[]; - - /** ListAttachmentsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAttachmentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAttachmentsResponse instance - */ - public static create(properties?: google.cloud.support.v2beta.IListAttachmentsResponse): google.cloud.support.v2beta.ListAttachmentsResponse; - - /** - * Encodes the specified ListAttachmentsResponse message. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsResponse.verify|verify} messages. - * @param message ListAttachmentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IListAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsResponse.verify|verify} messages. - * @param message ListAttachmentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IListAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAttachmentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAttachmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ListAttachmentsResponse; - - /** - * Decodes a ListAttachmentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAttachmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ListAttachmentsResponse; - - /** - * Verifies a ListAttachmentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAttachmentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAttachmentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ListAttachmentsResponse; - - /** - * Creates a plain object from a ListAttachmentsResponse message. Also converts values to other types if specified. - * @param message ListAttachmentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.ListAttachmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAttachmentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAttachmentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ProductLine enum. */ - enum ProductLine { - PRODUCT_LINE_UNSPECIFIED = 0, - GOOGLE_CLOUD = 1, - GOOGLE_MAPS = 2 - } - - /** Properties of a Case. */ - interface ICase { - - /** Case name */ - name?: (string|null); - - /** Case displayName */ - displayName?: (string|null); - - /** Case description */ - description?: (string|null); - - /** Case classification */ - classification?: (google.cloud.support.v2beta.ICaseClassification|null); - - /** Case timeZone */ - timeZone?: (string|null); - - /** Case subscriberEmailAddresses */ - subscriberEmailAddresses?: (string[]|null); - - /** Case state */ - state?: (google.cloud.support.v2beta.Case.State|keyof typeof google.cloud.support.v2beta.Case.State|null); - - /** Case createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Case updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Case creator */ - creator?: (google.cloud.support.v2beta.IActor|null); - - /** Case contactEmail */ - contactEmail?: (string|null); - - /** Case escalated */ - escalated?: (boolean|null); - - /** Case testCase */ - testCase?: (boolean|null); - - /** Case languageCode */ - languageCode?: (string|null); - - /** Case priority */ - priority?: (google.cloud.support.v2beta.Case.Priority|keyof typeof google.cloud.support.v2beta.Case.Priority|null); - } - - /** Represents a Case. */ - class Case implements ICase { - - /** - * Constructs a new Case. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.ICase); - - /** Case name. */ - public name: string; - - /** Case displayName. */ - public displayName: string; - - /** Case description. */ - public description: string; - - /** Case classification. */ - public classification?: (google.cloud.support.v2beta.ICaseClassification|null); - - /** Case timeZone. */ - public timeZone: string; - - /** Case subscriberEmailAddresses. */ - public subscriberEmailAddresses: string[]; - - /** Case state. */ - public state: (google.cloud.support.v2beta.Case.State|keyof typeof google.cloud.support.v2beta.Case.State); - - /** Case createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Case updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Case creator. */ - public creator?: (google.cloud.support.v2beta.IActor|null); - - /** Case contactEmail. */ - public contactEmail: string; - - /** Case escalated. */ - public escalated: boolean; - - /** Case testCase. */ - public testCase: boolean; - - /** Case languageCode. */ - public languageCode: string; - - /** Case priority. */ - public priority: (google.cloud.support.v2beta.Case.Priority|keyof typeof google.cloud.support.v2beta.Case.Priority); - - /** - * Creates a new Case instance using the specified properties. - * @param [properties] Properties to set - * @returns Case instance - */ - public static create(properties?: google.cloud.support.v2beta.ICase): google.cloud.support.v2beta.Case; - - /** - * Encodes the specified Case message. Does not implicitly {@link google.cloud.support.v2beta.Case.verify|verify} messages. - * @param message Case message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.ICase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Case.verify|verify} messages. - * @param message Case message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.ICase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Case message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Case - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.Case; - - /** - * Decodes a Case message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Case - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.Case; - - /** - * Verifies a Case message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Case message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Case - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.Case; - - /** - * Creates a plain object from a Case message. Also converts values to other types if specified. - * @param message Case - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.Case, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Case to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Case - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Case { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - NEW = 1, - IN_PROGRESS_GOOGLE_SUPPORT = 2, - ACTION_REQUIRED = 3, - SOLUTION_PROVIDED = 4, - CLOSED = 5 - } - - /** Priority enum. */ - enum Priority { - PRIORITY_UNSPECIFIED = 0, - P0 = 1, - P1 = 2, - P2 = 3, - P3 = 4, - P4 = 5 - } - } - - /** Properties of a CaseClassification. */ - interface ICaseClassification { - - /** CaseClassification id */ - id?: (string|null); - - /** CaseClassification displayName */ - displayName?: (string|null); - - /** CaseClassification product */ - product?: (google.cloud.support.v2beta.IProduct|null); - } - - /** Represents a CaseClassification. */ - class CaseClassification implements ICaseClassification { - - /** - * Constructs a new CaseClassification. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.ICaseClassification); - - /** CaseClassification id. */ - public id: string; - - /** CaseClassification displayName. */ - public displayName: string; - - /** CaseClassification product. */ - public product?: (google.cloud.support.v2beta.IProduct|null); - - /** - * Creates a new CaseClassification instance using the specified properties. - * @param [properties] Properties to set - * @returns CaseClassification instance - */ - public static create(properties?: google.cloud.support.v2beta.ICaseClassification): google.cloud.support.v2beta.CaseClassification; - - /** - * Encodes the specified CaseClassification message. Does not implicitly {@link google.cloud.support.v2beta.CaseClassification.verify|verify} messages. - * @param message CaseClassification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.ICaseClassification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CaseClassification message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CaseClassification.verify|verify} messages. - * @param message CaseClassification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.ICaseClassification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CaseClassification message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CaseClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.CaseClassification; - - /** - * Decodes a CaseClassification message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CaseClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.CaseClassification; - - /** - * Verifies a CaseClassification message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CaseClassification message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CaseClassification - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.CaseClassification; - - /** - * Creates a plain object from a CaseClassification message. Also converts values to other types if specified. - * @param message CaseClassification - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.CaseClassification, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CaseClassification to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CaseClassification - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Product. */ - interface IProduct { - - /** Product productLine */ - productLine?: (google.cloud.support.v2beta.ProductLine|keyof typeof google.cloud.support.v2beta.ProductLine|null); - } - - /** Represents a Product. */ - class Product implements IProduct { - - /** - * Constructs a new Product. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IProduct); - - /** Product productLine. */ - public productLine: (google.cloud.support.v2beta.ProductLine|keyof typeof google.cloud.support.v2beta.ProductLine); - - /** - * Creates a new Product instance using the specified properties. - * @param [properties] Properties to set - * @returns Product instance - */ - public static create(properties?: google.cloud.support.v2beta.IProduct): google.cloud.support.v2beta.Product; - - /** - * Encodes the specified Product message. Does not implicitly {@link google.cloud.support.v2beta.Product.verify|verify} messages. - * @param message Product message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Product.verify|verify} messages. - * @param message Product message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Product message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Product - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.Product; - - /** - * Decodes a Product message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Product - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.Product; - - /** - * Verifies a Product message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Product message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Product - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.Product; - - /** - * Creates a plain object from a Product message. Also converts values to other types if specified. - * @param message Product - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Product to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Product - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a CaseService */ - class CaseService extends $protobuf.rpc.Service { - - /** - * Constructs a new CaseService 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 CaseService 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): CaseService; - - /** - * Calls GetCase. - * @param request GetCaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Case - */ - public getCase(request: google.cloud.support.v2beta.IGetCaseRequest, callback: google.cloud.support.v2beta.CaseService.GetCaseCallback): void; - - /** - * Calls GetCase. - * @param request GetCaseRequest message or plain object - * @returns Promise - */ - public getCase(request: google.cloud.support.v2beta.IGetCaseRequest): Promise; - - /** - * Calls ListCases. - * @param request ListCasesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCasesResponse - */ - public listCases(request: google.cloud.support.v2beta.IListCasesRequest, callback: google.cloud.support.v2beta.CaseService.ListCasesCallback): void; - - /** - * Calls ListCases. - * @param request ListCasesRequest message or plain object - * @returns Promise - */ - public listCases(request: google.cloud.support.v2beta.IListCasesRequest): Promise; - - /** - * Calls SearchCases. - * @param request SearchCasesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchCasesResponse - */ - public searchCases(request: google.cloud.support.v2beta.ISearchCasesRequest, callback: google.cloud.support.v2beta.CaseService.SearchCasesCallback): void; - - /** - * Calls SearchCases. - * @param request SearchCasesRequest message or plain object - * @returns Promise - */ - public searchCases(request: google.cloud.support.v2beta.ISearchCasesRequest): Promise; - - /** - * Calls CreateCase. - * @param request CreateCaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Case - */ - public createCase(request: google.cloud.support.v2beta.ICreateCaseRequest, callback: google.cloud.support.v2beta.CaseService.CreateCaseCallback): void; - - /** - * Calls CreateCase. - * @param request CreateCaseRequest message or plain object - * @returns Promise - */ - public createCase(request: google.cloud.support.v2beta.ICreateCaseRequest): Promise; - - /** - * Calls UpdateCase. - * @param request UpdateCaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Case - */ - public updateCase(request: google.cloud.support.v2beta.IUpdateCaseRequest, callback: google.cloud.support.v2beta.CaseService.UpdateCaseCallback): void; - - /** - * Calls UpdateCase. - * @param request UpdateCaseRequest message or plain object - * @returns Promise - */ - public updateCase(request: google.cloud.support.v2beta.IUpdateCaseRequest): Promise; - - /** - * Calls EscalateCase. - * @param request EscalateCaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Case - */ - public escalateCase(request: google.cloud.support.v2beta.IEscalateCaseRequest, callback: google.cloud.support.v2beta.CaseService.EscalateCaseCallback): void; - - /** - * Calls EscalateCase. - * @param request EscalateCaseRequest message or plain object - * @returns Promise - */ - public escalateCase(request: google.cloud.support.v2beta.IEscalateCaseRequest): Promise; - - /** - * Calls CloseCase. - * @param request CloseCaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Case - */ - public closeCase(request: google.cloud.support.v2beta.ICloseCaseRequest, callback: google.cloud.support.v2beta.CaseService.CloseCaseCallback): void; - - /** - * Calls CloseCase. - * @param request CloseCaseRequest message or plain object - * @returns Promise - */ - public closeCase(request: google.cloud.support.v2beta.ICloseCaseRequest): Promise; - - /** - * Calls SearchCaseClassifications. - * @param request SearchCaseClassificationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchCaseClassificationsResponse - */ - public searchCaseClassifications(request: google.cloud.support.v2beta.ISearchCaseClassificationsRequest, callback: google.cloud.support.v2beta.CaseService.SearchCaseClassificationsCallback): void; - - /** - * Calls SearchCaseClassifications. - * @param request SearchCaseClassificationsRequest message or plain object - * @returns Promise - */ - public searchCaseClassifications(request: google.cloud.support.v2beta.ISearchCaseClassificationsRequest): Promise; - } - - namespace CaseService { - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|getCase}. - * @param error Error, if any - * @param [response] Case - */ - type GetCaseCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Case) => void; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|listCases}. - * @param error Error, if any - * @param [response] ListCasesResponse - */ - type ListCasesCallback = (error: (Error|null), response?: google.cloud.support.v2beta.ListCasesResponse) => void; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|searchCases}. - * @param error Error, if any - * @param [response] SearchCasesResponse - */ - type SearchCasesCallback = (error: (Error|null), response?: google.cloud.support.v2beta.SearchCasesResponse) => void; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|createCase}. - * @param error Error, if any - * @param [response] Case - */ - type CreateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Case) => void; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|updateCase}. - * @param error Error, if any - * @param [response] Case - */ - type UpdateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Case) => void; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|escalateCase}. - * @param error Error, if any - * @param [response] Case - */ - type EscalateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Case) => void; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|closeCase}. - * @param error Error, if any - * @param [response] Case - */ - type CloseCaseCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Case) => void; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|searchCaseClassifications}. - * @param error Error, if any - * @param [response] SearchCaseClassificationsResponse - */ - type SearchCaseClassificationsCallback = (error: (Error|null), response?: google.cloud.support.v2beta.SearchCaseClassificationsResponse) => void; - } - - /** Properties of a GetCaseRequest. */ - interface IGetCaseRequest { - - /** GetCaseRequest name */ - name?: (string|null); - } - - /** Represents a GetCaseRequest. */ - class GetCaseRequest implements IGetCaseRequest { - - /** - * Constructs a new GetCaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IGetCaseRequest); - - /** GetCaseRequest name. */ - public name: string; - - /** - * Creates a new GetCaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCaseRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.IGetCaseRequest): google.cloud.support.v2beta.GetCaseRequest; - - /** - * Encodes the specified GetCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.GetCaseRequest.verify|verify} messages. - * @param message GetCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IGetCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.GetCaseRequest.verify|verify} messages. - * @param message GetCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IGetCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.GetCaseRequest; - - /** - * Decodes a GetCaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.GetCaseRequest; - - /** - * Verifies a GetCaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetCaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.GetCaseRequest; - - /** - * Creates a plain object from a GetCaseRequest message. Also converts values to other types if specified. - * @param message GetCaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.GetCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateCaseRequest. */ - interface ICreateCaseRequest { - - /** CreateCaseRequest parent */ - parent?: (string|null); - - /** CreateCaseRequest case */ - "case"?: (google.cloud.support.v2beta.ICase|null); - } - - /** Represents a CreateCaseRequest. */ - class CreateCaseRequest implements ICreateCaseRequest { - - /** - * Constructs a new CreateCaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.ICreateCaseRequest); - - /** CreateCaseRequest parent. */ - public parent: string; - - /** CreateCaseRequest case. */ - public case?: (google.cloud.support.v2beta.ICase|null); - - /** - * Creates a new CreateCaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCaseRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.ICreateCaseRequest): google.cloud.support.v2beta.CreateCaseRequest; - - /** - * Encodes the specified CreateCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.CreateCaseRequest.verify|verify} messages. - * @param message CreateCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.ICreateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CreateCaseRequest.verify|verify} messages. - * @param message CreateCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.ICreateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.CreateCaseRequest; - - /** - * Decodes a CreateCaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.CreateCaseRequest; - - /** - * Verifies a CreateCaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateCaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.CreateCaseRequest; - - /** - * Creates a plain object from a CreateCaseRequest message. Also converts values to other types if specified. - * @param message CreateCaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.CreateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCasesRequest. */ - interface IListCasesRequest { - - /** ListCasesRequest parent */ - parent?: (string|null); - - /** ListCasesRequest filter */ - filter?: (string|null); - - /** ListCasesRequest pageSize */ - pageSize?: (number|null); - - /** ListCasesRequest pageToken */ - pageToken?: (string|null); - - /** ListCasesRequest productLine */ - productLine?: (google.cloud.support.v2beta.ProductLine|keyof typeof google.cloud.support.v2beta.ProductLine|null); - } - - /** Represents a ListCasesRequest. */ - class ListCasesRequest implements IListCasesRequest { - - /** - * Constructs a new ListCasesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IListCasesRequest); - - /** ListCasesRequest parent. */ - public parent: string; - - /** ListCasesRequest filter. */ - public filter: string; - - /** ListCasesRequest pageSize. */ - public pageSize: number; - - /** ListCasesRequest pageToken. */ - public pageToken: string; - - /** ListCasesRequest productLine. */ - public productLine?: (google.cloud.support.v2beta.ProductLine|keyof typeof google.cloud.support.v2beta.ProductLine|null); - - /** - * Creates a new ListCasesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCasesRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.IListCasesRequest): google.cloud.support.v2beta.ListCasesRequest; - - /** - * Encodes the specified ListCasesRequest message. Does not implicitly {@link google.cloud.support.v2beta.ListCasesRequest.verify|verify} messages. - * @param message ListCasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IListCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCasesRequest.verify|verify} messages. - * @param message ListCasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IListCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCasesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ListCasesRequest; - - /** - * Decodes a ListCasesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ListCasesRequest; - - /** - * Verifies a ListCasesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCasesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCasesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ListCasesRequest; - - /** - * Creates a plain object from a ListCasesRequest message. Also converts values to other types if specified. - * @param message ListCasesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.ListCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCasesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCasesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCasesResponse. */ - interface IListCasesResponse { - - /** ListCasesResponse cases */ - cases?: (google.cloud.support.v2beta.ICase[]|null); - - /** ListCasesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListCasesResponse. */ - class ListCasesResponse implements IListCasesResponse { - - /** - * Constructs a new ListCasesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IListCasesResponse); - - /** ListCasesResponse cases. */ - public cases: google.cloud.support.v2beta.ICase[]; - - /** ListCasesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListCasesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCasesResponse instance - */ - public static create(properties?: google.cloud.support.v2beta.IListCasesResponse): google.cloud.support.v2beta.ListCasesResponse; - - /** - * Encodes the specified ListCasesResponse message. Does not implicitly {@link google.cloud.support.v2beta.ListCasesResponse.verify|verify} messages. - * @param message ListCasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IListCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCasesResponse.verify|verify} messages. - * @param message ListCasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IListCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCasesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ListCasesResponse; - - /** - * Decodes a ListCasesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ListCasesResponse; - - /** - * Verifies a ListCasesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCasesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCasesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ListCasesResponse; - - /** - * Creates a plain object from a ListCasesResponse message. Also converts values to other types if specified. - * @param message ListCasesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.ListCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCasesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCasesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SearchCasesRequest. */ - interface ISearchCasesRequest { - - /** SearchCasesRequest parent */ - parent?: (string|null); - - /** SearchCasesRequest query */ - query?: (string|null); - - /** SearchCasesRequest pageSize */ - pageSize?: (number|null); - - /** SearchCasesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a SearchCasesRequest. */ - class SearchCasesRequest implements ISearchCasesRequest { - - /** - * Constructs a new SearchCasesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.ISearchCasesRequest); - - /** SearchCasesRequest parent. */ - public parent: string; - - /** SearchCasesRequest query. */ - public query: string; - - /** SearchCasesRequest pageSize. */ - public pageSize: number; - - /** SearchCasesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new SearchCasesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchCasesRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.ISearchCasesRequest): google.cloud.support.v2beta.SearchCasesRequest; - - /** - * Encodes the specified SearchCasesRequest message. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesRequest.verify|verify} messages. - * @param message SearchCasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.ISearchCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesRequest.verify|verify} messages. - * @param message SearchCasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.ISearchCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchCasesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.SearchCasesRequest; - - /** - * Decodes a SearchCasesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.SearchCasesRequest; - - /** - * Verifies a SearchCasesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SearchCasesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchCasesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.SearchCasesRequest; - - /** - * Creates a plain object from a SearchCasesRequest message. Also converts values to other types if specified. - * @param message SearchCasesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.SearchCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchCasesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchCasesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SearchCasesResponse. */ - interface ISearchCasesResponse { - - /** SearchCasesResponse cases */ - cases?: (google.cloud.support.v2beta.ICase[]|null); - - /** SearchCasesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a SearchCasesResponse. */ - class SearchCasesResponse implements ISearchCasesResponse { - - /** - * Constructs a new SearchCasesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.ISearchCasesResponse); - - /** SearchCasesResponse cases. */ - public cases: google.cloud.support.v2beta.ICase[]; - - /** SearchCasesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new SearchCasesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchCasesResponse instance - */ - public static create(properties?: google.cloud.support.v2beta.ISearchCasesResponse): google.cloud.support.v2beta.SearchCasesResponse; - - /** - * Encodes the specified SearchCasesResponse message. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesResponse.verify|verify} messages. - * @param message SearchCasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.ISearchCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesResponse.verify|verify} messages. - * @param message SearchCasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.ISearchCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchCasesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.SearchCasesResponse; - - /** - * Decodes a SearchCasesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.SearchCasesResponse; - - /** - * Verifies a SearchCasesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SearchCasesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchCasesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.SearchCasesResponse; - - /** - * Creates a plain object from a SearchCasesResponse message. Also converts values to other types if specified. - * @param message SearchCasesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.SearchCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchCasesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchCasesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EscalateCaseRequest. */ - interface IEscalateCaseRequest { - - /** EscalateCaseRequest name */ - name?: (string|null); - - /** EscalateCaseRequest escalation */ - escalation?: (google.cloud.support.v2beta.IEscalation|null); - } - - /** Represents an EscalateCaseRequest. */ - class EscalateCaseRequest implements IEscalateCaseRequest { - - /** - * Constructs a new EscalateCaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IEscalateCaseRequest); - - /** EscalateCaseRequest name. */ - public name: string; - - /** EscalateCaseRequest escalation. */ - public escalation?: (google.cloud.support.v2beta.IEscalation|null); - - /** - * Creates a new EscalateCaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns EscalateCaseRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.IEscalateCaseRequest): google.cloud.support.v2beta.EscalateCaseRequest; - - /** - * Encodes the specified EscalateCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.EscalateCaseRequest.verify|verify} messages. - * @param message EscalateCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IEscalateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EscalateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.EscalateCaseRequest.verify|verify} messages. - * @param message EscalateCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IEscalateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EscalateCaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EscalateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.EscalateCaseRequest; - - /** - * Decodes an EscalateCaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EscalateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.EscalateCaseRequest; - - /** - * Verifies an EscalateCaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EscalateCaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EscalateCaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.EscalateCaseRequest; - - /** - * Creates a plain object from an EscalateCaseRequest message. Also converts values to other types if specified. - * @param message EscalateCaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.EscalateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EscalateCaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EscalateCaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateCaseRequest. */ - interface IUpdateCaseRequest { - - /** UpdateCaseRequest case */ - "case"?: (google.cloud.support.v2beta.ICase|null); - - /** UpdateCaseRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateCaseRequest. */ - class UpdateCaseRequest implements IUpdateCaseRequest { - - /** - * Constructs a new UpdateCaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IUpdateCaseRequest); - - /** UpdateCaseRequest case. */ - public case?: (google.cloud.support.v2beta.ICase|null); - - /** UpdateCaseRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateCaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCaseRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.IUpdateCaseRequest): google.cloud.support.v2beta.UpdateCaseRequest; - - /** - * Encodes the specified UpdateCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.UpdateCaseRequest.verify|verify} messages. - * @param message UpdateCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IUpdateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.UpdateCaseRequest.verify|verify} messages. - * @param message UpdateCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IUpdateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateCaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.UpdateCaseRequest; - - /** - * Decodes an UpdateCaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.UpdateCaseRequest; - - /** - * Verifies an UpdateCaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateCaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.UpdateCaseRequest; - - /** - * Creates a plain object from an UpdateCaseRequest message. Also converts values to other types if specified. - * @param message UpdateCaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.UpdateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateCaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateCaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloseCaseRequest. */ - interface ICloseCaseRequest { - - /** CloseCaseRequest name */ - name?: (string|null); - } - - /** Represents a CloseCaseRequest. */ - class CloseCaseRequest implements ICloseCaseRequest { - - /** - * Constructs a new CloseCaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.ICloseCaseRequest); - - /** CloseCaseRequest name. */ - public name: string; - - /** - * Creates a new CloseCaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CloseCaseRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.ICloseCaseRequest): google.cloud.support.v2beta.CloseCaseRequest; - - /** - * Encodes the specified CloseCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.CloseCaseRequest.verify|verify} messages. - * @param message CloseCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.ICloseCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloseCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CloseCaseRequest.verify|verify} messages. - * @param message CloseCaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.ICloseCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloseCaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloseCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.CloseCaseRequest; - - /** - * Decodes a CloseCaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloseCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.CloseCaseRequest; - - /** - * Verifies a CloseCaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloseCaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloseCaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.CloseCaseRequest; - - /** - * Creates a plain object from a CloseCaseRequest message. Also converts values to other types if specified. - * @param message CloseCaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.CloseCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloseCaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloseCaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SearchCaseClassificationsRequest. */ - interface ISearchCaseClassificationsRequest { - - /** SearchCaseClassificationsRequest query */ - query?: (string|null); - - /** SearchCaseClassificationsRequest pageSize */ - pageSize?: (number|null); - - /** SearchCaseClassificationsRequest pageToken */ - pageToken?: (string|null); - - /** SearchCaseClassificationsRequest product */ - product?: (google.cloud.support.v2beta.IProduct|null); - } - - /** Represents a SearchCaseClassificationsRequest. */ - class SearchCaseClassificationsRequest implements ISearchCaseClassificationsRequest { - - /** - * Constructs a new SearchCaseClassificationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.ISearchCaseClassificationsRequest); - - /** SearchCaseClassificationsRequest query. */ - public query: string; - - /** SearchCaseClassificationsRequest pageSize. */ - public pageSize: number; - - /** SearchCaseClassificationsRequest pageToken. */ - public pageToken: string; - - /** SearchCaseClassificationsRequest product. */ - public product?: (google.cloud.support.v2beta.IProduct|null); - - /** - * Creates a new SearchCaseClassificationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchCaseClassificationsRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.ISearchCaseClassificationsRequest): google.cloud.support.v2beta.SearchCaseClassificationsRequest; - - /** - * Encodes the specified SearchCaseClassificationsRequest message. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsRequest.verify|verify} messages. - * @param message SearchCaseClassificationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.ISearchCaseClassificationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchCaseClassificationsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsRequest.verify|verify} messages. - * @param message SearchCaseClassificationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.ISearchCaseClassificationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchCaseClassificationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.SearchCaseClassificationsRequest; - - /** - * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchCaseClassificationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.SearchCaseClassificationsRequest; - - /** - * Verifies a SearchCaseClassificationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SearchCaseClassificationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchCaseClassificationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.SearchCaseClassificationsRequest; - - /** - * Creates a plain object from a SearchCaseClassificationsRequest message. Also converts values to other types if specified. - * @param message SearchCaseClassificationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.SearchCaseClassificationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchCaseClassificationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchCaseClassificationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SearchCaseClassificationsResponse. */ - interface ISearchCaseClassificationsResponse { - - /** SearchCaseClassificationsResponse caseClassifications */ - caseClassifications?: (google.cloud.support.v2beta.ICaseClassification[]|null); - - /** SearchCaseClassificationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a SearchCaseClassificationsResponse. */ - class SearchCaseClassificationsResponse implements ISearchCaseClassificationsResponse { - - /** - * Constructs a new SearchCaseClassificationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.ISearchCaseClassificationsResponse); - - /** SearchCaseClassificationsResponse caseClassifications. */ - public caseClassifications: google.cloud.support.v2beta.ICaseClassification[]; - - /** SearchCaseClassificationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new SearchCaseClassificationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchCaseClassificationsResponse instance - */ - public static create(properties?: google.cloud.support.v2beta.ISearchCaseClassificationsResponse): google.cloud.support.v2beta.SearchCaseClassificationsResponse; - - /** - * Encodes the specified SearchCaseClassificationsResponse message. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsResponse.verify|verify} messages. - * @param message SearchCaseClassificationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.ISearchCaseClassificationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchCaseClassificationsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsResponse.verify|verify} messages. - * @param message SearchCaseClassificationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.ISearchCaseClassificationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchCaseClassificationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.SearchCaseClassificationsResponse; - - /** - * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchCaseClassificationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.SearchCaseClassificationsResponse; - - /** - * Verifies a SearchCaseClassificationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SearchCaseClassificationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchCaseClassificationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.SearchCaseClassificationsResponse; - - /** - * Creates a plain object from a SearchCaseClassificationsResponse message. Also converts values to other types if specified. - * @param message SearchCaseClassificationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.SearchCaseClassificationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchCaseClassificationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchCaseClassificationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Escalation. */ - interface IEscalation { - - /** Escalation reason */ - reason?: (google.cloud.support.v2beta.Escalation.Reason|keyof typeof google.cloud.support.v2beta.Escalation.Reason|null); - - /** Escalation justification */ - justification?: (string|null); - } - - /** Represents an Escalation. */ - class Escalation implements IEscalation { - - /** - * Constructs a new Escalation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IEscalation); - - /** Escalation reason. */ - public reason: (google.cloud.support.v2beta.Escalation.Reason|keyof typeof google.cloud.support.v2beta.Escalation.Reason); - - /** Escalation justification. */ - public justification: string; - - /** - * Creates a new Escalation instance using the specified properties. - * @param [properties] Properties to set - * @returns Escalation instance - */ - public static create(properties?: google.cloud.support.v2beta.IEscalation): google.cloud.support.v2beta.Escalation; - - /** - * Encodes the specified Escalation message. Does not implicitly {@link google.cloud.support.v2beta.Escalation.verify|verify} messages. - * @param message Escalation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IEscalation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Escalation message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Escalation.verify|verify} messages. - * @param message Escalation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IEscalation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Escalation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Escalation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.Escalation; - - /** - * Decodes an Escalation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Escalation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.Escalation; - - /** - * Verifies an Escalation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Escalation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Escalation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.Escalation; - - /** - * Creates a plain object from an Escalation message. Also converts values to other types if specified. - * @param message Escalation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.Escalation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Escalation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Escalation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Escalation { - - /** Reason enum. */ - enum Reason { - REASON_UNSPECIFIED = 0, - RESOLUTION_TIME = 1, - TECHNICAL_EXPERTISE = 2, - BUSINESS_IMPACT = 3 - } - } - - /** Properties of a Comment. */ - interface IComment { - - /** Comment name */ - name?: (string|null); - - /** Comment createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Comment creator */ - creator?: (google.cloud.support.v2beta.IActor|null); - - /** Comment body */ - body?: (string|null); - - /** Comment plainTextBody */ - plainTextBody?: (string|null); - } - - /** Represents a Comment. */ - class Comment implements IComment { - - /** - * Constructs a new Comment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IComment); - - /** Comment name. */ - public name: string; - - /** Comment createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Comment creator. */ - public creator?: (google.cloud.support.v2beta.IActor|null); - - /** Comment body. */ - public body: string; - - /** Comment plainTextBody. */ - public plainTextBody: string; - - /** - * Creates a new Comment instance using the specified properties. - * @param [properties] Properties to set - * @returns Comment instance - */ - public static create(properties?: google.cloud.support.v2beta.IComment): google.cloud.support.v2beta.Comment; - - /** - * Encodes the specified Comment message. Does not implicitly {@link google.cloud.support.v2beta.Comment.verify|verify} messages. - * @param message Comment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IComment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Comment message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Comment.verify|verify} messages. - * @param message Comment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IComment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Comment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Comment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.Comment; - - /** - * Decodes a Comment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Comment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.Comment; - - /** - * Verifies a Comment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Comment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Comment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.Comment; - - /** - * Creates a plain object from a Comment message. Also converts values to other types if specified. - * @param message Comment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.Comment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Comment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Comment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a CommentService */ - class CommentService extends $protobuf.rpc.Service { - - /** - * Constructs a new CommentService 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 CommentService 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): CommentService; - - /** - * Calls ListComments. - * @param request ListCommentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCommentsResponse - */ - public listComments(request: google.cloud.support.v2beta.IListCommentsRequest, callback: google.cloud.support.v2beta.CommentService.ListCommentsCallback): void; - - /** - * Calls ListComments. - * @param request ListCommentsRequest message or plain object - * @returns Promise - */ - public listComments(request: google.cloud.support.v2beta.IListCommentsRequest): Promise; - - /** - * Calls CreateComment. - * @param request CreateCommentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Comment - */ - public createComment(request: google.cloud.support.v2beta.ICreateCommentRequest, callback: google.cloud.support.v2beta.CommentService.CreateCommentCallback): void; - - /** - * Calls CreateComment. - * @param request CreateCommentRequest message or plain object - * @returns Promise - */ - public createComment(request: google.cloud.support.v2beta.ICreateCommentRequest): Promise; - - /** - * Calls GetComment. - * @param request GetCommentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Comment - */ - public getComment(request: google.cloud.support.v2beta.IGetCommentRequest, callback: google.cloud.support.v2beta.CommentService.GetCommentCallback): void; - - /** - * Calls GetComment. - * @param request GetCommentRequest message or plain object - * @returns Promise - */ - public getComment(request: google.cloud.support.v2beta.IGetCommentRequest): Promise; - } - - namespace CommentService { - - /** - * Callback as used by {@link google.cloud.support.v2beta.CommentService|listComments}. - * @param error Error, if any - * @param [response] ListCommentsResponse - */ - type ListCommentsCallback = (error: (Error|null), response?: google.cloud.support.v2beta.ListCommentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CommentService|createComment}. - * @param error Error, if any - * @param [response] Comment - */ - type CreateCommentCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Comment) => void; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CommentService|getComment}. - * @param error Error, if any - * @param [response] Comment - */ - type GetCommentCallback = (error: (Error|null), response?: google.cloud.support.v2beta.Comment) => void; - } - - /** Properties of a ListCommentsRequest. */ - interface IListCommentsRequest { - - /** ListCommentsRequest parent */ - parent?: (string|null); - - /** ListCommentsRequest pageSize */ - pageSize?: (number|null); - - /** ListCommentsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListCommentsRequest. */ - class ListCommentsRequest implements IListCommentsRequest { - - /** - * Constructs a new ListCommentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IListCommentsRequest); - - /** ListCommentsRequest parent. */ - public parent: string; - - /** ListCommentsRequest pageSize. */ - public pageSize: number; - - /** ListCommentsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListCommentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCommentsRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.IListCommentsRequest): google.cloud.support.v2beta.ListCommentsRequest; - - /** - * Encodes the specified ListCommentsRequest message. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsRequest.verify|verify} messages. - * @param message ListCommentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IListCommentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCommentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsRequest.verify|verify} messages. - * @param message ListCommentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IListCommentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCommentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCommentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ListCommentsRequest; - - /** - * Decodes a ListCommentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCommentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ListCommentsRequest; - - /** - * Verifies a ListCommentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCommentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCommentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ListCommentsRequest; - - /** - * Creates a plain object from a ListCommentsRequest message. Also converts values to other types if specified. - * @param message ListCommentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.ListCommentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCommentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCommentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListCommentsResponse. */ - interface IListCommentsResponse { - - /** ListCommentsResponse comments */ - comments?: (google.cloud.support.v2beta.IComment[]|null); - - /** ListCommentsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListCommentsResponse. */ - class ListCommentsResponse implements IListCommentsResponse { - - /** - * Constructs a new ListCommentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IListCommentsResponse); - - /** ListCommentsResponse comments. */ - public comments: google.cloud.support.v2beta.IComment[]; - - /** ListCommentsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListCommentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCommentsResponse instance - */ - public static create(properties?: google.cloud.support.v2beta.IListCommentsResponse): google.cloud.support.v2beta.ListCommentsResponse; - - /** - * Encodes the specified ListCommentsResponse message. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsResponse.verify|verify} messages. - * @param message ListCommentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IListCommentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCommentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsResponse.verify|verify} messages. - * @param message ListCommentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IListCommentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCommentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCommentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ListCommentsResponse; - - /** - * Decodes a ListCommentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCommentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ListCommentsResponse; - - /** - * Verifies a ListCommentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListCommentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCommentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ListCommentsResponse; - - /** - * Creates a plain object from a ListCommentsResponse message. Also converts values to other types if specified. - * @param message ListCommentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.ListCommentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListCommentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListCommentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateCommentRequest. */ - interface ICreateCommentRequest { - - /** CreateCommentRequest parent */ - parent?: (string|null); - - /** CreateCommentRequest comment */ - comment?: (google.cloud.support.v2beta.IComment|null); - } - - /** Represents a CreateCommentRequest. */ - class CreateCommentRequest implements ICreateCommentRequest { - - /** - * Constructs a new CreateCommentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.ICreateCommentRequest); - - /** CreateCommentRequest parent. */ - public parent: string; - - /** CreateCommentRequest comment. */ - public comment?: (google.cloud.support.v2beta.IComment|null); - - /** - * Creates a new CreateCommentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateCommentRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.ICreateCommentRequest): google.cloud.support.v2beta.CreateCommentRequest; - - /** - * Encodes the specified CreateCommentRequest message. Does not implicitly {@link google.cloud.support.v2beta.CreateCommentRequest.verify|verify} messages. - * @param message CreateCommentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.ICreateCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CreateCommentRequest.verify|verify} messages. - * @param message CreateCommentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.ICreateCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateCommentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateCommentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.CreateCommentRequest; - - /** - * Decodes a CreateCommentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateCommentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.CreateCommentRequest; - - /** - * Verifies a CreateCommentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateCommentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateCommentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.CreateCommentRequest; - - /** - * Creates a plain object from a CreateCommentRequest message. Also converts values to other types if specified. - * @param message CreateCommentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.CreateCommentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateCommentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateCommentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetCommentRequest. */ - interface IGetCommentRequest { - - /** GetCommentRequest name */ - name?: (string|null); - } - - /** Represents a GetCommentRequest. */ - class GetCommentRequest implements IGetCommentRequest { - - /** - * Constructs a new GetCommentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IGetCommentRequest); - - /** GetCommentRequest name. */ - public name: string; - - /** - * Creates a new GetCommentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCommentRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.IGetCommentRequest): google.cloud.support.v2beta.GetCommentRequest; - - /** - * Encodes the specified GetCommentRequest message. Does not implicitly {@link google.cloud.support.v2beta.GetCommentRequest.verify|verify} messages. - * @param message GetCommentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IGetCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.GetCommentRequest.verify|verify} messages. - * @param message GetCommentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IGetCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetCommentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCommentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.GetCommentRequest; - - /** - * Decodes a GetCommentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCommentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.GetCommentRequest; - - /** - * Verifies a GetCommentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetCommentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCommentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.GetCommentRequest; - - /** - * Creates a plain object from a GetCommentRequest message. Also converts values to other types if specified. - * @param message GetCommentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.GetCommentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetCommentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetCommentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TextContent. */ - interface ITextContent { - - /** TextContent plainText */ - plainText?: (string|null); - } - - /** Represents a TextContent. */ - class TextContent implements ITextContent { - - /** - * Constructs a new TextContent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.ITextContent); - - /** TextContent plainText. */ - public plainText: string; - - /** - * Creates a new TextContent instance using the specified properties. - * @param [properties] Properties to set - * @returns TextContent instance - */ - public static create(properties?: google.cloud.support.v2beta.ITextContent): google.cloud.support.v2beta.TextContent; - - /** - * Encodes the specified TextContent message. Does not implicitly {@link google.cloud.support.v2beta.TextContent.verify|verify} messages. - * @param message TextContent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.ITextContent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextContent message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.TextContent.verify|verify} messages. - * @param message TextContent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.ITextContent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TextContent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.TextContent; - - /** - * Decodes a TextContent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.TextContent; - - /** - * Verifies a TextContent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TextContent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextContent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.TextContent; - - /** - * Creates a plain object from a TextContent message. Also converts values to other types if specified. - * @param message TextContent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.TextContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextContent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TextContent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EmailMessage. */ - interface IEmailMessage { - - /** EmailMessage name */ - name?: (string|null); - - /** EmailMessage createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** EmailMessage actor */ - actor?: (google.cloud.support.v2beta.IActor|null); - - /** EmailMessage subject */ - subject?: (string|null); - - /** EmailMessage recipientEmailAddresses */ - recipientEmailAddresses?: (string[]|null); - - /** EmailMessage ccEmailAddresses */ - ccEmailAddresses?: (string[]|null); - - /** EmailMessage bodyContent */ - bodyContent?: (google.cloud.support.v2beta.ITextContent|null); - } - - /** Represents an EmailMessage. */ - class EmailMessage implements IEmailMessage { - - /** - * Constructs a new EmailMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IEmailMessage); - - /** EmailMessage name. */ - public name: string; - - /** EmailMessage createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** EmailMessage actor. */ - public actor?: (google.cloud.support.v2beta.IActor|null); - - /** EmailMessage subject. */ - public subject: string; - - /** EmailMessage recipientEmailAddresses. */ - public recipientEmailAddresses: string[]; - - /** EmailMessage ccEmailAddresses. */ - public ccEmailAddresses: string[]; - - /** EmailMessage bodyContent. */ - public bodyContent?: (google.cloud.support.v2beta.ITextContent|null); - - /** - * Creates a new EmailMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns EmailMessage instance - */ - public static create(properties?: google.cloud.support.v2beta.IEmailMessage): google.cloud.support.v2beta.EmailMessage; - - /** - * Encodes the specified EmailMessage message. Does not implicitly {@link google.cloud.support.v2beta.EmailMessage.verify|verify} messages. - * @param message EmailMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IEmailMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EmailMessage message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.EmailMessage.verify|verify} messages. - * @param message EmailMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IEmailMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EmailMessage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EmailMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.EmailMessage; - - /** - * Decodes an EmailMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EmailMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.EmailMessage; - - /** - * Verifies an EmailMessage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EmailMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EmailMessage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.EmailMessage; - - /** - * Creates a plain object from an EmailMessage message. Also converts values to other types if specified. - * @param message EmailMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.EmailMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EmailMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EmailMessage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FeedItem. */ - interface IFeedItem { - - /** FeedItem comment */ - comment?: (google.cloud.support.v2beta.IComment|null); - - /** FeedItem attachment */ - attachment?: (google.cloud.support.v2beta.IAttachment|null); - - /** FeedItem emailMessage */ - emailMessage?: (google.cloud.support.v2beta.IEmailMessage|null); - - /** FeedItem deletedAttachment */ - deletedAttachment?: (google.cloud.support.v2beta.IAttachment|null); - - /** FeedItem eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a FeedItem. */ - class FeedItem implements IFeedItem { - - /** - * Constructs a new FeedItem. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IFeedItem); - - /** FeedItem comment. */ - public comment?: (google.cloud.support.v2beta.IComment|null); - - /** FeedItem attachment. */ - public attachment?: (google.cloud.support.v2beta.IAttachment|null); - - /** FeedItem emailMessage. */ - public emailMessage?: (google.cloud.support.v2beta.IEmailMessage|null); - - /** FeedItem deletedAttachment. */ - public deletedAttachment?: (google.cloud.support.v2beta.IAttachment|null); - - /** FeedItem eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); - - /** FeedItem eventObject. */ - public eventObject?: ("comment"|"attachment"|"emailMessage"|"deletedAttachment"); - - /** - * Creates a new FeedItem instance using the specified properties. - * @param [properties] Properties to set - * @returns FeedItem instance - */ - public static create(properties?: google.cloud.support.v2beta.IFeedItem): google.cloud.support.v2beta.FeedItem; - - /** - * Encodes the specified FeedItem message. Does not implicitly {@link google.cloud.support.v2beta.FeedItem.verify|verify} messages. - * @param message FeedItem message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IFeedItem, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeedItem message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.FeedItem.verify|verify} messages. - * @param message FeedItem message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IFeedItem, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeedItem message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeedItem - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.FeedItem; - - /** - * Decodes a FeedItem message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeedItem - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.FeedItem; - - /** - * Verifies a FeedItem message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeedItem message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeedItem - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.FeedItem; - - /** - * Creates a plain object from a FeedItem message. Also converts values to other types if specified. - * @param message FeedItem - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.FeedItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeedItem to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeedItem - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a FeedService */ - class FeedService extends $protobuf.rpc.Service { - - /** - * Constructs a new FeedService 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 FeedService 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): FeedService; - - /** - * Calls ShowFeed. - * @param request ShowFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ShowFeedResponse - */ - public showFeed(request: google.cloud.support.v2beta.IShowFeedRequest, callback: google.cloud.support.v2beta.FeedService.ShowFeedCallback): void; - - /** - * Calls ShowFeed. - * @param request ShowFeedRequest message or plain object - * @returns Promise - */ - public showFeed(request: google.cloud.support.v2beta.IShowFeedRequest): Promise; - } - - namespace FeedService { - - /** - * Callback as used by {@link google.cloud.support.v2beta.FeedService|showFeed}. - * @param error Error, if any - * @param [response] ShowFeedResponse - */ - type ShowFeedCallback = (error: (Error|null), response?: google.cloud.support.v2beta.ShowFeedResponse) => void; - } - - /** Properties of a ShowFeedRequest. */ - interface IShowFeedRequest { - - /** ShowFeedRequest parent */ - parent?: (string|null); - - /** ShowFeedRequest orderBy */ - orderBy?: (string|null); - - /** ShowFeedRequest pageSize */ - pageSize?: (number|null); - - /** ShowFeedRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ShowFeedRequest. */ - class ShowFeedRequest implements IShowFeedRequest { - - /** - * Constructs a new ShowFeedRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IShowFeedRequest); - - /** ShowFeedRequest parent. */ - public parent: string; - - /** ShowFeedRequest orderBy. */ - public orderBy: string; - - /** ShowFeedRequest pageSize. */ - public pageSize: number; - - /** ShowFeedRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ShowFeedRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ShowFeedRequest instance - */ - public static create(properties?: google.cloud.support.v2beta.IShowFeedRequest): google.cloud.support.v2beta.ShowFeedRequest; - - /** - * Encodes the specified ShowFeedRequest message. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedRequest.verify|verify} messages. - * @param message ShowFeedRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IShowFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ShowFeedRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedRequest.verify|verify} messages. - * @param message ShowFeedRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IShowFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ShowFeedRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ShowFeedRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ShowFeedRequest; - - /** - * Decodes a ShowFeedRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ShowFeedRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ShowFeedRequest; - - /** - * Verifies a ShowFeedRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ShowFeedRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ShowFeedRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ShowFeedRequest; - - /** - * Creates a plain object from a ShowFeedRequest message. Also converts values to other types if specified. - * @param message ShowFeedRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.ShowFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ShowFeedRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ShowFeedRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ShowFeedResponse. */ - interface IShowFeedResponse { - - /** ShowFeedResponse feedItems */ - feedItems?: (google.cloud.support.v2beta.IFeedItem[]|null); - - /** ShowFeedResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ShowFeedResponse. */ - class ShowFeedResponse implements IShowFeedResponse { - - /** - * Constructs a new ShowFeedResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.support.v2beta.IShowFeedResponse); - - /** ShowFeedResponse feedItems. */ - public feedItems: google.cloud.support.v2beta.IFeedItem[]; - - /** ShowFeedResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ShowFeedResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ShowFeedResponse instance - */ - public static create(properties?: google.cloud.support.v2beta.IShowFeedResponse): google.cloud.support.v2beta.ShowFeedResponse; - - /** - * Encodes the specified ShowFeedResponse message. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedResponse.verify|verify} messages. - * @param message ShowFeedResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.support.v2beta.IShowFeedResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ShowFeedResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedResponse.verify|verify} messages. - * @param message ShowFeedResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.support.v2beta.IShowFeedResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ShowFeedResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ShowFeedResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2beta.ShowFeedResponse; - - /** - * Decodes a ShowFeedResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ShowFeedResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2beta.ShowFeedResponse; - - /** - * Verifies a ShowFeedResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ShowFeedResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ShowFeedResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.support.v2beta.ShowFeedResponse; - - /** - * Creates a plain object from a ShowFeedResponse message. Also converts values to other types if specified. - * @param message ShowFeedResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.support.v2beta.ShowFeedResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ShowFeedResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ShowFeedResponse - * @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); - } - - /** 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 Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a 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 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; - } - } -} diff --git a/owl-bot-staging/google-cloud-support/protos/protos.js b/owl-bot-staging/google-cloud-support/protos/protos.js deleted file mode 100644 index 54c87cf8b68..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/protos.js +++ /dev/null @@ -1,33942 +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_support_protos || ($protobuf.roots._google_cloud_support_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.support = (function() { - - /** - * Namespace support. - * @memberof google.cloud - * @namespace - */ - var support = {}; - - support.v2 = (function() { - - /** - * Namespace v2. - * @memberof google.cloud.support - * @namespace - */ - var v2 = {}; - - v2.Actor = (function() { - - /** - * Properties of an Actor. - * @memberof google.cloud.support.v2 - * @interface IActor - * @property {string|null} [displayName] Actor displayName - * @property {string|null} [email] Actor email - * @property {boolean|null} [googleSupport] Actor googleSupport - * @property {string|null} [username] Actor username - */ - - /** - * Constructs a new Actor. - * @memberof google.cloud.support.v2 - * @classdesc Represents an Actor. - * @implements IActor - * @constructor - * @param {google.cloud.support.v2.IActor=} [properties] Properties to set - */ - function Actor(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Actor displayName. - * @member {string} displayName - * @memberof google.cloud.support.v2.Actor - * @instance - */ - Actor.prototype.displayName = ""; - - /** - * Actor email. - * @member {string} email - * @memberof google.cloud.support.v2.Actor - * @instance - */ - Actor.prototype.email = ""; - - /** - * Actor googleSupport. - * @member {boolean} googleSupport - * @memberof google.cloud.support.v2.Actor - * @instance - */ - Actor.prototype.googleSupport = false; - - /** - * Actor username. - * @member {string} username - * @memberof google.cloud.support.v2.Actor - * @instance - */ - Actor.prototype.username = ""; - - /** - * Creates a new Actor instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.Actor - * @static - * @param {google.cloud.support.v2.IActor=} [properties] Properties to set - * @returns {google.cloud.support.v2.Actor} Actor instance - */ - Actor.create = function create(properties) { - return new Actor(properties); - }; - - /** - * Encodes the specified Actor message. Does not implicitly {@link google.cloud.support.v2.Actor.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.Actor - * @static - * @param {google.cloud.support.v2.IActor} message Actor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Actor.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.email != null && Object.hasOwnProperty.call(message, "email")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); - if (message.googleSupport != null && Object.hasOwnProperty.call(message, "googleSupport")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.googleSupport); - if (message.username != null && Object.hasOwnProperty.call(message, "username")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.username); - return writer; - }; - - /** - * Encodes the specified Actor message, length delimited. Does not implicitly {@link google.cloud.support.v2.Actor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.Actor - * @static - * @param {google.cloud.support.v2.IActor} message Actor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Actor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Actor message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.Actor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.Actor} Actor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Actor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Actor(); - 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.email = reader.string(); - break; - } - case 4: { - message.googleSupport = reader.bool(); - break; - } - case 5: { - message.username = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Actor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.Actor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.Actor} Actor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Actor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Actor message. - * @function verify - * @memberof google.cloud.support.v2.Actor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Actor.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.email != null && message.hasOwnProperty("email")) - if (!$util.isString(message.email)) - return "email: string expected"; - if (message.googleSupport != null && message.hasOwnProperty("googleSupport")) - if (typeof message.googleSupport !== "boolean") - return "googleSupport: boolean expected"; - if (message.username != null && message.hasOwnProperty("username")) - if (!$util.isString(message.username)) - return "username: string expected"; - return null; - }; - - /** - * Creates an Actor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.Actor - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.Actor} Actor - */ - Actor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.Actor) - return object; - var message = new $root.google.cloud.support.v2.Actor(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.email != null) - message.email = String(object.email); - if (object.googleSupport != null) - message.googleSupport = Boolean(object.googleSupport); - if (object.username != null) - message.username = String(object.username); - return message; - }; - - /** - * Creates a plain object from an Actor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.Actor - * @static - * @param {google.cloud.support.v2.Actor} message Actor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Actor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.displayName = ""; - object.email = ""; - object.googleSupport = false; - object.username = ""; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.email != null && message.hasOwnProperty("email")) - object.email = message.email; - if (message.googleSupport != null && message.hasOwnProperty("googleSupport")) - object.googleSupport = message.googleSupport; - if (message.username != null && message.hasOwnProperty("username")) - object.username = message.username; - return object; - }; - - /** - * Converts this Actor to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.Actor - * @instance - * @returns {Object.} JSON object - */ - Actor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Actor - * @function getTypeUrl - * @memberof google.cloud.support.v2.Actor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Actor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.Actor"; - }; - - return Actor; - })(); - - v2.Attachment = (function() { - - /** - * Properties of an Attachment. - * @memberof google.cloud.support.v2 - * @interface IAttachment - * @property {string|null} [name] Attachment name - * @property {google.protobuf.ITimestamp|null} [createTime] Attachment createTime - * @property {google.cloud.support.v2.IActor|null} [creator] Attachment creator - * @property {string|null} [filename] Attachment filename - * @property {string|null} [mimeType] Attachment mimeType - * @property {number|Long|null} [sizeBytes] Attachment sizeBytes - */ - - /** - * Constructs a new Attachment. - * @memberof google.cloud.support.v2 - * @classdesc Represents an Attachment. - * @implements IAttachment - * @constructor - * @param {google.cloud.support.v2.IAttachment=} [properties] Properties to set - */ - function Attachment(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Attachment name. - * @member {string} name - * @memberof google.cloud.support.v2.Attachment - * @instance - */ - Attachment.prototype.name = ""; - - /** - * Attachment createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.support.v2.Attachment - * @instance - */ - Attachment.prototype.createTime = null; - - /** - * Attachment creator. - * @member {google.cloud.support.v2.IActor|null|undefined} creator - * @memberof google.cloud.support.v2.Attachment - * @instance - */ - Attachment.prototype.creator = null; - - /** - * Attachment filename. - * @member {string} filename - * @memberof google.cloud.support.v2.Attachment - * @instance - */ - Attachment.prototype.filename = ""; - - /** - * Attachment mimeType. - * @member {string} mimeType - * @memberof google.cloud.support.v2.Attachment - * @instance - */ - Attachment.prototype.mimeType = ""; - - /** - * Attachment sizeBytes. - * @member {number|Long} sizeBytes - * @memberof google.cloud.support.v2.Attachment - * @instance - */ - Attachment.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Attachment instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.Attachment - * @static - * @param {google.cloud.support.v2.IAttachment=} [properties] Properties to set - * @returns {google.cloud.support.v2.Attachment} Attachment instance - */ - Attachment.create = function create(properties) { - return new Attachment(properties); - }; - - /** - * Encodes the specified Attachment message. Does not implicitly {@link google.cloud.support.v2.Attachment.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.Attachment - * @static - * @param {google.cloud.support.v2.IAttachment} message Attachment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attachment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - $root.google.cloud.support.v2.Actor.encode(message.creator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filename); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.mimeType); - if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.sizeBytes); - return writer; - }; - - /** - * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.cloud.support.v2.Attachment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.Attachment - * @static - * @param {google.cloud.support.v2.IAttachment} message Attachment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attachment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Attachment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.Attachment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.Attachment} Attachment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attachment.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Attachment(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.creator = $root.google.cloud.support.v2.Actor.decode(reader, reader.uint32()); - break; - } - case 4: { - message.filename = reader.string(); - break; - } - case 5: { - message.mimeType = reader.string(); - break; - } - case 6: { - message.sizeBytes = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Attachment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.Attachment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.Attachment} Attachment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attachment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Attachment message. - * @function verify - * @memberof google.cloud.support.v2.Attachment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Attachment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: 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.creator != null && message.hasOwnProperty("creator")) { - var error = $root.google.cloud.support.v2.Actor.verify(message.creator); - if (error) - return "creator." + error; - } - if (message.filename != null && message.hasOwnProperty("filename")) - if (!$util.isString(message.filename)) - return "filename: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) - return "sizeBytes: integer|Long expected"; - return null; - }; - - /** - * Creates an Attachment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.Attachment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.Attachment} Attachment - */ - Attachment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.Attachment) - return object; - var message = new $root.google.cloud.support.v2.Attachment(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.support.v2.Attachment.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.creator != null) { - if (typeof object.creator !== "object") - throw TypeError(".google.cloud.support.v2.Attachment.creator: object expected"); - message.creator = $root.google.cloud.support.v2.Actor.fromObject(object.creator); - } - if (object.filename != null) - message.filename = String(object.filename); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.sizeBytes != null) - if ($util.Long) - (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; - else if (typeof object.sizeBytes === "string") - message.sizeBytes = parseInt(object.sizeBytes, 10); - else if (typeof object.sizeBytes === "number") - message.sizeBytes = object.sizeBytes; - else if (typeof object.sizeBytes === "object") - message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Attachment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.Attachment - * @static - * @param {google.cloud.support.v2.Attachment} message Attachment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Attachment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.creator = null; - object.filename = ""; - object.mimeType = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeBytes = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = $root.google.cloud.support.v2.Actor.toObject(message.creator, options); - if (message.filename != null && message.hasOwnProperty("filename")) - object.filename = message.filename; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (typeof message.sizeBytes === "number") - object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; - else - object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; - return object; - }; - - /** - * Converts this Attachment to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.Attachment - * @instance - * @returns {Object.} JSON object - */ - Attachment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Attachment - * @function getTypeUrl - * @memberof google.cloud.support.v2.Attachment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Attachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.Attachment"; - }; - - return Attachment; - })(); - - v2.CaseAttachmentService = (function() { - - /** - * Constructs a new CaseAttachmentService service. - * @memberof google.cloud.support.v2 - * @classdesc Represents a CaseAttachmentService - * @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 CaseAttachmentService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CaseAttachmentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CaseAttachmentService; - - /** - * Creates new CaseAttachmentService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.support.v2.CaseAttachmentService - * @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 {CaseAttachmentService} RPC service. Useful where requests and/or responses are streamed. - */ - CaseAttachmentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.support.v2.CaseAttachmentService|listAttachments}. - * @memberof google.cloud.support.v2.CaseAttachmentService - * @typedef ListAttachmentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2.ListAttachmentsResponse} [response] ListAttachmentsResponse - */ - - /** - * Calls ListAttachments. - * @function listAttachments - * @memberof google.cloud.support.v2.CaseAttachmentService - * @instance - * @param {google.cloud.support.v2.IListAttachmentsRequest} request ListAttachmentsRequest message or plain object - * @param {google.cloud.support.v2.CaseAttachmentService.ListAttachmentsCallback} callback Node-style callback called with the error, if any, and ListAttachmentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseAttachmentService.prototype.listAttachments = function listAttachments(request, callback) { - return this.rpcCall(listAttachments, $root.google.cloud.support.v2.ListAttachmentsRequest, $root.google.cloud.support.v2.ListAttachmentsResponse, request, callback); - }, "name", { value: "ListAttachments" }); - - /** - * Calls ListAttachments. - * @function listAttachments - * @memberof google.cloud.support.v2.CaseAttachmentService - * @instance - * @param {google.cloud.support.v2.IListAttachmentsRequest} request ListAttachmentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CaseAttachmentService; - })(); - - v2.ListAttachmentsRequest = (function() { - - /** - * Properties of a ListAttachmentsRequest. - * @memberof google.cloud.support.v2 - * @interface IListAttachmentsRequest - * @property {string|null} [parent] ListAttachmentsRequest parent - * @property {number|null} [pageSize] ListAttachmentsRequest pageSize - * @property {string|null} [pageToken] ListAttachmentsRequest pageToken - */ - - /** - * Constructs a new ListAttachmentsRequest. - * @memberof google.cloud.support.v2 - * @classdesc Represents a ListAttachmentsRequest. - * @implements IListAttachmentsRequest - * @constructor - * @param {google.cloud.support.v2.IListAttachmentsRequest=} [properties] Properties to set - */ - function ListAttachmentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAttachmentsRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @instance - */ - ListAttachmentsRequest.prototype.parent = ""; - - /** - * ListAttachmentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @instance - */ - ListAttachmentsRequest.prototype.pageSize = 0; - - /** - * ListAttachmentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @instance - */ - ListAttachmentsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListAttachmentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @static - * @param {google.cloud.support.v2.IListAttachmentsRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2.ListAttachmentsRequest} ListAttachmentsRequest instance - */ - ListAttachmentsRequest.create = function create(properties) { - return new ListAttachmentsRequest(properties); - }; - - /** - * Encodes the specified ListAttachmentsRequest message. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @static - * @param {google.cloud.support.v2.IListAttachmentsRequest} message ListAttachmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttachmentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @static - * @param {google.cloud.support.v2.IListAttachmentsRequest} message ListAttachmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttachmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAttachmentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.ListAttachmentsRequest} ListAttachmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttachmentsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListAttachmentsRequest(); - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAttachmentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.ListAttachmentsRequest} ListAttachmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttachmentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAttachmentsRequest message. - * @function verify - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAttachmentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListAttachmentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.ListAttachmentsRequest} ListAttachmentsRequest - */ - ListAttachmentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.ListAttachmentsRequest) - return object; - var message = new $root.google.cloud.support.v2.ListAttachmentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListAttachmentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @static - * @param {google.cloud.support.v2.ListAttachmentsRequest} message ListAttachmentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAttachmentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListAttachmentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListAttachmentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAttachmentsRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2.ListAttachmentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAttachmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.ListAttachmentsRequest"; - }; - - return ListAttachmentsRequest; - })(); - - v2.ListAttachmentsResponse = (function() { - - /** - * Properties of a ListAttachmentsResponse. - * @memberof google.cloud.support.v2 - * @interface IListAttachmentsResponse - * @property {Array.|null} [attachments] ListAttachmentsResponse attachments - * @property {string|null} [nextPageToken] ListAttachmentsResponse nextPageToken - */ - - /** - * Constructs a new ListAttachmentsResponse. - * @memberof google.cloud.support.v2 - * @classdesc Represents a ListAttachmentsResponse. - * @implements IListAttachmentsResponse - * @constructor - * @param {google.cloud.support.v2.IListAttachmentsResponse=} [properties] Properties to set - */ - function ListAttachmentsResponse(properties) { - this.attachments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAttachmentsResponse attachments. - * @member {Array.} attachments - * @memberof google.cloud.support.v2.ListAttachmentsResponse - * @instance - */ - ListAttachmentsResponse.prototype.attachments = $util.emptyArray; - - /** - * ListAttachmentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.support.v2.ListAttachmentsResponse - * @instance - */ - ListAttachmentsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAttachmentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.ListAttachmentsResponse - * @static - * @param {google.cloud.support.v2.IListAttachmentsResponse=} [properties] Properties to set - * @returns {google.cloud.support.v2.ListAttachmentsResponse} ListAttachmentsResponse instance - */ - ListAttachmentsResponse.create = function create(properties) { - return new ListAttachmentsResponse(properties); - }; - - /** - * Encodes the specified ListAttachmentsResponse message. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.ListAttachmentsResponse - * @static - * @param {google.cloud.support.v2.IListAttachmentsResponse} message ListAttachmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttachmentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attachments != null && message.attachments.length) - for (var i = 0; i < message.attachments.length; ++i) - $root.google.cloud.support.v2.Attachment.encode(message.attachments[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 ListAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.ListAttachmentsResponse - * @static - * @param {google.cloud.support.v2.IListAttachmentsResponse} message ListAttachmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttachmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAttachmentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.ListAttachmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.ListAttachmentsResponse} ListAttachmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttachmentsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListAttachmentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.attachments && message.attachments.length)) - message.attachments = []; - message.attachments.push($root.google.cloud.support.v2.Attachment.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAttachmentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.ListAttachmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.ListAttachmentsResponse} ListAttachmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttachmentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAttachmentsResponse message. - * @function verify - * @memberof google.cloud.support.v2.ListAttachmentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAttachmentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attachments != null && message.hasOwnProperty("attachments")) { - if (!Array.isArray(message.attachments)) - return "attachments: array expected"; - for (var i = 0; i < message.attachments.length; ++i) { - var error = $root.google.cloud.support.v2.Attachment.verify(message.attachments[i]); - if (error) - return "attachments." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAttachmentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.ListAttachmentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.ListAttachmentsResponse} ListAttachmentsResponse - */ - ListAttachmentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.ListAttachmentsResponse) - return object; - var message = new $root.google.cloud.support.v2.ListAttachmentsResponse(); - if (object.attachments) { - if (!Array.isArray(object.attachments)) - throw TypeError(".google.cloud.support.v2.ListAttachmentsResponse.attachments: array expected"); - message.attachments = []; - for (var i = 0; i < object.attachments.length; ++i) { - if (typeof object.attachments[i] !== "object") - throw TypeError(".google.cloud.support.v2.ListAttachmentsResponse.attachments: object expected"); - message.attachments[i] = $root.google.cloud.support.v2.Attachment.fromObject(object.attachments[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAttachmentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.ListAttachmentsResponse - * @static - * @param {google.cloud.support.v2.ListAttachmentsResponse} message ListAttachmentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAttachmentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attachments = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.attachments && message.attachments.length) { - object.attachments = []; - for (var j = 0; j < message.attachments.length; ++j) - object.attachments[j] = $root.google.cloud.support.v2.Attachment.toObject(message.attachments[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAttachmentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.ListAttachmentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListAttachmentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAttachmentsResponse - * @function getTypeUrl - * @memberof google.cloud.support.v2.ListAttachmentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAttachmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.ListAttachmentsResponse"; - }; - - return ListAttachmentsResponse; - })(); - - v2.Case = (function() { - - /** - * Properties of a Case. - * @memberof google.cloud.support.v2 - * @interface ICase - * @property {string|null} [name] Case name - * @property {string|null} [displayName] Case displayName - * @property {string|null} [description] Case description - * @property {google.cloud.support.v2.ICaseClassification|null} [classification] Case classification - * @property {string|null} [timeZone] Case timeZone - * @property {Array.|null} [subscriberEmailAddresses] Case subscriberEmailAddresses - * @property {google.cloud.support.v2.Case.State|null} [state] Case state - * @property {google.protobuf.ITimestamp|null} [createTime] Case createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Case updateTime - * @property {google.cloud.support.v2.IActor|null} [creator] Case creator - * @property {string|null} [contactEmail] Case contactEmail - * @property {boolean|null} [escalated] Case escalated - * @property {boolean|null} [testCase] Case testCase - * @property {string|null} [languageCode] Case languageCode - * @property {google.cloud.support.v2.Case.Priority|null} [priority] Case priority - */ - - /** - * Constructs a new Case. - * @memberof google.cloud.support.v2 - * @classdesc Represents a Case. - * @implements ICase - * @constructor - * @param {google.cloud.support.v2.ICase=} [properties] Properties to set - */ - function Case(properties) { - this.subscriberEmailAddresses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Case name. - * @member {string} name - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.name = ""; - - /** - * Case displayName. - * @member {string} displayName - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.displayName = ""; - - /** - * Case description. - * @member {string} description - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.description = ""; - - /** - * Case classification. - * @member {google.cloud.support.v2.ICaseClassification|null|undefined} classification - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.classification = null; - - /** - * Case timeZone. - * @member {string} timeZone - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.timeZone = ""; - - /** - * Case subscriberEmailAddresses. - * @member {Array.} subscriberEmailAddresses - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.subscriberEmailAddresses = $util.emptyArray; - - /** - * Case state. - * @member {google.cloud.support.v2.Case.State} state - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.state = 0; - - /** - * Case createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.createTime = null; - - /** - * Case updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.updateTime = null; - - /** - * Case creator. - * @member {google.cloud.support.v2.IActor|null|undefined} creator - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.creator = null; - - /** - * Case contactEmail. - * @member {string} contactEmail - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.contactEmail = ""; - - /** - * Case escalated. - * @member {boolean} escalated - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.escalated = false; - - /** - * Case testCase. - * @member {boolean} testCase - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.testCase = false; - - /** - * Case languageCode. - * @member {string} languageCode - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.languageCode = ""; - - /** - * Case priority. - * @member {google.cloud.support.v2.Case.Priority} priority - * @memberof google.cloud.support.v2.Case - * @instance - */ - Case.prototype.priority = 0; - - /** - * Creates a new Case instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.Case - * @static - * @param {google.cloud.support.v2.ICase=} [properties] Properties to set - * @returns {google.cloud.support.v2.Case} Case instance - */ - Case.create = function create(properties) { - return new Case(properties); - }; - - /** - * Encodes the specified Case message. Does not implicitly {@link google.cloud.support.v2.Case.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.Case - * @static - * @param {google.cloud.support.v2.ICase} message Case message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Case.encode = function encode(message, writer) { - if (!writer) - 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.classification != null && Object.hasOwnProperty.call(message, "classification")) - $root.google.cloud.support.v2.CaseClassification.encode(message.classification, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.timeZone); - if (message.subscriberEmailAddresses != null && message.subscriberEmailAddresses.length) - for (var i = 0; i < message.subscriberEmailAddresses.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.subscriberEmailAddresses[i]); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - $root.google.cloud.support.v2.Actor.encode(message.creator, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.escalated != null && Object.hasOwnProperty.call(message, "escalated")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.escalated); - if (message.testCase != null && Object.hasOwnProperty.call(message, "testCase")) - writer.uint32(/* id 19, wireType 0 =*/152).bool(message.testCase); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 23, wireType 2 =*/186).string(message.languageCode); - if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) - writer.uint32(/* id 32, wireType 0 =*/256).int32(message.priority); - if (message.contactEmail != null && Object.hasOwnProperty.call(message, "contactEmail")) - writer.uint32(/* id 35, wireType 2 =*/282).string(message.contactEmail); - return writer; - }; - - /** - * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.support.v2.Case.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.Case - * @static - * @param {google.cloud.support.v2.ICase} message Case message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Case.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Case message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.Case - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.Case} Case - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Case.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Case(); - while (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.classification = $root.google.cloud.support.v2.CaseClassification.decode(reader, reader.uint32()); - break; - } - case 8: { - message.timeZone = reader.string(); - break; - } - case 9: { - if (!(message.subscriberEmailAddresses && message.subscriberEmailAddresses.length)) - message.subscriberEmailAddresses = []; - message.subscriberEmailAddresses.push(reader.string()); - break; - } - case 12: { - message.state = reader.int32(); - break; - } - case 13: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 15: { - message.creator = $root.google.cloud.support.v2.Actor.decode(reader, reader.uint32()); - break; - } - case 35: { - message.contactEmail = reader.string(); - break; - } - case 17: { - message.escalated = reader.bool(); - break; - } - case 19: { - message.testCase = reader.bool(); - break; - } - case 23: { - message.languageCode = reader.string(); - break; - } - case 32: { - message.priority = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Case message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.Case - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.Case} Case - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Case.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Case message. - * @function verify - * @memberof google.cloud.support.v2.Case - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Case.verify = function verify(message) { - if (typeof message !== "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.classification != null && message.hasOwnProperty("classification")) { - var error = $root.google.cloud.support.v2.CaseClassification.verify(message.classification); - if (error) - return "classification." + error; - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - if (message.subscriberEmailAddresses != null && message.hasOwnProperty("subscriberEmailAddresses")) { - if (!Array.isArray(message.subscriberEmailAddresses)) - return "subscriberEmailAddresses: array expected"; - for (var i = 0; i < message.subscriberEmailAddresses.length; ++i) - if (!$util.isString(message.subscriberEmailAddresses[i])) - return "subscriberEmailAddresses: string[] expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - 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.creator != null && message.hasOwnProperty("creator")) { - var error = $root.google.cloud.support.v2.Actor.verify(message.creator); - if (error) - return "creator." + error; - } - if (message.contactEmail != null && message.hasOwnProperty("contactEmail")) - if (!$util.isString(message.contactEmail)) - return "contactEmail: string expected"; - if (message.escalated != null && message.hasOwnProperty("escalated")) - if (typeof message.escalated !== "boolean") - return "escalated: boolean expected"; - if (message.testCase != null && message.hasOwnProperty("testCase")) - if (typeof message.testCase !== "boolean") - return "testCase: boolean expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.priority != null && message.hasOwnProperty("priority")) - switch (message.priority) { - default: - return "priority: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; - - /** - * Creates a Case message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.Case - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.Case} Case - */ - Case.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.Case) - return object; - var message = new $root.google.cloud.support.v2.Case(); - 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.classification != null) { - if (typeof object.classification !== "object") - throw TypeError(".google.cloud.support.v2.Case.classification: object expected"); - message.classification = $root.google.cloud.support.v2.CaseClassification.fromObject(object.classification); - } - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - if (object.subscriberEmailAddresses) { - if (!Array.isArray(object.subscriberEmailAddresses)) - throw TypeError(".google.cloud.support.v2.Case.subscriberEmailAddresses: array expected"); - message.subscriberEmailAddresses = []; - for (var i = 0; i < object.subscriberEmailAddresses.length; ++i) - message.subscriberEmailAddresses[i] = String(object.subscriberEmailAddresses[i]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "NEW": - case 1: - message.state = 1; - break; - case "IN_PROGRESS_GOOGLE_SUPPORT": - case 2: - message.state = 2; - break; - case "ACTION_REQUIRED": - case 3: - message.state = 3; - break; - case "SOLUTION_PROVIDED": - case 4: - message.state = 4; - break; - case "CLOSED": - case 5: - message.state = 5; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.support.v2.Case.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.support.v2.Case.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.creator != null) { - if (typeof object.creator !== "object") - throw TypeError(".google.cloud.support.v2.Case.creator: object expected"); - message.creator = $root.google.cloud.support.v2.Actor.fromObject(object.creator); - } - if (object.contactEmail != null) - message.contactEmail = String(object.contactEmail); - if (object.escalated != null) - message.escalated = Boolean(object.escalated); - if (object.testCase != null) - message.testCase = Boolean(object.testCase); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - switch (object.priority) { - default: - if (typeof object.priority === "number") { - message.priority = object.priority; - break; - } - break; - case "PRIORITY_UNSPECIFIED": - case 0: - message.priority = 0; - break; - case "P0": - case 1: - message.priority = 1; - break; - case "P1": - case 2: - message.priority = 2; - break; - case "P2": - case 3: - message.priority = 3; - break; - case "P3": - case 4: - message.priority = 4; - break; - case "P4": - case 5: - message.priority = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from a Case message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.Case - * @static - * @param {google.cloud.support.v2.Case} message Case - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Case.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.subscriberEmailAddresses = []; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.classification = null; - object.timeZone = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - object.creator = null; - object.escalated = false; - object.testCase = false; - object.languageCode = ""; - object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; - object.contactEmail = ""; - } - 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.classification != null && message.hasOwnProperty("classification")) - object.classification = $root.google.cloud.support.v2.CaseClassification.toObject(message.classification, options); - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - if (message.subscriberEmailAddresses && message.subscriberEmailAddresses.length) { - object.subscriberEmailAddresses = []; - for (var j = 0; j < message.subscriberEmailAddresses.length; ++j) - object.subscriberEmailAddresses[j] = message.subscriberEmailAddresses[j]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.support.v2.Case.State[message.state] === undefined ? message.state : $root.google.cloud.support.v2.Case.State[message.state] : message.state; - 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.creator != null && message.hasOwnProperty("creator")) - object.creator = $root.google.cloud.support.v2.Actor.toObject(message.creator, options); - if (message.escalated != null && message.hasOwnProperty("escalated")) - object.escalated = message.escalated; - if (message.testCase != null && message.hasOwnProperty("testCase")) - object.testCase = message.testCase; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.priority != null && message.hasOwnProperty("priority")) - object.priority = options.enums === String ? $root.google.cloud.support.v2.Case.Priority[message.priority] === undefined ? message.priority : $root.google.cloud.support.v2.Case.Priority[message.priority] : message.priority; - if (message.contactEmail != null && message.hasOwnProperty("contactEmail")) - object.contactEmail = message.contactEmail; - return object; - }; - - /** - * Converts this Case to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.Case - * @instance - * @returns {Object.} JSON object - */ - Case.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Case - * @function getTypeUrl - * @memberof google.cloud.support.v2.Case - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Case.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.Case"; - }; - - /** - * State enum. - * @name google.cloud.support.v2.Case.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} NEW=1 NEW value - * @property {number} IN_PROGRESS_GOOGLE_SUPPORT=2 IN_PROGRESS_GOOGLE_SUPPORT value - * @property {number} ACTION_REQUIRED=3 ACTION_REQUIRED value - * @property {number} SOLUTION_PROVIDED=4 SOLUTION_PROVIDED value - * @property {number} CLOSED=5 CLOSED value - */ - Case.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NEW"] = 1; - values[valuesById[2] = "IN_PROGRESS_GOOGLE_SUPPORT"] = 2; - values[valuesById[3] = "ACTION_REQUIRED"] = 3; - values[valuesById[4] = "SOLUTION_PROVIDED"] = 4; - values[valuesById[5] = "CLOSED"] = 5; - return values; - })(); - - /** - * Priority enum. - * @name google.cloud.support.v2.Case.Priority - * @enum {number} - * @property {number} PRIORITY_UNSPECIFIED=0 PRIORITY_UNSPECIFIED value - * @property {number} P0=1 P0 value - * @property {number} P1=2 P1 value - * @property {number} P2=3 P2 value - * @property {number} P3=4 P3 value - * @property {number} P4=5 P4 value - */ - Case.Priority = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PRIORITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "P0"] = 1; - values[valuesById[2] = "P1"] = 2; - values[valuesById[3] = "P2"] = 3; - values[valuesById[4] = "P3"] = 4; - values[valuesById[5] = "P4"] = 5; - return values; - })(); - - return Case; - })(); - - v2.CaseClassification = (function() { - - /** - * Properties of a CaseClassification. - * @memberof google.cloud.support.v2 - * @interface ICaseClassification - * @property {string|null} [id] CaseClassification id - * @property {string|null} [displayName] CaseClassification displayName - */ - - /** - * Constructs a new CaseClassification. - * @memberof google.cloud.support.v2 - * @classdesc Represents a CaseClassification. - * @implements ICaseClassification - * @constructor - * @param {google.cloud.support.v2.ICaseClassification=} [properties] Properties to set - */ - function CaseClassification(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CaseClassification id. - * @member {string} id - * @memberof google.cloud.support.v2.CaseClassification - * @instance - */ - CaseClassification.prototype.id = ""; - - /** - * CaseClassification displayName. - * @member {string} displayName - * @memberof google.cloud.support.v2.CaseClassification - * @instance - */ - CaseClassification.prototype.displayName = ""; - - /** - * Creates a new CaseClassification instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.CaseClassification - * @static - * @param {google.cloud.support.v2.ICaseClassification=} [properties] Properties to set - * @returns {google.cloud.support.v2.CaseClassification} CaseClassification instance - */ - CaseClassification.create = function create(properties) { - return new CaseClassification(properties); - }; - - /** - * Encodes the specified CaseClassification message. Does not implicitly {@link google.cloud.support.v2.CaseClassification.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.CaseClassification - * @static - * @param {google.cloud.support.v2.ICaseClassification} message CaseClassification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaseClassification.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified CaseClassification message, length delimited. Does not implicitly {@link google.cloud.support.v2.CaseClassification.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.CaseClassification - * @static - * @param {google.cloud.support.v2.ICaseClassification} message CaseClassification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaseClassification.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CaseClassification message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.CaseClassification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.CaseClassification} CaseClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaseClassification.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.CaseClassification(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.id = reader.string(); - break; - } - case 4: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CaseClassification message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.CaseClassification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.CaseClassification} CaseClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaseClassification.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CaseClassification message. - * @function verify - * @memberof google.cloud.support.v2.CaseClassification - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CaseClassification.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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"; - return null; - }; - - /** - * Creates a CaseClassification message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.CaseClassification - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.CaseClassification} CaseClassification - */ - CaseClassification.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.CaseClassification) - return object; - var message = new $root.google.cloud.support.v2.CaseClassification(); - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from a CaseClassification message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.CaseClassification - * @static - * @param {google.cloud.support.v2.CaseClassification} message CaseClassification - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CaseClassification.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.displayName = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this CaseClassification to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.CaseClassification - * @instance - * @returns {Object.} JSON object - */ - CaseClassification.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CaseClassification - * @function getTypeUrl - * @memberof google.cloud.support.v2.CaseClassification - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CaseClassification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.CaseClassification"; - }; - - return CaseClassification; - })(); - - v2.CaseService = (function() { - - /** - * Constructs a new CaseService service. - * @memberof google.cloud.support.v2 - * @classdesc Represents a CaseService - * @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 CaseService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CaseService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CaseService; - - /** - * Creates new CaseService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.support.v2.CaseService - * @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 {CaseService} RPC service. Useful where requests and/or responses are streamed. - */ - CaseService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|getCase}. - * @memberof google.cloud.support.v2.CaseService - * @typedef GetCaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2.Case} [response] Case - */ - - /** - * Calls GetCase. - * @function getCase - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.IGetCaseRequest} request GetCaseRequest message or plain object - * @param {google.cloud.support.v2.CaseService.GetCaseCallback} callback Node-style callback called with the error, if any, and Case - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.getCase = function getCase(request, callback) { - return this.rpcCall(getCase, $root.google.cloud.support.v2.GetCaseRequest, $root.google.cloud.support.v2.Case, request, callback); - }, "name", { value: "GetCase" }); - - /** - * Calls GetCase. - * @function getCase - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.IGetCaseRequest} request GetCaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|listCases}. - * @memberof google.cloud.support.v2.CaseService - * @typedef ListCasesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2.ListCasesResponse} [response] ListCasesResponse - */ - - /** - * Calls ListCases. - * @function listCases - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.IListCasesRequest} request ListCasesRequest message or plain object - * @param {google.cloud.support.v2.CaseService.ListCasesCallback} callback Node-style callback called with the error, if any, and ListCasesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.listCases = function listCases(request, callback) { - return this.rpcCall(listCases, $root.google.cloud.support.v2.ListCasesRequest, $root.google.cloud.support.v2.ListCasesResponse, request, callback); - }, "name", { value: "ListCases" }); - - /** - * Calls ListCases. - * @function listCases - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.IListCasesRequest} request ListCasesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|searchCases}. - * @memberof google.cloud.support.v2.CaseService - * @typedef SearchCasesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2.SearchCasesResponse} [response] SearchCasesResponse - */ - - /** - * Calls SearchCases. - * @function searchCases - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.ISearchCasesRequest} request SearchCasesRequest message or plain object - * @param {google.cloud.support.v2.CaseService.SearchCasesCallback} callback Node-style callback called with the error, if any, and SearchCasesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.searchCases = function searchCases(request, callback) { - return this.rpcCall(searchCases, $root.google.cloud.support.v2.SearchCasesRequest, $root.google.cloud.support.v2.SearchCasesResponse, request, callback); - }, "name", { value: "SearchCases" }); - - /** - * Calls SearchCases. - * @function searchCases - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.ISearchCasesRequest} request SearchCasesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|createCase}. - * @memberof google.cloud.support.v2.CaseService - * @typedef CreateCaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2.Case} [response] Case - */ - - /** - * Calls CreateCase. - * @function createCase - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.ICreateCaseRequest} request CreateCaseRequest message or plain object - * @param {google.cloud.support.v2.CaseService.CreateCaseCallback} callback Node-style callback called with the error, if any, and Case - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.createCase = function createCase(request, callback) { - return this.rpcCall(createCase, $root.google.cloud.support.v2.CreateCaseRequest, $root.google.cloud.support.v2.Case, request, callback); - }, "name", { value: "CreateCase" }); - - /** - * Calls CreateCase. - * @function createCase - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.ICreateCaseRequest} request CreateCaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|updateCase}. - * @memberof google.cloud.support.v2.CaseService - * @typedef UpdateCaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2.Case} [response] Case - */ - - /** - * Calls UpdateCase. - * @function updateCase - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.IUpdateCaseRequest} request UpdateCaseRequest message or plain object - * @param {google.cloud.support.v2.CaseService.UpdateCaseCallback} callback Node-style callback called with the error, if any, and Case - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.updateCase = function updateCase(request, callback) { - return this.rpcCall(updateCase, $root.google.cloud.support.v2.UpdateCaseRequest, $root.google.cloud.support.v2.Case, request, callback); - }, "name", { value: "UpdateCase" }); - - /** - * Calls UpdateCase. - * @function updateCase - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.IUpdateCaseRequest} request UpdateCaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|escalateCase}. - * @memberof google.cloud.support.v2.CaseService - * @typedef EscalateCaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2.Case} [response] Case - */ - - /** - * Calls EscalateCase. - * @function escalateCase - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.IEscalateCaseRequest} request EscalateCaseRequest message or plain object - * @param {google.cloud.support.v2.CaseService.EscalateCaseCallback} callback Node-style callback called with the error, if any, and Case - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.escalateCase = function escalateCase(request, callback) { - return this.rpcCall(escalateCase, $root.google.cloud.support.v2.EscalateCaseRequest, $root.google.cloud.support.v2.Case, request, callback); - }, "name", { value: "EscalateCase" }); - - /** - * Calls EscalateCase. - * @function escalateCase - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.IEscalateCaseRequest} request EscalateCaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|closeCase}. - * @memberof google.cloud.support.v2.CaseService - * @typedef CloseCaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2.Case} [response] Case - */ - - /** - * Calls CloseCase. - * @function closeCase - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.ICloseCaseRequest} request CloseCaseRequest message or plain object - * @param {google.cloud.support.v2.CaseService.CloseCaseCallback} callback Node-style callback called with the error, if any, and Case - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.closeCase = function closeCase(request, callback) { - return this.rpcCall(closeCase, $root.google.cloud.support.v2.CloseCaseRequest, $root.google.cloud.support.v2.Case, request, callback); - }, "name", { value: "CloseCase" }); - - /** - * Calls CloseCase. - * @function closeCase - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.ICloseCaseRequest} request CloseCaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2.CaseService|searchCaseClassifications}. - * @memberof google.cloud.support.v2.CaseService - * @typedef SearchCaseClassificationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2.SearchCaseClassificationsResponse} [response] SearchCaseClassificationsResponse - */ - - /** - * Calls SearchCaseClassifications. - * @function searchCaseClassifications - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest} request SearchCaseClassificationsRequest message or plain object - * @param {google.cloud.support.v2.CaseService.SearchCaseClassificationsCallback} callback Node-style callback called with the error, if any, and SearchCaseClassificationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.searchCaseClassifications = function searchCaseClassifications(request, callback) { - return this.rpcCall(searchCaseClassifications, $root.google.cloud.support.v2.SearchCaseClassificationsRequest, $root.google.cloud.support.v2.SearchCaseClassificationsResponse, request, callback); - }, "name", { value: "SearchCaseClassifications" }); - - /** - * Calls SearchCaseClassifications. - * @function searchCaseClassifications - * @memberof google.cloud.support.v2.CaseService - * @instance - * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest} request SearchCaseClassificationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CaseService; - })(); - - v2.GetCaseRequest = (function() { - - /** - * Properties of a GetCaseRequest. - * @memberof google.cloud.support.v2 - * @interface IGetCaseRequest - * @property {string|null} [name] GetCaseRequest name - */ - - /** - * Constructs a new GetCaseRequest. - * @memberof google.cloud.support.v2 - * @classdesc Represents a GetCaseRequest. - * @implements IGetCaseRequest - * @constructor - * @param {google.cloud.support.v2.IGetCaseRequest=} [properties] Properties to set - */ - function GetCaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCaseRequest name. - * @member {string} name - * @memberof google.cloud.support.v2.GetCaseRequest - * @instance - */ - GetCaseRequest.prototype.name = ""; - - /** - * Creates a new GetCaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.GetCaseRequest - * @static - * @param {google.cloud.support.v2.IGetCaseRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2.GetCaseRequest} GetCaseRequest instance - */ - GetCaseRequest.create = function create(properties) { - return new GetCaseRequest(properties); - }; - - /** - * Encodes the specified GetCaseRequest message. Does not implicitly {@link google.cloud.support.v2.GetCaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.GetCaseRequest - * @static - * @param {google.cloud.support.v2.IGetCaseRequest} message GetCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCaseRequest.encode = function encode(message, writer) { - 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 GetCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.GetCaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.GetCaseRequest - * @static - * @param {google.cloud.support.v2.IGetCaseRequest} message GetCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.GetCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.GetCaseRequest} GetCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.GetCaseRequest(); - 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 GetCaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.GetCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.GetCaseRequest} GetCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCaseRequest message. - * @function verify - * @memberof google.cloud.support.v2.GetCaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCaseRequest.verify = function verify(message) { - if (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 GetCaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.GetCaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.GetCaseRequest} GetCaseRequest - */ - GetCaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.GetCaseRequest) - return object; - var message = new $root.google.cloud.support.v2.GetCaseRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetCaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.GetCaseRequest - * @static - * @param {google.cloud.support.v2.GetCaseRequest} message GetCaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCaseRequest.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 GetCaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.GetCaseRequest - * @instance - * @returns {Object.} JSON object - */ - GetCaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCaseRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2.GetCaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.GetCaseRequest"; - }; - - return GetCaseRequest; - })(); - - v2.CreateCaseRequest = (function() { - - /** - * Properties of a CreateCaseRequest. - * @memberof google.cloud.support.v2 - * @interface ICreateCaseRequest - * @property {string|null} [parent] CreateCaseRequest parent - * @property {google.cloud.support.v2.ICase|null} ["case"] CreateCaseRequest case - */ - - /** - * Constructs a new CreateCaseRequest. - * @memberof google.cloud.support.v2 - * @classdesc Represents a CreateCaseRequest. - * @implements ICreateCaseRequest - * @constructor - * @param {google.cloud.support.v2.ICreateCaseRequest=} [properties] Properties to set - */ - function CreateCaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateCaseRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2.CreateCaseRequest - * @instance - */ - CreateCaseRequest.prototype.parent = ""; - - /** - * CreateCaseRequest case. - * @member {google.cloud.support.v2.ICase|null|undefined} case - * @memberof google.cloud.support.v2.CreateCaseRequest - * @instance - */ - CreateCaseRequest.prototype["case"] = null; - - /** - * Creates a new CreateCaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.CreateCaseRequest - * @static - * @param {google.cloud.support.v2.ICreateCaseRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2.CreateCaseRequest} CreateCaseRequest instance - */ - CreateCaseRequest.create = function create(properties) { - return new CreateCaseRequest(properties); - }; - - /** - * Encodes the specified CreateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.CreateCaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.CreateCaseRequest - * @static - * @param {google.cloud.support.v2.ICreateCaseRequest} message CreateCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) - $root.google.cloud.support.v2.Case.encode(message["case"], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CreateCaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.CreateCaseRequest - * @static - * @param {google.cloud.support.v2.ICreateCaseRequest} message CreateCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.CreateCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.CreateCaseRequest} CreateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.CreateCaseRequest(); - 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["case"] = $root.google.cloud.support.v2.Case.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.CreateCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.CreateCaseRequest} CreateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCaseRequest message. - * @function verify - * @memberof google.cloud.support.v2.CreateCaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message["case"] != null && message.hasOwnProperty("case")) { - var error = $root.google.cloud.support.v2.Case.verify(message["case"]); - if (error) - return "case." + error; - } - return null; - }; - - /** - * Creates a CreateCaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.CreateCaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.CreateCaseRequest} CreateCaseRequest - */ - CreateCaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.CreateCaseRequest) - return object; - var message = new $root.google.cloud.support.v2.CreateCaseRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object["case"] != null) { - if (typeof object["case"] !== "object") - throw TypeError(".google.cloud.support.v2.CreateCaseRequest.case: object expected"); - message["case"] = $root.google.cloud.support.v2.Case.fromObject(object["case"]); - } - return message; - }; - - /** - * Creates a plain object from a CreateCaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.CreateCaseRequest - * @static - * @param {google.cloud.support.v2.CreateCaseRequest} message CreateCaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object["case"] = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message["case"] != null && message.hasOwnProperty("case")) - object["case"] = $root.google.cloud.support.v2.Case.toObject(message["case"], options); - return object; - }; - - /** - * Converts this CreateCaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.CreateCaseRequest - * @instance - * @returns {Object.} JSON object - */ - CreateCaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCaseRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2.CreateCaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.CreateCaseRequest"; - }; - - return CreateCaseRequest; - })(); - - v2.ListCasesRequest = (function() { - - /** - * Properties of a ListCasesRequest. - * @memberof google.cloud.support.v2 - * @interface IListCasesRequest - * @property {string|null} [parent] ListCasesRequest parent - * @property {string|null} [filter] ListCasesRequest filter - * @property {number|null} [pageSize] ListCasesRequest pageSize - * @property {string|null} [pageToken] ListCasesRequest pageToken - */ - - /** - * Constructs a new ListCasesRequest. - * @memberof google.cloud.support.v2 - * @classdesc Represents a ListCasesRequest. - * @implements IListCasesRequest - * @constructor - * @param {google.cloud.support.v2.IListCasesRequest=} [properties] Properties to set - */ - function ListCasesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCasesRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2.ListCasesRequest - * @instance - */ - ListCasesRequest.prototype.parent = ""; - - /** - * ListCasesRequest filter. - * @member {string} filter - * @memberof google.cloud.support.v2.ListCasesRequest - * @instance - */ - ListCasesRequest.prototype.filter = ""; - - /** - * ListCasesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.support.v2.ListCasesRequest - * @instance - */ - ListCasesRequest.prototype.pageSize = 0; - - /** - * ListCasesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.support.v2.ListCasesRequest - * @instance - */ - ListCasesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListCasesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.ListCasesRequest - * @static - * @param {google.cloud.support.v2.IListCasesRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2.ListCasesRequest} ListCasesRequest instance - */ - ListCasesRequest.create = function create(properties) { - return new ListCasesRequest(properties); - }; - - /** - * Encodes the specified ListCasesRequest message. Does not implicitly {@link google.cloud.support.v2.ListCasesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.ListCasesRequest - * @static - * @param {google.cloud.support.v2.IListCasesRequest} message ListCasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCasesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCasesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.ListCasesRequest - * @static - * @param {google.cloud.support.v2.IListCasesRequest} message ListCasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCasesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.ListCasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.ListCasesRequest} ListCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCasesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListCasesRequest(); - 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.filter = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCasesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.ListCasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.ListCasesRequest} ListCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCasesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCasesRequest message. - * @function verify - * @memberof google.cloud.support.v2.ListCasesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCasesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: 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 ListCasesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.ListCasesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.ListCasesRequest} ListCasesRequest - */ - ListCasesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.ListCasesRequest) - return object; - var message = new $root.google.cloud.support.v2.ListCasesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - 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 ListCasesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.ListCasesRequest - * @static - * @param {google.cloud.support.v2.ListCasesRequest} message ListCasesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCasesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - 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; - return object; - }; - - /** - * Converts this ListCasesRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.ListCasesRequest - * @instance - * @returns {Object.} JSON object - */ - ListCasesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCasesRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2.ListCasesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.ListCasesRequest"; - }; - - return ListCasesRequest; - })(); - - v2.ListCasesResponse = (function() { - - /** - * Properties of a ListCasesResponse. - * @memberof google.cloud.support.v2 - * @interface IListCasesResponse - * @property {Array.|null} [cases] ListCasesResponse cases - * @property {string|null} [nextPageToken] ListCasesResponse nextPageToken - */ - - /** - * Constructs a new ListCasesResponse. - * @memberof google.cloud.support.v2 - * @classdesc Represents a ListCasesResponse. - * @implements IListCasesResponse - * @constructor - * @param {google.cloud.support.v2.IListCasesResponse=} [properties] Properties to set - */ - function ListCasesResponse(properties) { - this.cases = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCasesResponse cases. - * @member {Array.} cases - * @memberof google.cloud.support.v2.ListCasesResponse - * @instance - */ - ListCasesResponse.prototype.cases = $util.emptyArray; - - /** - * ListCasesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.support.v2.ListCasesResponse - * @instance - */ - ListCasesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListCasesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.ListCasesResponse - * @static - * @param {google.cloud.support.v2.IListCasesResponse=} [properties] Properties to set - * @returns {google.cloud.support.v2.ListCasesResponse} ListCasesResponse instance - */ - ListCasesResponse.create = function create(properties) { - return new ListCasesResponse(properties); - }; - - /** - * Encodes the specified ListCasesResponse message. Does not implicitly {@link google.cloud.support.v2.ListCasesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.ListCasesResponse - * @static - * @param {google.cloud.support.v2.IListCasesResponse} message ListCasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCasesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cases != null && message.cases.length) - for (var i = 0; i < message.cases.length; ++i) - $root.google.cloud.support.v2.Case.encode(message.cases[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 ListCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCasesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.ListCasesResponse - * @static - * @param {google.cloud.support.v2.IListCasesResponse} message ListCasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCasesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.ListCasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.ListCasesResponse} ListCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCasesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListCasesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.cases && message.cases.length)) - message.cases = []; - message.cases.push($root.google.cloud.support.v2.Case.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCasesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.ListCasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.ListCasesResponse} ListCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCasesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCasesResponse message. - * @function verify - * @memberof google.cloud.support.v2.ListCasesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCasesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cases != null && message.hasOwnProperty("cases")) { - if (!Array.isArray(message.cases)) - return "cases: array expected"; - for (var i = 0; i < message.cases.length; ++i) { - var error = $root.google.cloud.support.v2.Case.verify(message.cases[i]); - if (error) - return "cases." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListCasesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.ListCasesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.ListCasesResponse} ListCasesResponse - */ - ListCasesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.ListCasesResponse) - return object; - var message = new $root.google.cloud.support.v2.ListCasesResponse(); - if (object.cases) { - if (!Array.isArray(object.cases)) - throw TypeError(".google.cloud.support.v2.ListCasesResponse.cases: array expected"); - message.cases = []; - for (var i = 0; i < object.cases.length; ++i) { - if (typeof object.cases[i] !== "object") - throw TypeError(".google.cloud.support.v2.ListCasesResponse.cases: object expected"); - message.cases[i] = $root.google.cloud.support.v2.Case.fromObject(object.cases[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListCasesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.ListCasesResponse - * @static - * @param {google.cloud.support.v2.ListCasesResponse} message ListCasesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCasesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.cases = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.cases && message.cases.length) { - object.cases = []; - for (var j = 0; j < message.cases.length; ++j) - object.cases[j] = $root.google.cloud.support.v2.Case.toObject(message.cases[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListCasesResponse to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.ListCasesResponse - * @instance - * @returns {Object.} JSON object - */ - ListCasesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCasesResponse - * @function getTypeUrl - * @memberof google.cloud.support.v2.ListCasesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.ListCasesResponse"; - }; - - return ListCasesResponse; - })(); - - v2.SearchCasesRequest = (function() { - - /** - * Properties of a SearchCasesRequest. - * @memberof google.cloud.support.v2 - * @interface ISearchCasesRequest - * @property {string|null} [parent] SearchCasesRequest parent - * @property {string|null} [query] SearchCasesRequest query - * @property {number|null} [pageSize] SearchCasesRequest pageSize - * @property {string|null} [pageToken] SearchCasesRequest pageToken - */ - - /** - * Constructs a new SearchCasesRequest. - * @memberof google.cloud.support.v2 - * @classdesc Represents a SearchCasesRequest. - * @implements ISearchCasesRequest - * @constructor - * @param {google.cloud.support.v2.ISearchCasesRequest=} [properties] Properties to set - */ - function SearchCasesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SearchCasesRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2.SearchCasesRequest - * @instance - */ - SearchCasesRequest.prototype.parent = ""; - - /** - * SearchCasesRequest query. - * @member {string} query - * @memberof google.cloud.support.v2.SearchCasesRequest - * @instance - */ - SearchCasesRequest.prototype.query = ""; - - /** - * SearchCasesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.support.v2.SearchCasesRequest - * @instance - */ - SearchCasesRequest.prototype.pageSize = 0; - - /** - * SearchCasesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.support.v2.SearchCasesRequest - * @instance - */ - SearchCasesRequest.prototype.pageToken = ""; - - /** - * Creates a new SearchCasesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.SearchCasesRequest - * @static - * @param {google.cloud.support.v2.ISearchCasesRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2.SearchCasesRequest} SearchCasesRequest instance - */ - SearchCasesRequest.create = function create(properties) { - return new SearchCasesRequest(properties); - }; - - /** - * Encodes the specified SearchCasesRequest message. Does not implicitly {@link google.cloud.support.v2.SearchCasesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.SearchCasesRequest - * @static - * @param {google.cloud.support.v2.ISearchCasesRequest} message SearchCasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCasesRequest.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.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.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); - return writer; - }; - - /** - * Encodes the specified SearchCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCasesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.SearchCasesRequest - * @static - * @param {google.cloud.support.v2.ISearchCasesRequest} message SearchCasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchCasesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.SearchCasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.SearchCasesRequest} SearchCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCasesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.SearchCasesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.parent = reader.string(); - break; - } - case 1: { - message.query = 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 SearchCasesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.SearchCasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.SearchCasesRequest} SearchCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCasesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchCasesRequest message. - * @function verify - * @memberof google.cloud.support.v2.SearchCasesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchCasesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: 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 SearchCasesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.SearchCasesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.SearchCasesRequest} SearchCasesRequest - */ - SearchCasesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.SearchCasesRequest) - return object; - var message = new $root.google.cloud.support.v2.SearchCasesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.query != null) - message.query = String(object.query); - 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 SearchCasesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.SearchCasesRequest - * @static - * @param {google.cloud.support.v2.SearchCasesRequest} message SearchCasesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchCasesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.query = ""; - object.pageSize = 0; - object.pageToken = ""; - object.parent = ""; - } - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - return object; - }; - - /** - * Converts this SearchCasesRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.SearchCasesRequest - * @instance - * @returns {Object.} JSON object - */ - SearchCasesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchCasesRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2.SearchCasesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.SearchCasesRequest"; - }; - - return SearchCasesRequest; - })(); - - v2.SearchCasesResponse = (function() { - - /** - * Properties of a SearchCasesResponse. - * @memberof google.cloud.support.v2 - * @interface ISearchCasesResponse - * @property {Array.|null} [cases] SearchCasesResponse cases - * @property {string|null} [nextPageToken] SearchCasesResponse nextPageToken - */ - - /** - * Constructs a new SearchCasesResponse. - * @memberof google.cloud.support.v2 - * @classdesc Represents a SearchCasesResponse. - * @implements ISearchCasesResponse - * @constructor - * @param {google.cloud.support.v2.ISearchCasesResponse=} [properties] Properties to set - */ - function SearchCasesResponse(properties) { - this.cases = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SearchCasesResponse cases. - * @member {Array.} cases - * @memberof google.cloud.support.v2.SearchCasesResponse - * @instance - */ - SearchCasesResponse.prototype.cases = $util.emptyArray; - - /** - * SearchCasesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.support.v2.SearchCasesResponse - * @instance - */ - SearchCasesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new SearchCasesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.SearchCasesResponse - * @static - * @param {google.cloud.support.v2.ISearchCasesResponse=} [properties] Properties to set - * @returns {google.cloud.support.v2.SearchCasesResponse} SearchCasesResponse instance - */ - SearchCasesResponse.create = function create(properties) { - return new SearchCasesResponse(properties); - }; - - /** - * Encodes the specified SearchCasesResponse message. Does not implicitly {@link google.cloud.support.v2.SearchCasesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.SearchCasesResponse - * @static - * @param {google.cloud.support.v2.ISearchCasesResponse} message SearchCasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCasesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cases != null && message.cases.length) - for (var i = 0; i < message.cases.length; ++i) - $root.google.cloud.support.v2.Case.encode(message.cases[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 SearchCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCasesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.SearchCasesResponse - * @static - * @param {google.cloud.support.v2.ISearchCasesResponse} message SearchCasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchCasesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.SearchCasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.SearchCasesResponse} SearchCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCasesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.SearchCasesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.cases && message.cases.length)) - message.cases = []; - message.cases.push($root.google.cloud.support.v2.Case.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchCasesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.SearchCasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.SearchCasesResponse} SearchCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCasesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchCasesResponse message. - * @function verify - * @memberof google.cloud.support.v2.SearchCasesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchCasesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cases != null && message.hasOwnProperty("cases")) { - if (!Array.isArray(message.cases)) - return "cases: array expected"; - for (var i = 0; i < message.cases.length; ++i) { - var error = $root.google.cloud.support.v2.Case.verify(message.cases[i]); - if (error) - return "cases." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a SearchCasesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.SearchCasesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.SearchCasesResponse} SearchCasesResponse - */ - SearchCasesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.SearchCasesResponse) - return object; - var message = new $root.google.cloud.support.v2.SearchCasesResponse(); - if (object.cases) { - if (!Array.isArray(object.cases)) - throw TypeError(".google.cloud.support.v2.SearchCasesResponse.cases: array expected"); - message.cases = []; - for (var i = 0; i < object.cases.length; ++i) { - if (typeof object.cases[i] !== "object") - throw TypeError(".google.cloud.support.v2.SearchCasesResponse.cases: object expected"); - message.cases[i] = $root.google.cloud.support.v2.Case.fromObject(object.cases[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a SearchCasesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.SearchCasesResponse - * @static - * @param {google.cloud.support.v2.SearchCasesResponse} message SearchCasesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchCasesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.cases = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.cases && message.cases.length) { - object.cases = []; - for (var j = 0; j < message.cases.length; ++j) - object.cases[j] = $root.google.cloud.support.v2.Case.toObject(message.cases[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this SearchCasesResponse to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.SearchCasesResponse - * @instance - * @returns {Object.} JSON object - */ - SearchCasesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchCasesResponse - * @function getTypeUrl - * @memberof google.cloud.support.v2.SearchCasesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.SearchCasesResponse"; - }; - - return SearchCasesResponse; - })(); - - v2.EscalateCaseRequest = (function() { - - /** - * Properties of an EscalateCaseRequest. - * @memberof google.cloud.support.v2 - * @interface IEscalateCaseRequest - * @property {string|null} [name] EscalateCaseRequest name - * @property {google.cloud.support.v2.IEscalation|null} [escalation] EscalateCaseRequest escalation - */ - - /** - * Constructs a new EscalateCaseRequest. - * @memberof google.cloud.support.v2 - * @classdesc Represents an EscalateCaseRequest. - * @implements IEscalateCaseRequest - * @constructor - * @param {google.cloud.support.v2.IEscalateCaseRequest=} [properties] Properties to set - */ - function EscalateCaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EscalateCaseRequest name. - * @member {string} name - * @memberof google.cloud.support.v2.EscalateCaseRequest - * @instance - */ - EscalateCaseRequest.prototype.name = ""; - - /** - * EscalateCaseRequest escalation. - * @member {google.cloud.support.v2.IEscalation|null|undefined} escalation - * @memberof google.cloud.support.v2.EscalateCaseRequest - * @instance - */ - EscalateCaseRequest.prototype.escalation = null; - - /** - * Creates a new EscalateCaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.EscalateCaseRequest - * @static - * @param {google.cloud.support.v2.IEscalateCaseRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2.EscalateCaseRequest} EscalateCaseRequest instance - */ - EscalateCaseRequest.create = function create(properties) { - return new EscalateCaseRequest(properties); - }; - - /** - * Encodes the specified EscalateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.EscalateCaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.EscalateCaseRequest - * @static - * @param {google.cloud.support.v2.IEscalateCaseRequest} message EscalateCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EscalateCaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.escalation != null && Object.hasOwnProperty.call(message, "escalation")) - $root.google.cloud.support.v2.Escalation.encode(message.escalation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EscalateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.EscalateCaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.EscalateCaseRequest - * @static - * @param {google.cloud.support.v2.IEscalateCaseRequest} message EscalateCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EscalateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EscalateCaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.EscalateCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.EscalateCaseRequest} EscalateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EscalateCaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.EscalateCaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.escalation = $root.google.cloud.support.v2.Escalation.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EscalateCaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.EscalateCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.EscalateCaseRequest} EscalateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EscalateCaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EscalateCaseRequest message. - * @function verify - * @memberof google.cloud.support.v2.EscalateCaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EscalateCaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.escalation != null && message.hasOwnProperty("escalation")) { - var error = $root.google.cloud.support.v2.Escalation.verify(message.escalation); - if (error) - return "escalation." + error; - } - return null; - }; - - /** - * Creates an EscalateCaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.EscalateCaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.EscalateCaseRequest} EscalateCaseRequest - */ - EscalateCaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.EscalateCaseRequest) - return object; - var message = new $root.google.cloud.support.v2.EscalateCaseRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.escalation != null) { - if (typeof object.escalation !== "object") - throw TypeError(".google.cloud.support.v2.EscalateCaseRequest.escalation: object expected"); - message.escalation = $root.google.cloud.support.v2.Escalation.fromObject(object.escalation); - } - return message; - }; - - /** - * Creates a plain object from an EscalateCaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.EscalateCaseRequest - * @static - * @param {google.cloud.support.v2.EscalateCaseRequest} message EscalateCaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EscalateCaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.escalation = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.escalation != null && message.hasOwnProperty("escalation")) - object.escalation = $root.google.cloud.support.v2.Escalation.toObject(message.escalation, options); - return object; - }; - - /** - * Converts this EscalateCaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.EscalateCaseRequest - * @instance - * @returns {Object.} JSON object - */ - EscalateCaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EscalateCaseRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2.EscalateCaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EscalateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.EscalateCaseRequest"; - }; - - return EscalateCaseRequest; - })(); - - v2.UpdateCaseRequest = (function() { - - /** - * Properties of an UpdateCaseRequest. - * @memberof google.cloud.support.v2 - * @interface IUpdateCaseRequest - * @property {google.cloud.support.v2.ICase|null} ["case"] UpdateCaseRequest case - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCaseRequest updateMask - */ - - /** - * Constructs a new UpdateCaseRequest. - * @memberof google.cloud.support.v2 - * @classdesc Represents an UpdateCaseRequest. - * @implements IUpdateCaseRequest - * @constructor - * @param {google.cloud.support.v2.IUpdateCaseRequest=} [properties] Properties to set - */ - function UpdateCaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateCaseRequest case. - * @member {google.cloud.support.v2.ICase|null|undefined} case - * @memberof google.cloud.support.v2.UpdateCaseRequest - * @instance - */ - UpdateCaseRequest.prototype["case"] = null; - - /** - * UpdateCaseRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.support.v2.UpdateCaseRequest - * @instance - */ - UpdateCaseRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateCaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.UpdateCaseRequest - * @static - * @param {google.cloud.support.v2.IUpdateCaseRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2.UpdateCaseRequest} UpdateCaseRequest instance - */ - UpdateCaseRequest.create = function create(properties) { - return new UpdateCaseRequest(properties); - }; - - /** - * Encodes the specified UpdateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.UpdateCaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.UpdateCaseRequest - * @static - * @param {google.cloud.support.v2.IUpdateCaseRequest} message UpdateCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) - $root.google.cloud.support.v2.Case.encode(message["case"], 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 UpdateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.UpdateCaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.UpdateCaseRequest - * @static - * @param {google.cloud.support.v2.IUpdateCaseRequest} message UpdateCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.UpdateCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.UpdateCaseRequest} UpdateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.UpdateCaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message["case"] = $root.google.cloud.support.v2.Case.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 UpdateCaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.UpdateCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.UpdateCaseRequest} UpdateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCaseRequest message. - * @function verify - * @memberof google.cloud.support.v2.UpdateCaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message["case"] != null && message.hasOwnProperty("case")) { - var error = $root.google.cloud.support.v2.Case.verify(message["case"]); - if (error) - return "case." + 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 UpdateCaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.UpdateCaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.UpdateCaseRequest} UpdateCaseRequest - */ - UpdateCaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.UpdateCaseRequest) - return object; - var message = new $root.google.cloud.support.v2.UpdateCaseRequest(); - if (object["case"] != null) { - if (typeof object["case"] !== "object") - throw TypeError(".google.cloud.support.v2.UpdateCaseRequest.case: object expected"); - message["case"] = $root.google.cloud.support.v2.Case.fromObject(object["case"]); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.support.v2.UpdateCaseRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateCaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.UpdateCaseRequest - * @static - * @param {google.cloud.support.v2.UpdateCaseRequest} message UpdateCaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object["case"] = null; - object.updateMask = null; - } - if (message["case"] != null && message.hasOwnProperty("case")) - object["case"] = $root.google.cloud.support.v2.Case.toObject(message["case"], options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateCaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.UpdateCaseRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCaseRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2.UpdateCaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.UpdateCaseRequest"; - }; - - return UpdateCaseRequest; - })(); - - v2.CloseCaseRequest = (function() { - - /** - * Properties of a CloseCaseRequest. - * @memberof google.cloud.support.v2 - * @interface ICloseCaseRequest - * @property {string|null} [name] CloseCaseRequest name - */ - - /** - * Constructs a new CloseCaseRequest. - * @memberof google.cloud.support.v2 - * @classdesc Represents a CloseCaseRequest. - * @implements ICloseCaseRequest - * @constructor - * @param {google.cloud.support.v2.ICloseCaseRequest=} [properties] Properties to set - */ - function CloseCaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloseCaseRequest name. - * @member {string} name - * @memberof google.cloud.support.v2.CloseCaseRequest - * @instance - */ - CloseCaseRequest.prototype.name = ""; - - /** - * Creates a new CloseCaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.CloseCaseRequest - * @static - * @param {google.cloud.support.v2.ICloseCaseRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2.CloseCaseRequest} CloseCaseRequest instance - */ - CloseCaseRequest.create = function create(properties) { - return new CloseCaseRequest(properties); - }; - - /** - * Encodes the specified CloseCaseRequest message. Does not implicitly {@link google.cloud.support.v2.CloseCaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.CloseCaseRequest - * @static - * @param {google.cloud.support.v2.ICloseCaseRequest} message CloseCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloseCaseRequest.encode = function encode(message, writer) { - 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 CloseCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CloseCaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.CloseCaseRequest - * @static - * @param {google.cloud.support.v2.ICloseCaseRequest} message CloseCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloseCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloseCaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.CloseCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.CloseCaseRequest} CloseCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloseCaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.CloseCaseRequest(); - 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 CloseCaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.CloseCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.CloseCaseRequest} CloseCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloseCaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloseCaseRequest message. - * @function verify - * @memberof google.cloud.support.v2.CloseCaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloseCaseRequest.verify = function verify(message) { - if (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 CloseCaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.CloseCaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.CloseCaseRequest} CloseCaseRequest - */ - CloseCaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.CloseCaseRequest) - return object; - var message = new $root.google.cloud.support.v2.CloseCaseRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CloseCaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.CloseCaseRequest - * @static - * @param {google.cloud.support.v2.CloseCaseRequest} message CloseCaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloseCaseRequest.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 CloseCaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.CloseCaseRequest - * @instance - * @returns {Object.} JSON object - */ - CloseCaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloseCaseRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2.CloseCaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloseCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.CloseCaseRequest"; - }; - - return CloseCaseRequest; - })(); - - v2.SearchCaseClassificationsRequest = (function() { - - /** - * Properties of a SearchCaseClassificationsRequest. - * @memberof google.cloud.support.v2 - * @interface ISearchCaseClassificationsRequest - * @property {string|null} [query] SearchCaseClassificationsRequest query - * @property {number|null} [pageSize] SearchCaseClassificationsRequest pageSize - * @property {string|null} [pageToken] SearchCaseClassificationsRequest pageToken - */ - - /** - * Constructs a new SearchCaseClassificationsRequest. - * @memberof google.cloud.support.v2 - * @classdesc Represents a SearchCaseClassificationsRequest. - * @implements ISearchCaseClassificationsRequest - * @constructor - * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest=} [properties] Properties to set - */ - function SearchCaseClassificationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SearchCaseClassificationsRequest query. - * @member {string} query - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @instance - */ - SearchCaseClassificationsRequest.prototype.query = ""; - - /** - * SearchCaseClassificationsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @instance - */ - SearchCaseClassificationsRequest.prototype.pageSize = 0; - - /** - * SearchCaseClassificationsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @instance - */ - SearchCaseClassificationsRequest.prototype.pageToken = ""; - - /** - * Creates a new SearchCaseClassificationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @static - * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest instance - */ - SearchCaseClassificationsRequest.create = function create(properties) { - return new SearchCaseClassificationsRequest(properties); - }; - - /** - * Encodes the specified SearchCaseClassificationsRequest message. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @static - * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest} message SearchCaseClassificationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCaseClassificationsRequest.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.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified SearchCaseClassificationsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @static - * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest} message SearchCaseClassificationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCaseClassificationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCaseClassificationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.SearchCaseClassificationsRequest(); - 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.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCaseClassificationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchCaseClassificationsRequest message. - * @function verify - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchCaseClassificationsRequest.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.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 SearchCaseClassificationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest - */ - SearchCaseClassificationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.SearchCaseClassificationsRequest) - return object; - var message = new $root.google.cloud.support.v2.SearchCaseClassificationsRequest(); - if (object.query != null) - message.query = String(object.query); - 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 SearchCaseClassificationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @static - * @param {google.cloud.support.v2.SearchCaseClassificationsRequest} message SearchCaseClassificationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchCaseClassificationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.query = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this SearchCaseClassificationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @instance - * @returns {Object.} JSON object - */ - SearchCaseClassificationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchCaseClassificationsRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchCaseClassificationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.SearchCaseClassificationsRequest"; - }; - - return SearchCaseClassificationsRequest; - })(); - - v2.SearchCaseClassificationsResponse = (function() { - - /** - * Properties of a SearchCaseClassificationsResponse. - * @memberof google.cloud.support.v2 - * @interface ISearchCaseClassificationsResponse - * @property {Array.|null} [caseClassifications] SearchCaseClassificationsResponse caseClassifications - * @property {string|null} [nextPageToken] SearchCaseClassificationsResponse nextPageToken - */ - - /** - * Constructs a new SearchCaseClassificationsResponse. - * @memberof google.cloud.support.v2 - * @classdesc Represents a SearchCaseClassificationsResponse. - * @implements ISearchCaseClassificationsResponse - * @constructor - * @param {google.cloud.support.v2.ISearchCaseClassificationsResponse=} [properties] Properties to set - */ - function SearchCaseClassificationsResponse(properties) { - this.caseClassifications = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SearchCaseClassificationsResponse caseClassifications. - * @member {Array.} caseClassifications - * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse - * @instance - */ - SearchCaseClassificationsResponse.prototype.caseClassifications = $util.emptyArray; - - /** - * SearchCaseClassificationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse - * @instance - */ - SearchCaseClassificationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new SearchCaseClassificationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse - * @static - * @param {google.cloud.support.v2.ISearchCaseClassificationsResponse=} [properties] Properties to set - * @returns {google.cloud.support.v2.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse instance - */ - SearchCaseClassificationsResponse.create = function create(properties) { - return new SearchCaseClassificationsResponse(properties); - }; - - /** - * Encodes the specified SearchCaseClassificationsResponse message. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse - * @static - * @param {google.cloud.support.v2.ISearchCaseClassificationsResponse} message SearchCaseClassificationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCaseClassificationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.caseClassifications != null && message.caseClassifications.length) - for (var i = 0; i < message.caseClassifications.length; ++i) - $root.google.cloud.support.v2.CaseClassification.encode(message.caseClassifications[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 SearchCaseClassificationsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse - * @static - * @param {google.cloud.support.v2.ISearchCaseClassificationsResponse} message SearchCaseClassificationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCaseClassificationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCaseClassificationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.SearchCaseClassificationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.caseClassifications && message.caseClassifications.length)) - message.caseClassifications = []; - message.caseClassifications.push($root.google.cloud.support.v2.CaseClassification.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCaseClassificationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchCaseClassificationsResponse message. - * @function verify - * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchCaseClassificationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.caseClassifications != null && message.hasOwnProperty("caseClassifications")) { - if (!Array.isArray(message.caseClassifications)) - return "caseClassifications: array expected"; - for (var i = 0; i < message.caseClassifications.length; ++i) { - var error = $root.google.cloud.support.v2.CaseClassification.verify(message.caseClassifications[i]); - if (error) - return "caseClassifications." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a SearchCaseClassificationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse - */ - SearchCaseClassificationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.SearchCaseClassificationsResponse) - return object; - var message = new $root.google.cloud.support.v2.SearchCaseClassificationsResponse(); - if (object.caseClassifications) { - if (!Array.isArray(object.caseClassifications)) - throw TypeError(".google.cloud.support.v2.SearchCaseClassificationsResponse.caseClassifications: array expected"); - message.caseClassifications = []; - for (var i = 0; i < object.caseClassifications.length; ++i) { - if (typeof object.caseClassifications[i] !== "object") - throw TypeError(".google.cloud.support.v2.SearchCaseClassificationsResponse.caseClassifications: object expected"); - message.caseClassifications[i] = $root.google.cloud.support.v2.CaseClassification.fromObject(object.caseClassifications[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a SearchCaseClassificationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse - * @static - * @param {google.cloud.support.v2.SearchCaseClassificationsResponse} message SearchCaseClassificationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchCaseClassificationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.caseClassifications = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.caseClassifications && message.caseClassifications.length) { - object.caseClassifications = []; - for (var j = 0; j < message.caseClassifications.length; ++j) - object.caseClassifications[j] = $root.google.cloud.support.v2.CaseClassification.toObject(message.caseClassifications[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this SearchCaseClassificationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse - * @instance - * @returns {Object.} JSON object - */ - SearchCaseClassificationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchCaseClassificationsResponse - * @function getTypeUrl - * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchCaseClassificationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.SearchCaseClassificationsResponse"; - }; - - return SearchCaseClassificationsResponse; - })(); - - v2.Escalation = (function() { - - /** - * Properties of an Escalation. - * @memberof google.cloud.support.v2 - * @interface IEscalation - * @property {google.cloud.support.v2.Escalation.Reason|null} [reason] Escalation reason - * @property {string|null} [justification] Escalation justification - */ - - /** - * Constructs a new Escalation. - * @memberof google.cloud.support.v2 - * @classdesc Represents an Escalation. - * @implements IEscalation - * @constructor - * @param {google.cloud.support.v2.IEscalation=} [properties] Properties to set - */ - function Escalation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Escalation reason. - * @member {google.cloud.support.v2.Escalation.Reason} reason - * @memberof google.cloud.support.v2.Escalation - * @instance - */ - Escalation.prototype.reason = 0; - - /** - * Escalation justification. - * @member {string} justification - * @memberof google.cloud.support.v2.Escalation - * @instance - */ - Escalation.prototype.justification = ""; - - /** - * Creates a new Escalation instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.Escalation - * @static - * @param {google.cloud.support.v2.IEscalation=} [properties] Properties to set - * @returns {google.cloud.support.v2.Escalation} Escalation instance - */ - Escalation.create = function create(properties) { - return new Escalation(properties); - }; - - /** - * Encodes the specified Escalation message. Does not implicitly {@link google.cloud.support.v2.Escalation.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.Escalation - * @static - * @param {google.cloud.support.v2.IEscalation} message Escalation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Escalation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.reason); - if (message.justification != null && Object.hasOwnProperty.call(message, "justification")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.justification); - return writer; - }; - - /** - * Encodes the specified Escalation message, length delimited. Does not implicitly {@link google.cloud.support.v2.Escalation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.Escalation - * @static - * @param {google.cloud.support.v2.IEscalation} message Escalation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Escalation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Escalation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.Escalation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.Escalation} Escalation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Escalation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Escalation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.reason = reader.int32(); - break; - } - case 5: { - message.justification = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Escalation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.Escalation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.Escalation} Escalation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Escalation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Escalation message. - * @function verify - * @memberof google.cloud.support.v2.Escalation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Escalation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.reason != null && message.hasOwnProperty("reason")) - switch (message.reason) { - default: - return "reason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.justification != null && message.hasOwnProperty("justification")) - if (!$util.isString(message.justification)) - return "justification: string expected"; - return null; - }; - - /** - * Creates an Escalation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.Escalation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.Escalation} Escalation - */ - Escalation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.Escalation) - return object; - var message = new $root.google.cloud.support.v2.Escalation(); - switch (object.reason) { - default: - if (typeof object.reason === "number") { - message.reason = object.reason; - break; - } - break; - case "REASON_UNSPECIFIED": - case 0: - message.reason = 0; - break; - case "RESOLUTION_TIME": - case 1: - message.reason = 1; - break; - case "TECHNICAL_EXPERTISE": - case 2: - message.reason = 2; - break; - case "BUSINESS_IMPACT": - case 3: - message.reason = 3; - break; - } - if (object.justification != null) - message.justification = String(object.justification); - return message; - }; - - /** - * Creates a plain object from an Escalation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.Escalation - * @static - * @param {google.cloud.support.v2.Escalation} message Escalation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Escalation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.reason = options.enums === String ? "REASON_UNSPECIFIED" : 0; - object.justification = ""; - } - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = options.enums === String ? $root.google.cloud.support.v2.Escalation.Reason[message.reason] === undefined ? message.reason : $root.google.cloud.support.v2.Escalation.Reason[message.reason] : message.reason; - if (message.justification != null && message.hasOwnProperty("justification")) - object.justification = message.justification; - return object; - }; - - /** - * Converts this Escalation to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.Escalation - * @instance - * @returns {Object.} JSON object - */ - Escalation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Escalation - * @function getTypeUrl - * @memberof google.cloud.support.v2.Escalation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Escalation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.Escalation"; - }; - - /** - * Reason enum. - * @name google.cloud.support.v2.Escalation.Reason - * @enum {number} - * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value - * @property {number} RESOLUTION_TIME=1 RESOLUTION_TIME value - * @property {number} TECHNICAL_EXPERTISE=2 TECHNICAL_EXPERTISE value - * @property {number} BUSINESS_IMPACT=3 BUSINESS_IMPACT value - */ - Escalation.Reason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOLUTION_TIME"] = 1; - values[valuesById[2] = "TECHNICAL_EXPERTISE"] = 2; - values[valuesById[3] = "BUSINESS_IMPACT"] = 3; - return values; - })(); - - return Escalation; - })(); - - v2.Comment = (function() { - - /** - * Properties of a Comment. - * @memberof google.cloud.support.v2 - * @interface IComment - * @property {string|null} [name] Comment name - * @property {google.protobuf.ITimestamp|null} [createTime] Comment createTime - * @property {google.cloud.support.v2.IActor|null} [creator] Comment creator - * @property {string|null} [body] Comment body - * @property {string|null} [plainTextBody] Comment plainTextBody - */ - - /** - * Constructs a new Comment. - * @memberof google.cloud.support.v2 - * @classdesc Represents a Comment. - * @implements IComment - * @constructor - * @param {google.cloud.support.v2.IComment=} [properties] Properties to set - */ - function Comment(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Comment name. - * @member {string} name - * @memberof google.cloud.support.v2.Comment - * @instance - */ - Comment.prototype.name = ""; - - /** - * Comment createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.support.v2.Comment - * @instance - */ - Comment.prototype.createTime = null; - - /** - * Comment creator. - * @member {google.cloud.support.v2.IActor|null|undefined} creator - * @memberof google.cloud.support.v2.Comment - * @instance - */ - Comment.prototype.creator = null; - - /** - * Comment body. - * @member {string} body - * @memberof google.cloud.support.v2.Comment - * @instance - */ - Comment.prototype.body = ""; - - /** - * Comment plainTextBody. - * @member {string} plainTextBody - * @memberof google.cloud.support.v2.Comment - * @instance - */ - Comment.prototype.plainTextBody = ""; - - /** - * Creates a new Comment instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.Comment - * @static - * @param {google.cloud.support.v2.IComment=} [properties] Properties to set - * @returns {google.cloud.support.v2.Comment} Comment instance - */ - Comment.create = function create(properties) { - return new Comment(properties); - }; - - /** - * Encodes the specified Comment message. Does not implicitly {@link google.cloud.support.v2.Comment.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.Comment - * @static - * @param {google.cloud.support.v2.IComment} message Comment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Comment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - $root.google.cloud.support.v2.Actor.encode(message.creator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.body); - if (message.plainTextBody != null && Object.hasOwnProperty.call(message, "plainTextBody")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plainTextBody); - return writer; - }; - - /** - * Encodes the specified Comment message, length delimited. Does not implicitly {@link google.cloud.support.v2.Comment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.Comment - * @static - * @param {google.cloud.support.v2.IComment} message Comment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Comment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Comment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.Comment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.Comment} Comment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Comment.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Comment(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.creator = $root.google.cloud.support.v2.Actor.decode(reader, reader.uint32()); - break; - } - case 4: { - message.body = reader.string(); - break; - } - case 5: { - message.plainTextBody = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Comment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.Comment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.Comment} Comment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Comment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Comment message. - * @function verify - * @memberof google.cloud.support.v2.Comment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Comment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: 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.creator != null && message.hasOwnProperty("creator")) { - var error = $root.google.cloud.support.v2.Actor.verify(message.creator); - if (error) - return "creator." + error; - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.plainTextBody != null && message.hasOwnProperty("plainTextBody")) - if (!$util.isString(message.plainTextBody)) - return "plainTextBody: string expected"; - return null; - }; - - /** - * Creates a Comment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.Comment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.Comment} Comment - */ - Comment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.Comment) - return object; - var message = new $root.google.cloud.support.v2.Comment(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.support.v2.Comment.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.creator != null) { - if (typeof object.creator !== "object") - throw TypeError(".google.cloud.support.v2.Comment.creator: object expected"); - message.creator = $root.google.cloud.support.v2.Actor.fromObject(object.creator); - } - if (object.body != null) - message.body = String(object.body); - if (object.plainTextBody != null) - message.plainTextBody = String(object.plainTextBody); - return message; - }; - - /** - * Creates a plain object from a Comment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.Comment - * @static - * @param {google.cloud.support.v2.Comment} message Comment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Comment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.creator = null; - object.body = ""; - object.plainTextBody = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = $root.google.cloud.support.v2.Actor.toObject(message.creator, options); - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.plainTextBody != null && message.hasOwnProperty("plainTextBody")) - object.plainTextBody = message.plainTextBody; - return object; - }; - - /** - * Converts this Comment to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.Comment - * @instance - * @returns {Object.} JSON object - */ - Comment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Comment - * @function getTypeUrl - * @memberof google.cloud.support.v2.Comment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Comment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.Comment"; - }; - - return Comment; - })(); - - v2.CommentService = (function() { - - /** - * Constructs a new CommentService service. - * @memberof google.cloud.support.v2 - * @classdesc Represents a CommentService - * @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 CommentService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CommentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CommentService; - - /** - * Creates new CommentService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.support.v2.CommentService - * @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 {CommentService} RPC service. Useful where requests and/or responses are streamed. - */ - CommentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.support.v2.CommentService|listComments}. - * @memberof google.cloud.support.v2.CommentService - * @typedef ListCommentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2.ListCommentsResponse} [response] ListCommentsResponse - */ - - /** - * Calls ListComments. - * @function listComments - * @memberof google.cloud.support.v2.CommentService - * @instance - * @param {google.cloud.support.v2.IListCommentsRequest} request ListCommentsRequest message or plain object - * @param {google.cloud.support.v2.CommentService.ListCommentsCallback} callback Node-style callback called with the error, if any, and ListCommentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CommentService.prototype.listComments = function listComments(request, callback) { - return this.rpcCall(listComments, $root.google.cloud.support.v2.ListCommentsRequest, $root.google.cloud.support.v2.ListCommentsResponse, request, callback); - }, "name", { value: "ListComments" }); - - /** - * Calls ListComments. - * @function listComments - * @memberof google.cloud.support.v2.CommentService - * @instance - * @param {google.cloud.support.v2.IListCommentsRequest} request ListCommentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2.CommentService|createComment}. - * @memberof google.cloud.support.v2.CommentService - * @typedef CreateCommentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2.Comment} [response] Comment - */ - - /** - * Calls CreateComment. - * @function createComment - * @memberof google.cloud.support.v2.CommentService - * @instance - * @param {google.cloud.support.v2.ICreateCommentRequest} request CreateCommentRequest message or plain object - * @param {google.cloud.support.v2.CommentService.CreateCommentCallback} callback Node-style callback called with the error, if any, and Comment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CommentService.prototype.createComment = function createComment(request, callback) { - return this.rpcCall(createComment, $root.google.cloud.support.v2.CreateCommentRequest, $root.google.cloud.support.v2.Comment, request, callback); - }, "name", { value: "CreateComment" }); - - /** - * Calls CreateComment. - * @function createComment - * @memberof google.cloud.support.v2.CommentService - * @instance - * @param {google.cloud.support.v2.ICreateCommentRequest} request CreateCommentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CommentService; - })(); - - v2.ListCommentsRequest = (function() { - - /** - * Properties of a ListCommentsRequest. - * @memberof google.cloud.support.v2 - * @interface IListCommentsRequest - * @property {string|null} [parent] ListCommentsRequest parent - * @property {number|null} [pageSize] ListCommentsRequest pageSize - * @property {string|null} [pageToken] ListCommentsRequest pageToken - */ - - /** - * Constructs a new ListCommentsRequest. - * @memberof google.cloud.support.v2 - * @classdesc Represents a ListCommentsRequest. - * @implements IListCommentsRequest - * @constructor - * @param {google.cloud.support.v2.IListCommentsRequest=} [properties] Properties to set - */ - function ListCommentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCommentsRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2.ListCommentsRequest - * @instance - */ - ListCommentsRequest.prototype.parent = ""; - - /** - * ListCommentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.support.v2.ListCommentsRequest - * @instance - */ - ListCommentsRequest.prototype.pageSize = 0; - - /** - * ListCommentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.support.v2.ListCommentsRequest - * @instance - */ - ListCommentsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListCommentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.ListCommentsRequest - * @static - * @param {google.cloud.support.v2.IListCommentsRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2.ListCommentsRequest} ListCommentsRequest instance - */ - ListCommentsRequest.create = function create(properties) { - return new ListCommentsRequest(properties); - }; - - /** - * Encodes the specified ListCommentsRequest message. Does not implicitly {@link google.cloud.support.v2.ListCommentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.ListCommentsRequest - * @static - * @param {google.cloud.support.v2.IListCommentsRequest} message ListCommentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCommentsRequest.encode = function encode(message, writer) { - if (!writer) - 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 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListCommentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCommentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.ListCommentsRequest - * @static - * @param {google.cloud.support.v2.IListCommentsRequest} message ListCommentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCommentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCommentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.ListCommentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.ListCommentsRequest} ListCommentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCommentsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListCommentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCommentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.ListCommentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.ListCommentsRequest} ListCommentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCommentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCommentsRequest message. - * @function verify - * @memberof google.cloud.support.v2.ListCommentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCommentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListCommentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.ListCommentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.ListCommentsRequest} ListCommentsRequest - */ - ListCommentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.ListCommentsRequest) - return object; - var message = new $root.google.cloud.support.v2.ListCommentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListCommentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.ListCommentsRequest - * @static - * @param {google.cloud.support.v2.ListCommentsRequest} message ListCommentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCommentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListCommentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.ListCommentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListCommentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCommentsRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2.ListCommentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCommentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.ListCommentsRequest"; - }; - - return ListCommentsRequest; - })(); - - v2.ListCommentsResponse = (function() { - - /** - * Properties of a ListCommentsResponse. - * @memberof google.cloud.support.v2 - * @interface IListCommentsResponse - * @property {Array.|null} [comments] ListCommentsResponse comments - * @property {string|null} [nextPageToken] ListCommentsResponse nextPageToken - */ - - /** - * Constructs a new ListCommentsResponse. - * @memberof google.cloud.support.v2 - * @classdesc Represents a ListCommentsResponse. - * @implements IListCommentsResponse - * @constructor - * @param {google.cloud.support.v2.IListCommentsResponse=} [properties] Properties to set - */ - function ListCommentsResponse(properties) { - this.comments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCommentsResponse comments. - * @member {Array.} comments - * @memberof google.cloud.support.v2.ListCommentsResponse - * @instance - */ - ListCommentsResponse.prototype.comments = $util.emptyArray; - - /** - * ListCommentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.support.v2.ListCommentsResponse - * @instance - */ - ListCommentsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListCommentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.ListCommentsResponse - * @static - * @param {google.cloud.support.v2.IListCommentsResponse=} [properties] Properties to set - * @returns {google.cloud.support.v2.ListCommentsResponse} ListCommentsResponse instance - */ - ListCommentsResponse.create = function create(properties) { - return new ListCommentsResponse(properties); - }; - - /** - * Encodes the specified ListCommentsResponse message. Does not implicitly {@link google.cloud.support.v2.ListCommentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.ListCommentsResponse - * @static - * @param {google.cloud.support.v2.IListCommentsResponse} message ListCommentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCommentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.comments != null && message.comments.length) - for (var i = 0; i < message.comments.length; ++i) - $root.google.cloud.support.v2.Comment.encode(message.comments[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 ListCommentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCommentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.ListCommentsResponse - * @static - * @param {google.cloud.support.v2.IListCommentsResponse} message ListCommentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCommentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCommentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.ListCommentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.ListCommentsResponse} ListCommentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCommentsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListCommentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.comments && message.comments.length)) - message.comments = []; - message.comments.push($root.google.cloud.support.v2.Comment.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCommentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.ListCommentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.ListCommentsResponse} ListCommentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCommentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCommentsResponse message. - * @function verify - * @memberof google.cloud.support.v2.ListCommentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCommentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.comments != null && message.hasOwnProperty("comments")) { - if (!Array.isArray(message.comments)) - return "comments: array expected"; - for (var i = 0; i < message.comments.length; ++i) { - var error = $root.google.cloud.support.v2.Comment.verify(message.comments[i]); - if (error) - return "comments." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListCommentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.ListCommentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.ListCommentsResponse} ListCommentsResponse - */ - ListCommentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.ListCommentsResponse) - return object; - var message = new $root.google.cloud.support.v2.ListCommentsResponse(); - if (object.comments) { - if (!Array.isArray(object.comments)) - throw TypeError(".google.cloud.support.v2.ListCommentsResponse.comments: array expected"); - message.comments = []; - for (var i = 0; i < object.comments.length; ++i) { - if (typeof object.comments[i] !== "object") - throw TypeError(".google.cloud.support.v2.ListCommentsResponse.comments: object expected"); - message.comments[i] = $root.google.cloud.support.v2.Comment.fromObject(object.comments[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListCommentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.ListCommentsResponse - * @static - * @param {google.cloud.support.v2.ListCommentsResponse} message ListCommentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCommentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.comments = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.comments && message.comments.length) { - object.comments = []; - for (var j = 0; j < message.comments.length; ++j) - object.comments[j] = $root.google.cloud.support.v2.Comment.toObject(message.comments[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListCommentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.ListCommentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListCommentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCommentsResponse - * @function getTypeUrl - * @memberof google.cloud.support.v2.ListCommentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCommentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.ListCommentsResponse"; - }; - - return ListCommentsResponse; - })(); - - v2.CreateCommentRequest = (function() { - - /** - * Properties of a CreateCommentRequest. - * @memberof google.cloud.support.v2 - * @interface ICreateCommentRequest - * @property {string|null} [parent] CreateCommentRequest parent - * @property {google.cloud.support.v2.IComment|null} [comment] CreateCommentRequest comment - */ - - /** - * Constructs a new CreateCommentRequest. - * @memberof google.cloud.support.v2 - * @classdesc Represents a CreateCommentRequest. - * @implements ICreateCommentRequest - * @constructor - * @param {google.cloud.support.v2.ICreateCommentRequest=} [properties] Properties to set - */ - function CreateCommentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateCommentRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2.CreateCommentRequest - * @instance - */ - CreateCommentRequest.prototype.parent = ""; - - /** - * CreateCommentRequest comment. - * @member {google.cloud.support.v2.IComment|null|undefined} comment - * @memberof google.cloud.support.v2.CreateCommentRequest - * @instance - */ - CreateCommentRequest.prototype.comment = null; - - /** - * Creates a new CreateCommentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2.CreateCommentRequest - * @static - * @param {google.cloud.support.v2.ICreateCommentRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2.CreateCommentRequest} CreateCommentRequest instance - */ - CreateCommentRequest.create = function create(properties) { - return new CreateCommentRequest(properties); - }; - - /** - * Encodes the specified CreateCommentRequest message. Does not implicitly {@link google.cloud.support.v2.CreateCommentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2.CreateCommentRequest - * @static - * @param {google.cloud.support.v2.ICreateCommentRequest} message CreateCommentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCommentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) - $root.google.cloud.support.v2.Comment.encode(message.comment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CreateCommentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2.CreateCommentRequest - * @static - * @param {google.cloud.support.v2.ICreateCommentRequest} message CreateCommentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCommentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCommentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2.CreateCommentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2.CreateCommentRequest} CreateCommentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCommentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.CreateCommentRequest(); - 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.comment = $root.google.cloud.support.v2.Comment.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCommentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2.CreateCommentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2.CreateCommentRequest} CreateCommentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCommentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCommentRequest message. - * @function verify - * @memberof google.cloud.support.v2.CreateCommentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCommentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.comment != null && message.hasOwnProperty("comment")) { - var error = $root.google.cloud.support.v2.Comment.verify(message.comment); - if (error) - return "comment." + error; - } - return null; - }; - - /** - * Creates a CreateCommentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2.CreateCommentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2.CreateCommentRequest} CreateCommentRequest - */ - CreateCommentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2.CreateCommentRequest) - return object; - var message = new $root.google.cloud.support.v2.CreateCommentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.comment != null) { - if (typeof object.comment !== "object") - throw TypeError(".google.cloud.support.v2.CreateCommentRequest.comment: object expected"); - message.comment = $root.google.cloud.support.v2.Comment.fromObject(object.comment); - } - return message; - }; - - /** - * Creates a plain object from a CreateCommentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2.CreateCommentRequest - * @static - * @param {google.cloud.support.v2.CreateCommentRequest} message CreateCommentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCommentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.comment = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.comment != null && message.hasOwnProperty("comment")) - object.comment = $root.google.cloud.support.v2.Comment.toObject(message.comment, options); - return object; - }; - - /** - * Converts this CreateCommentRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2.CreateCommentRequest - * @instance - * @returns {Object.} JSON object - */ - CreateCommentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCommentRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2.CreateCommentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCommentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2.CreateCommentRequest"; - }; - - return CreateCommentRequest; - })(); - - return v2; - })(); - - support.v2beta = (function() { - - /** - * Namespace v2beta. - * @memberof google.cloud.support - * @namespace - */ - var v2beta = {}; - - v2beta.Actor = (function() { - - /** - * Properties of an Actor. - * @memberof google.cloud.support.v2beta - * @interface IActor - * @property {string|null} [displayName] Actor displayName - * @property {string|null} [email] Actor email - * @property {boolean|null} [googleSupport] Actor googleSupport - * @property {string|null} [username] Actor username - */ - - /** - * Constructs a new Actor. - * @memberof google.cloud.support.v2beta - * @classdesc Represents an Actor. - * @implements IActor - * @constructor - * @param {google.cloud.support.v2beta.IActor=} [properties] Properties to set - */ - function Actor(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Actor displayName. - * @member {string} displayName - * @memberof google.cloud.support.v2beta.Actor - * @instance - */ - Actor.prototype.displayName = ""; - - /** - * Actor email. - * @member {string} email - * @memberof google.cloud.support.v2beta.Actor - * @instance - */ - Actor.prototype.email = ""; - - /** - * Actor googleSupport. - * @member {boolean} googleSupport - * @memberof google.cloud.support.v2beta.Actor - * @instance - */ - Actor.prototype.googleSupport = false; - - /** - * Actor username. - * @member {string} username - * @memberof google.cloud.support.v2beta.Actor - * @instance - */ - Actor.prototype.username = ""; - - /** - * Creates a new Actor instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.Actor - * @static - * @param {google.cloud.support.v2beta.IActor=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.Actor} Actor instance - */ - Actor.create = function create(properties) { - return new Actor(properties); - }; - - /** - * Encodes the specified Actor message. Does not implicitly {@link google.cloud.support.v2beta.Actor.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.Actor - * @static - * @param {google.cloud.support.v2beta.IActor} message Actor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Actor.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.email != null && Object.hasOwnProperty.call(message, "email")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); - if (message.googleSupport != null && Object.hasOwnProperty.call(message, "googleSupport")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.googleSupport); - if (message.username != null && Object.hasOwnProperty.call(message, "username")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.username); - return writer; - }; - - /** - * Encodes the specified Actor message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Actor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.Actor - * @static - * @param {google.cloud.support.v2beta.IActor} message Actor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Actor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Actor message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.Actor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.Actor} Actor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Actor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.Actor(); - 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.email = reader.string(); - break; - } - case 4: { - message.googleSupport = reader.bool(); - break; - } - case 5: { - message.username = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Actor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.Actor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.Actor} Actor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Actor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Actor message. - * @function verify - * @memberof google.cloud.support.v2beta.Actor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Actor.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.email != null && message.hasOwnProperty("email")) - if (!$util.isString(message.email)) - return "email: string expected"; - if (message.googleSupport != null && message.hasOwnProperty("googleSupport")) - if (typeof message.googleSupport !== "boolean") - return "googleSupport: boolean expected"; - if (message.username != null && message.hasOwnProperty("username")) - if (!$util.isString(message.username)) - return "username: string expected"; - return null; - }; - - /** - * Creates an Actor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.Actor - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.Actor} Actor - */ - Actor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.Actor) - return object; - var message = new $root.google.cloud.support.v2beta.Actor(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.email != null) - message.email = String(object.email); - if (object.googleSupport != null) - message.googleSupport = Boolean(object.googleSupport); - if (object.username != null) - message.username = String(object.username); - return message; - }; - - /** - * Creates a plain object from an Actor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.Actor - * @static - * @param {google.cloud.support.v2beta.Actor} message Actor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Actor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.displayName = ""; - object.email = ""; - object.googleSupport = false; - object.username = ""; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.email != null && message.hasOwnProperty("email")) - object.email = message.email; - if (message.googleSupport != null && message.hasOwnProperty("googleSupport")) - object.googleSupport = message.googleSupport; - if (message.username != null && message.hasOwnProperty("username")) - object.username = message.username; - return object; - }; - - /** - * Converts this Actor to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.Actor - * @instance - * @returns {Object.} JSON object - */ - Actor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Actor - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.Actor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Actor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.Actor"; - }; - - return Actor; - })(); - - v2beta.Attachment = (function() { - - /** - * Properties of an Attachment. - * @memberof google.cloud.support.v2beta - * @interface IAttachment - * @property {string|null} [name] Attachment name - * @property {google.protobuf.ITimestamp|null} [createTime] Attachment createTime - * @property {google.cloud.support.v2beta.IActor|null} [creator] Attachment creator - * @property {string|null} [filename] Attachment filename - * @property {string|null} [mimeType] Attachment mimeType - * @property {number|Long|null} [sizeBytes] Attachment sizeBytes - */ - - /** - * Constructs a new Attachment. - * @memberof google.cloud.support.v2beta - * @classdesc Represents an Attachment. - * @implements IAttachment - * @constructor - * @param {google.cloud.support.v2beta.IAttachment=} [properties] Properties to set - */ - function Attachment(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Attachment name. - * @member {string} name - * @memberof google.cloud.support.v2beta.Attachment - * @instance - */ - Attachment.prototype.name = ""; - - /** - * Attachment createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.support.v2beta.Attachment - * @instance - */ - Attachment.prototype.createTime = null; - - /** - * Attachment creator. - * @member {google.cloud.support.v2beta.IActor|null|undefined} creator - * @memberof google.cloud.support.v2beta.Attachment - * @instance - */ - Attachment.prototype.creator = null; - - /** - * Attachment filename. - * @member {string} filename - * @memberof google.cloud.support.v2beta.Attachment - * @instance - */ - Attachment.prototype.filename = ""; - - /** - * Attachment mimeType. - * @member {string} mimeType - * @memberof google.cloud.support.v2beta.Attachment - * @instance - */ - Attachment.prototype.mimeType = ""; - - /** - * Attachment sizeBytes. - * @member {number|Long} sizeBytes - * @memberof google.cloud.support.v2beta.Attachment - * @instance - */ - Attachment.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Attachment instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.Attachment - * @static - * @param {google.cloud.support.v2beta.IAttachment=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.Attachment} Attachment instance - */ - Attachment.create = function create(properties) { - return new Attachment(properties); - }; - - /** - * Encodes the specified Attachment message. Does not implicitly {@link google.cloud.support.v2beta.Attachment.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.Attachment - * @static - * @param {google.cloud.support.v2beta.IAttachment} message Attachment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attachment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - $root.google.cloud.support.v2beta.Actor.encode(message.creator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filename); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.mimeType); - if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.sizeBytes); - return writer; - }; - - /** - * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Attachment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.Attachment - * @static - * @param {google.cloud.support.v2beta.IAttachment} message Attachment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attachment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Attachment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.Attachment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.Attachment} Attachment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attachment.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.Attachment(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.creator = $root.google.cloud.support.v2beta.Actor.decode(reader, reader.uint32()); - break; - } - case 4: { - message.filename = reader.string(); - break; - } - case 5: { - message.mimeType = reader.string(); - break; - } - case 6: { - message.sizeBytes = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Attachment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.Attachment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.Attachment} Attachment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attachment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Attachment message. - * @function verify - * @memberof google.cloud.support.v2beta.Attachment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Attachment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: 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.creator != null && message.hasOwnProperty("creator")) { - var error = $root.google.cloud.support.v2beta.Actor.verify(message.creator); - if (error) - return "creator." + error; - } - if (message.filename != null && message.hasOwnProperty("filename")) - if (!$util.isString(message.filename)) - return "filename: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) - return "sizeBytes: integer|Long expected"; - return null; - }; - - /** - * Creates an Attachment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.Attachment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.Attachment} Attachment - */ - Attachment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.Attachment) - return object; - var message = new $root.google.cloud.support.v2beta.Attachment(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.support.v2beta.Attachment.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.creator != null) { - if (typeof object.creator !== "object") - throw TypeError(".google.cloud.support.v2beta.Attachment.creator: object expected"); - message.creator = $root.google.cloud.support.v2beta.Actor.fromObject(object.creator); - } - if (object.filename != null) - message.filename = String(object.filename); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.sizeBytes != null) - if ($util.Long) - (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; - else if (typeof object.sizeBytes === "string") - message.sizeBytes = parseInt(object.sizeBytes, 10); - else if (typeof object.sizeBytes === "number") - message.sizeBytes = object.sizeBytes; - else if (typeof object.sizeBytes === "object") - message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Attachment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.Attachment - * @static - * @param {google.cloud.support.v2beta.Attachment} message Attachment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Attachment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.creator = null; - object.filename = ""; - object.mimeType = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeBytes = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = $root.google.cloud.support.v2beta.Actor.toObject(message.creator, options); - if (message.filename != null && message.hasOwnProperty("filename")) - object.filename = message.filename; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (typeof message.sizeBytes === "number") - object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; - else - object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; - return object; - }; - - /** - * Converts this Attachment to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.Attachment - * @instance - * @returns {Object.} JSON object - */ - Attachment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Attachment - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.Attachment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Attachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.Attachment"; - }; - - return Attachment; - })(); - - v2beta.CaseAttachmentService = (function() { - - /** - * Constructs a new CaseAttachmentService service. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a CaseAttachmentService - * @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 CaseAttachmentService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CaseAttachmentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CaseAttachmentService; - - /** - * Creates new CaseAttachmentService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.support.v2beta.CaseAttachmentService - * @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 {CaseAttachmentService} RPC service. Useful where requests and/or responses are streamed. - */ - CaseAttachmentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseAttachmentService|listAttachments}. - * @memberof google.cloud.support.v2beta.CaseAttachmentService - * @typedef ListAttachmentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.ListAttachmentsResponse} [response] ListAttachmentsResponse - */ - - /** - * Calls ListAttachments. - * @function listAttachments - * @memberof google.cloud.support.v2beta.CaseAttachmentService - * @instance - * @param {google.cloud.support.v2beta.IListAttachmentsRequest} request ListAttachmentsRequest message or plain object - * @param {google.cloud.support.v2beta.CaseAttachmentService.ListAttachmentsCallback} callback Node-style callback called with the error, if any, and ListAttachmentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseAttachmentService.prototype.listAttachments = function listAttachments(request, callback) { - return this.rpcCall(listAttachments, $root.google.cloud.support.v2beta.ListAttachmentsRequest, $root.google.cloud.support.v2beta.ListAttachmentsResponse, request, callback); - }, "name", { value: "ListAttachments" }); - - /** - * Calls ListAttachments. - * @function listAttachments - * @memberof google.cloud.support.v2beta.CaseAttachmentService - * @instance - * @param {google.cloud.support.v2beta.IListAttachmentsRequest} request ListAttachmentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseAttachmentService|getAttachment}. - * @memberof google.cloud.support.v2beta.CaseAttachmentService - * @typedef GetAttachmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.Attachment} [response] Attachment - */ - - /** - * Calls GetAttachment. - * @function getAttachment - * @memberof google.cloud.support.v2beta.CaseAttachmentService - * @instance - * @param {google.cloud.support.v2beta.IGetAttachmentRequest} request GetAttachmentRequest message or plain object - * @param {google.cloud.support.v2beta.CaseAttachmentService.GetAttachmentCallback} callback Node-style callback called with the error, if any, and Attachment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseAttachmentService.prototype.getAttachment = function getAttachment(request, callback) { - return this.rpcCall(getAttachment, $root.google.cloud.support.v2beta.GetAttachmentRequest, $root.google.cloud.support.v2beta.Attachment, request, callback); - }, "name", { value: "GetAttachment" }); - - /** - * Calls GetAttachment. - * @function getAttachment - * @memberof google.cloud.support.v2beta.CaseAttachmentService - * @instance - * @param {google.cloud.support.v2beta.IGetAttachmentRequest} request GetAttachmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CaseAttachmentService; - })(); - - v2beta.ListAttachmentsRequest = (function() { - - /** - * Properties of a ListAttachmentsRequest. - * @memberof google.cloud.support.v2beta - * @interface IListAttachmentsRequest - * @property {string|null} [parent] ListAttachmentsRequest parent - * @property {number|null} [pageSize] ListAttachmentsRequest pageSize - * @property {string|null} [pageToken] ListAttachmentsRequest pageToken - */ - - /** - * Constructs a new ListAttachmentsRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a ListAttachmentsRequest. - * @implements IListAttachmentsRequest - * @constructor - * @param {google.cloud.support.v2beta.IListAttachmentsRequest=} [properties] Properties to set - */ - function ListAttachmentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAttachmentsRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @instance - */ - ListAttachmentsRequest.prototype.parent = ""; - - /** - * ListAttachmentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @instance - */ - ListAttachmentsRequest.prototype.pageSize = 0; - - /** - * ListAttachmentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @instance - */ - ListAttachmentsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListAttachmentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @static - * @param {google.cloud.support.v2beta.IListAttachmentsRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.ListAttachmentsRequest} ListAttachmentsRequest instance - */ - ListAttachmentsRequest.create = function create(properties) { - return new ListAttachmentsRequest(properties); - }; - - /** - * Encodes the specified ListAttachmentsRequest message. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @static - * @param {google.cloud.support.v2beta.IListAttachmentsRequest} message ListAttachmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttachmentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @static - * @param {google.cloud.support.v2beta.IListAttachmentsRequest} message ListAttachmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttachmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAttachmentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.ListAttachmentsRequest} ListAttachmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttachmentsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ListAttachmentsRequest(); - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAttachmentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.ListAttachmentsRequest} ListAttachmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttachmentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAttachmentsRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAttachmentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListAttachmentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.ListAttachmentsRequest} ListAttachmentsRequest - */ - ListAttachmentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.ListAttachmentsRequest) - return object; - var message = new $root.google.cloud.support.v2beta.ListAttachmentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListAttachmentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @static - * @param {google.cloud.support.v2beta.ListAttachmentsRequest} message ListAttachmentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAttachmentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListAttachmentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListAttachmentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAttachmentsRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.ListAttachmentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAttachmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.ListAttachmentsRequest"; - }; - - return ListAttachmentsRequest; - })(); - - v2beta.GetAttachmentRequest = (function() { - - /** - * Properties of a GetAttachmentRequest. - * @memberof google.cloud.support.v2beta - * @interface IGetAttachmentRequest - * @property {string|null} [name] GetAttachmentRequest name - */ - - /** - * Constructs a new GetAttachmentRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a GetAttachmentRequest. - * @implements IGetAttachmentRequest - * @constructor - * @param {google.cloud.support.v2beta.IGetAttachmentRequest=} [properties] Properties to set - */ - function GetAttachmentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetAttachmentRequest name. - * @member {string} name - * @memberof google.cloud.support.v2beta.GetAttachmentRequest - * @instance - */ - GetAttachmentRequest.prototype.name = ""; - - /** - * Creates a new GetAttachmentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.GetAttachmentRequest - * @static - * @param {google.cloud.support.v2beta.IGetAttachmentRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.GetAttachmentRequest} GetAttachmentRequest instance - */ - GetAttachmentRequest.create = function create(properties) { - return new GetAttachmentRequest(properties); - }; - - /** - * Encodes the specified GetAttachmentRequest message. Does not implicitly {@link google.cloud.support.v2beta.GetAttachmentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.GetAttachmentRequest - * @static - * @param {google.cloud.support.v2beta.IGetAttachmentRequest} message GetAttachmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAttachmentRequest.encode = function encode(message, writer) { - 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 GetAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.GetAttachmentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.GetAttachmentRequest - * @static - * @param {google.cloud.support.v2beta.IGetAttachmentRequest} message GetAttachmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetAttachmentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.GetAttachmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.GetAttachmentRequest} GetAttachmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAttachmentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.GetAttachmentRequest(); - 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 GetAttachmentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.GetAttachmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.GetAttachmentRequest} GetAttachmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetAttachmentRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.GetAttachmentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetAttachmentRequest.verify = function verify(message) { - if (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 GetAttachmentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.GetAttachmentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.GetAttachmentRequest} GetAttachmentRequest - */ - GetAttachmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.GetAttachmentRequest) - return object; - var message = new $root.google.cloud.support.v2beta.GetAttachmentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetAttachmentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.GetAttachmentRequest - * @static - * @param {google.cloud.support.v2beta.GetAttachmentRequest} message GetAttachmentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetAttachmentRequest.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 GetAttachmentRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.GetAttachmentRequest - * @instance - * @returns {Object.} JSON object - */ - GetAttachmentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetAttachmentRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.GetAttachmentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.GetAttachmentRequest"; - }; - - return GetAttachmentRequest; - })(); - - v2beta.ListAttachmentsResponse = (function() { - - /** - * Properties of a ListAttachmentsResponse. - * @memberof google.cloud.support.v2beta - * @interface IListAttachmentsResponse - * @property {Array.|null} [attachments] ListAttachmentsResponse attachments - * @property {string|null} [nextPageToken] ListAttachmentsResponse nextPageToken - */ - - /** - * Constructs a new ListAttachmentsResponse. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a ListAttachmentsResponse. - * @implements IListAttachmentsResponse - * @constructor - * @param {google.cloud.support.v2beta.IListAttachmentsResponse=} [properties] Properties to set - */ - function ListAttachmentsResponse(properties) { - this.attachments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAttachmentsResponse attachments. - * @member {Array.} attachments - * @memberof google.cloud.support.v2beta.ListAttachmentsResponse - * @instance - */ - ListAttachmentsResponse.prototype.attachments = $util.emptyArray; - - /** - * ListAttachmentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.support.v2beta.ListAttachmentsResponse - * @instance - */ - ListAttachmentsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAttachmentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.ListAttachmentsResponse - * @static - * @param {google.cloud.support.v2beta.IListAttachmentsResponse=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.ListAttachmentsResponse} ListAttachmentsResponse instance - */ - ListAttachmentsResponse.create = function create(properties) { - return new ListAttachmentsResponse(properties); - }; - - /** - * Encodes the specified ListAttachmentsResponse message. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.ListAttachmentsResponse - * @static - * @param {google.cloud.support.v2beta.IListAttachmentsResponse} message ListAttachmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttachmentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attachments != null && message.attachments.length) - for (var i = 0; i < message.attachments.length; ++i) - $root.google.cloud.support.v2beta.Attachment.encode(message.attachments[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 ListAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListAttachmentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.ListAttachmentsResponse - * @static - * @param {google.cloud.support.v2beta.IListAttachmentsResponse} message ListAttachmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttachmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAttachmentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.ListAttachmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.ListAttachmentsResponse} ListAttachmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttachmentsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ListAttachmentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.attachments && message.attachments.length)) - message.attachments = []; - message.attachments.push($root.google.cloud.support.v2beta.Attachment.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAttachmentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.ListAttachmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.ListAttachmentsResponse} ListAttachmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttachmentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAttachmentsResponse message. - * @function verify - * @memberof google.cloud.support.v2beta.ListAttachmentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAttachmentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attachments != null && message.hasOwnProperty("attachments")) { - if (!Array.isArray(message.attachments)) - return "attachments: array expected"; - for (var i = 0; i < message.attachments.length; ++i) { - var error = $root.google.cloud.support.v2beta.Attachment.verify(message.attachments[i]); - if (error) - return "attachments." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAttachmentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.ListAttachmentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.ListAttachmentsResponse} ListAttachmentsResponse - */ - ListAttachmentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.ListAttachmentsResponse) - return object; - var message = new $root.google.cloud.support.v2beta.ListAttachmentsResponse(); - if (object.attachments) { - if (!Array.isArray(object.attachments)) - throw TypeError(".google.cloud.support.v2beta.ListAttachmentsResponse.attachments: array expected"); - message.attachments = []; - for (var i = 0; i < object.attachments.length; ++i) { - if (typeof object.attachments[i] !== "object") - throw TypeError(".google.cloud.support.v2beta.ListAttachmentsResponse.attachments: object expected"); - message.attachments[i] = $root.google.cloud.support.v2beta.Attachment.fromObject(object.attachments[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAttachmentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.ListAttachmentsResponse - * @static - * @param {google.cloud.support.v2beta.ListAttachmentsResponse} message ListAttachmentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAttachmentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attachments = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.attachments && message.attachments.length) { - object.attachments = []; - for (var j = 0; j < message.attachments.length; ++j) - object.attachments[j] = $root.google.cloud.support.v2beta.Attachment.toObject(message.attachments[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAttachmentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.ListAttachmentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListAttachmentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAttachmentsResponse - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.ListAttachmentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAttachmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.ListAttachmentsResponse"; - }; - - return ListAttachmentsResponse; - })(); - - /** - * ProductLine enum. - * @name google.cloud.support.v2beta.ProductLine - * @enum {number} - * @property {number} PRODUCT_LINE_UNSPECIFIED=0 PRODUCT_LINE_UNSPECIFIED value - * @property {number} GOOGLE_CLOUD=1 GOOGLE_CLOUD value - * @property {number} GOOGLE_MAPS=2 GOOGLE_MAPS value - */ - v2beta.ProductLine = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PRODUCT_LINE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_CLOUD"] = 1; - values[valuesById[2] = "GOOGLE_MAPS"] = 2; - return values; - })(); - - v2beta.Case = (function() { - - /** - * Properties of a Case. - * @memberof google.cloud.support.v2beta - * @interface ICase - * @property {string|null} [name] Case name - * @property {string|null} [displayName] Case displayName - * @property {string|null} [description] Case description - * @property {google.cloud.support.v2beta.ICaseClassification|null} [classification] Case classification - * @property {string|null} [timeZone] Case timeZone - * @property {Array.|null} [subscriberEmailAddresses] Case subscriberEmailAddresses - * @property {google.cloud.support.v2beta.Case.State|null} [state] Case state - * @property {google.protobuf.ITimestamp|null} [createTime] Case createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Case updateTime - * @property {google.cloud.support.v2beta.IActor|null} [creator] Case creator - * @property {string|null} [contactEmail] Case contactEmail - * @property {boolean|null} [escalated] Case escalated - * @property {boolean|null} [testCase] Case testCase - * @property {string|null} [languageCode] Case languageCode - * @property {google.cloud.support.v2beta.Case.Priority|null} [priority] Case priority - */ - - /** - * Constructs a new Case. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a Case. - * @implements ICase - * @constructor - * @param {google.cloud.support.v2beta.ICase=} [properties] Properties to set - */ - function Case(properties) { - this.subscriberEmailAddresses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Case name. - * @member {string} name - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.name = ""; - - /** - * Case displayName. - * @member {string} displayName - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.displayName = ""; - - /** - * Case description. - * @member {string} description - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.description = ""; - - /** - * Case classification. - * @member {google.cloud.support.v2beta.ICaseClassification|null|undefined} classification - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.classification = null; - - /** - * Case timeZone. - * @member {string} timeZone - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.timeZone = ""; - - /** - * Case subscriberEmailAddresses. - * @member {Array.} subscriberEmailAddresses - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.subscriberEmailAddresses = $util.emptyArray; - - /** - * Case state. - * @member {google.cloud.support.v2beta.Case.State} state - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.state = 0; - - /** - * Case createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.createTime = null; - - /** - * Case updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.updateTime = null; - - /** - * Case creator. - * @member {google.cloud.support.v2beta.IActor|null|undefined} creator - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.creator = null; - - /** - * Case contactEmail. - * @member {string} contactEmail - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.contactEmail = ""; - - /** - * Case escalated. - * @member {boolean} escalated - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.escalated = false; - - /** - * Case testCase. - * @member {boolean} testCase - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.testCase = false; - - /** - * Case languageCode. - * @member {string} languageCode - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.languageCode = ""; - - /** - * Case priority. - * @member {google.cloud.support.v2beta.Case.Priority} priority - * @memberof google.cloud.support.v2beta.Case - * @instance - */ - Case.prototype.priority = 0; - - /** - * Creates a new Case instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.Case - * @static - * @param {google.cloud.support.v2beta.ICase=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.Case} Case instance - */ - Case.create = function create(properties) { - return new Case(properties); - }; - - /** - * Encodes the specified Case message. Does not implicitly {@link google.cloud.support.v2beta.Case.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.Case - * @static - * @param {google.cloud.support.v2beta.ICase} message Case message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Case.encode = function encode(message, writer) { - if (!writer) - 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.classification != null && Object.hasOwnProperty.call(message, "classification")) - $root.google.cloud.support.v2beta.CaseClassification.encode(message.classification, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.timeZone); - if (message.subscriberEmailAddresses != null && message.subscriberEmailAddresses.length) - for (var i = 0; i < message.subscriberEmailAddresses.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.subscriberEmailAddresses[i]); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - $root.google.cloud.support.v2beta.Actor.encode(message.creator, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.escalated != null && Object.hasOwnProperty.call(message, "escalated")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.escalated); - if (message.testCase != null && Object.hasOwnProperty.call(message, "testCase")) - writer.uint32(/* id 19, wireType 0 =*/152).bool(message.testCase); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 23, wireType 2 =*/186).string(message.languageCode); - if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) - writer.uint32(/* id 32, wireType 0 =*/256).int32(message.priority); - if (message.contactEmail != null && Object.hasOwnProperty.call(message, "contactEmail")) - writer.uint32(/* id 35, wireType 2 =*/282).string(message.contactEmail); - return writer; - }; - - /** - * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Case.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.Case - * @static - * @param {google.cloud.support.v2beta.ICase} message Case message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Case.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Case message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.Case - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.Case} Case - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Case.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.Case(); - while (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.classification = $root.google.cloud.support.v2beta.CaseClassification.decode(reader, reader.uint32()); - break; - } - case 8: { - message.timeZone = reader.string(); - break; - } - case 9: { - if (!(message.subscriberEmailAddresses && message.subscriberEmailAddresses.length)) - message.subscriberEmailAddresses = []; - message.subscriberEmailAddresses.push(reader.string()); - break; - } - case 12: { - message.state = reader.int32(); - break; - } - case 13: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 15: { - message.creator = $root.google.cloud.support.v2beta.Actor.decode(reader, reader.uint32()); - break; - } - case 35: { - message.contactEmail = reader.string(); - break; - } - case 17: { - message.escalated = reader.bool(); - break; - } - case 19: { - message.testCase = reader.bool(); - break; - } - case 23: { - message.languageCode = reader.string(); - break; - } - case 32: { - message.priority = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Case message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.Case - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.Case} Case - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Case.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Case message. - * @function verify - * @memberof google.cloud.support.v2beta.Case - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Case.verify = function verify(message) { - if (typeof message !== "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.classification != null && message.hasOwnProperty("classification")) { - var error = $root.google.cloud.support.v2beta.CaseClassification.verify(message.classification); - if (error) - return "classification." + error; - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - if (message.subscriberEmailAddresses != null && message.hasOwnProperty("subscriberEmailAddresses")) { - if (!Array.isArray(message.subscriberEmailAddresses)) - return "subscriberEmailAddresses: array expected"; - for (var i = 0; i < message.subscriberEmailAddresses.length; ++i) - if (!$util.isString(message.subscriberEmailAddresses[i])) - return "subscriberEmailAddresses: string[] expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - 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.creator != null && message.hasOwnProperty("creator")) { - var error = $root.google.cloud.support.v2beta.Actor.verify(message.creator); - if (error) - return "creator." + error; - } - if (message.contactEmail != null && message.hasOwnProperty("contactEmail")) - if (!$util.isString(message.contactEmail)) - return "contactEmail: string expected"; - if (message.escalated != null && message.hasOwnProperty("escalated")) - if (typeof message.escalated !== "boolean") - return "escalated: boolean expected"; - if (message.testCase != null && message.hasOwnProperty("testCase")) - if (typeof message.testCase !== "boolean") - return "testCase: boolean expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.priority != null && message.hasOwnProperty("priority")) - switch (message.priority) { - default: - return "priority: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; - - /** - * Creates a Case message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.Case - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.Case} Case - */ - Case.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.Case) - return object; - var message = new $root.google.cloud.support.v2beta.Case(); - 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.classification != null) { - if (typeof object.classification !== "object") - throw TypeError(".google.cloud.support.v2beta.Case.classification: object expected"); - message.classification = $root.google.cloud.support.v2beta.CaseClassification.fromObject(object.classification); - } - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - if (object.subscriberEmailAddresses) { - if (!Array.isArray(object.subscriberEmailAddresses)) - throw TypeError(".google.cloud.support.v2beta.Case.subscriberEmailAddresses: array expected"); - message.subscriberEmailAddresses = []; - for (var i = 0; i < object.subscriberEmailAddresses.length; ++i) - message.subscriberEmailAddresses[i] = String(object.subscriberEmailAddresses[i]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "NEW": - case 1: - message.state = 1; - break; - case "IN_PROGRESS_GOOGLE_SUPPORT": - case 2: - message.state = 2; - break; - case "ACTION_REQUIRED": - case 3: - message.state = 3; - break; - case "SOLUTION_PROVIDED": - case 4: - message.state = 4; - break; - case "CLOSED": - case 5: - message.state = 5; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.support.v2beta.Case.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.support.v2beta.Case.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.creator != null) { - if (typeof object.creator !== "object") - throw TypeError(".google.cloud.support.v2beta.Case.creator: object expected"); - message.creator = $root.google.cloud.support.v2beta.Actor.fromObject(object.creator); - } - if (object.contactEmail != null) - message.contactEmail = String(object.contactEmail); - if (object.escalated != null) - message.escalated = Boolean(object.escalated); - if (object.testCase != null) - message.testCase = Boolean(object.testCase); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - switch (object.priority) { - default: - if (typeof object.priority === "number") { - message.priority = object.priority; - break; - } - break; - case "PRIORITY_UNSPECIFIED": - case 0: - message.priority = 0; - break; - case "P0": - case 1: - message.priority = 1; - break; - case "P1": - case 2: - message.priority = 2; - break; - case "P2": - case 3: - message.priority = 3; - break; - case "P3": - case 4: - message.priority = 4; - break; - case "P4": - case 5: - message.priority = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from a Case message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.Case - * @static - * @param {google.cloud.support.v2beta.Case} message Case - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Case.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.subscriberEmailAddresses = []; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.classification = null; - object.timeZone = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - object.creator = null; - object.escalated = false; - object.testCase = false; - object.languageCode = ""; - object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; - object.contactEmail = ""; - } - 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.classification != null && message.hasOwnProperty("classification")) - object.classification = $root.google.cloud.support.v2beta.CaseClassification.toObject(message.classification, options); - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - if (message.subscriberEmailAddresses && message.subscriberEmailAddresses.length) { - object.subscriberEmailAddresses = []; - for (var j = 0; j < message.subscriberEmailAddresses.length; ++j) - object.subscriberEmailAddresses[j] = message.subscriberEmailAddresses[j]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.support.v2beta.Case.State[message.state] === undefined ? message.state : $root.google.cloud.support.v2beta.Case.State[message.state] : message.state; - 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.creator != null && message.hasOwnProperty("creator")) - object.creator = $root.google.cloud.support.v2beta.Actor.toObject(message.creator, options); - if (message.escalated != null && message.hasOwnProperty("escalated")) - object.escalated = message.escalated; - if (message.testCase != null && message.hasOwnProperty("testCase")) - object.testCase = message.testCase; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.priority != null && message.hasOwnProperty("priority")) - object.priority = options.enums === String ? $root.google.cloud.support.v2beta.Case.Priority[message.priority] === undefined ? message.priority : $root.google.cloud.support.v2beta.Case.Priority[message.priority] : message.priority; - if (message.contactEmail != null && message.hasOwnProperty("contactEmail")) - object.contactEmail = message.contactEmail; - return object; - }; - - /** - * Converts this Case to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.Case - * @instance - * @returns {Object.} JSON object - */ - Case.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Case - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.Case - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Case.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.Case"; - }; - - /** - * State enum. - * @name google.cloud.support.v2beta.Case.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} NEW=1 NEW value - * @property {number} IN_PROGRESS_GOOGLE_SUPPORT=2 IN_PROGRESS_GOOGLE_SUPPORT value - * @property {number} ACTION_REQUIRED=3 ACTION_REQUIRED value - * @property {number} SOLUTION_PROVIDED=4 SOLUTION_PROVIDED value - * @property {number} CLOSED=5 CLOSED value - */ - Case.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NEW"] = 1; - values[valuesById[2] = "IN_PROGRESS_GOOGLE_SUPPORT"] = 2; - values[valuesById[3] = "ACTION_REQUIRED"] = 3; - values[valuesById[4] = "SOLUTION_PROVIDED"] = 4; - values[valuesById[5] = "CLOSED"] = 5; - return values; - })(); - - /** - * Priority enum. - * @name google.cloud.support.v2beta.Case.Priority - * @enum {number} - * @property {number} PRIORITY_UNSPECIFIED=0 PRIORITY_UNSPECIFIED value - * @property {number} P0=1 P0 value - * @property {number} P1=2 P1 value - * @property {number} P2=3 P2 value - * @property {number} P3=4 P3 value - * @property {number} P4=5 P4 value - */ - Case.Priority = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PRIORITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "P0"] = 1; - values[valuesById[2] = "P1"] = 2; - values[valuesById[3] = "P2"] = 3; - values[valuesById[4] = "P3"] = 4; - values[valuesById[5] = "P4"] = 5; - return values; - })(); - - return Case; - })(); - - v2beta.CaseClassification = (function() { - - /** - * Properties of a CaseClassification. - * @memberof google.cloud.support.v2beta - * @interface ICaseClassification - * @property {string|null} [id] CaseClassification id - * @property {string|null} [displayName] CaseClassification displayName - * @property {google.cloud.support.v2beta.IProduct|null} [product] CaseClassification product - */ - - /** - * Constructs a new CaseClassification. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a CaseClassification. - * @implements ICaseClassification - * @constructor - * @param {google.cloud.support.v2beta.ICaseClassification=} [properties] Properties to set - */ - function CaseClassification(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CaseClassification id. - * @member {string} id - * @memberof google.cloud.support.v2beta.CaseClassification - * @instance - */ - CaseClassification.prototype.id = ""; - - /** - * CaseClassification displayName. - * @member {string} displayName - * @memberof google.cloud.support.v2beta.CaseClassification - * @instance - */ - CaseClassification.prototype.displayName = ""; - - /** - * CaseClassification product. - * @member {google.cloud.support.v2beta.IProduct|null|undefined} product - * @memberof google.cloud.support.v2beta.CaseClassification - * @instance - */ - CaseClassification.prototype.product = null; - - /** - * Creates a new CaseClassification instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.CaseClassification - * @static - * @param {google.cloud.support.v2beta.ICaseClassification=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.CaseClassification} CaseClassification instance - */ - CaseClassification.create = function create(properties) { - return new CaseClassification(properties); - }; - - /** - * Encodes the specified CaseClassification message. Does not implicitly {@link google.cloud.support.v2beta.CaseClassification.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.CaseClassification - * @static - * @param {google.cloud.support.v2beta.ICaseClassification} message CaseClassification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaseClassification.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.support.v2beta.Product.encode(message.product, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CaseClassification message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CaseClassification.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.CaseClassification - * @static - * @param {google.cloud.support.v2beta.ICaseClassification} message CaseClassification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaseClassification.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CaseClassification message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.CaseClassification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.CaseClassification} CaseClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaseClassification.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.CaseClassification(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.id = reader.string(); - break; - } - case 4: { - message.displayName = reader.string(); - break; - } - case 10: { - message.product = $root.google.cloud.support.v2beta.Product.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CaseClassification message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.CaseClassification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.CaseClassification} CaseClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaseClassification.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CaseClassification message. - * @function verify - * @memberof google.cloud.support.v2beta.CaseClassification - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CaseClassification.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.support.v2beta.Product.verify(message.product); - if (error) - return "product." + error; - } - return null; - }; - - /** - * Creates a CaseClassification message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.CaseClassification - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.CaseClassification} CaseClassification - */ - CaseClassification.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.CaseClassification) - return object; - var message = new $root.google.cloud.support.v2beta.CaseClassification(); - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.support.v2beta.CaseClassification.product: object expected"); - message.product = $root.google.cloud.support.v2beta.Product.fromObject(object.product); - } - return message; - }; - - /** - * Creates a plain object from a CaseClassification message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.CaseClassification - * @static - * @param {google.cloud.support.v2beta.CaseClassification} message CaseClassification - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CaseClassification.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.displayName = ""; - object.product = null; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.support.v2beta.Product.toObject(message.product, options); - return object; - }; - - /** - * Converts this CaseClassification to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.CaseClassification - * @instance - * @returns {Object.} JSON object - */ - CaseClassification.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CaseClassification - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.CaseClassification - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CaseClassification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.CaseClassification"; - }; - - return CaseClassification; - })(); - - v2beta.Product = (function() { - - /** - * Properties of a Product. - * @memberof google.cloud.support.v2beta - * @interface IProduct - * @property {google.cloud.support.v2beta.ProductLine|null} [productLine] Product productLine - */ - - /** - * Constructs a new Product. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a Product. - * @implements IProduct - * @constructor - * @param {google.cloud.support.v2beta.IProduct=} [properties] Properties to set - */ - function Product(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Product productLine. - * @member {google.cloud.support.v2beta.ProductLine} productLine - * @memberof google.cloud.support.v2beta.Product - * @instance - */ - Product.prototype.productLine = 0; - - /** - * Creates a new Product instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.Product - * @static - * @param {google.cloud.support.v2beta.IProduct=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.Product} Product instance - */ - Product.create = function create(properties) { - return new Product(properties); - }; - - /** - * Encodes the specified Product message. Does not implicitly {@link google.cloud.support.v2beta.Product.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.Product - * @static - * @param {google.cloud.support.v2beta.IProduct} message Product message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Product.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.productLine != null && Object.hasOwnProperty.call(message, "productLine")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.productLine); - return writer; - }; - - /** - * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Product.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.Product - * @static - * @param {google.cloud.support.v2beta.IProduct} message Product message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Product.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Product message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.Product - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.Product} Product - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Product.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.Product(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.productLine = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Product message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.Product - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.Product} Product - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Product.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Product message. - * @function verify - * @memberof google.cloud.support.v2beta.Product - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Product.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.productLine != null && message.hasOwnProperty("productLine")) - switch (message.productLine) { - default: - return "productLine: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a Product message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.Product - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.Product} Product - */ - Product.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.Product) - return object; - var message = new $root.google.cloud.support.v2beta.Product(); - switch (object.productLine) { - default: - if (typeof object.productLine === "number") { - message.productLine = object.productLine; - break; - } - break; - case "PRODUCT_LINE_UNSPECIFIED": - case 0: - message.productLine = 0; - break; - case "GOOGLE_CLOUD": - case 1: - message.productLine = 1; - break; - case "GOOGLE_MAPS": - case 2: - message.productLine = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a Product message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.Product - * @static - * @param {google.cloud.support.v2beta.Product} message Product - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Product.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.productLine = options.enums === String ? "PRODUCT_LINE_UNSPECIFIED" : 0; - if (message.productLine != null && message.hasOwnProperty("productLine")) - object.productLine = options.enums === String ? $root.google.cloud.support.v2beta.ProductLine[message.productLine] === undefined ? message.productLine : $root.google.cloud.support.v2beta.ProductLine[message.productLine] : message.productLine; - return object; - }; - - /** - * Converts this Product to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.Product - * @instance - * @returns {Object.} JSON object - */ - Product.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Product - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.Product - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Product.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.Product"; - }; - - return Product; - })(); - - v2beta.CaseService = (function() { - - /** - * Constructs a new CaseService service. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a CaseService - * @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 CaseService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CaseService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CaseService; - - /** - * Creates new CaseService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.support.v2beta.CaseService - * @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 {CaseService} RPC service. Useful where requests and/or responses are streamed. - */ - CaseService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|getCase}. - * @memberof google.cloud.support.v2beta.CaseService - * @typedef GetCaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.Case} [response] Case - */ - - /** - * Calls GetCase. - * @function getCase - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.IGetCaseRequest} request GetCaseRequest message or plain object - * @param {google.cloud.support.v2beta.CaseService.GetCaseCallback} callback Node-style callback called with the error, if any, and Case - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.getCase = function getCase(request, callback) { - return this.rpcCall(getCase, $root.google.cloud.support.v2beta.GetCaseRequest, $root.google.cloud.support.v2beta.Case, request, callback); - }, "name", { value: "GetCase" }); - - /** - * Calls GetCase. - * @function getCase - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.IGetCaseRequest} request GetCaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|listCases}. - * @memberof google.cloud.support.v2beta.CaseService - * @typedef ListCasesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.ListCasesResponse} [response] ListCasesResponse - */ - - /** - * Calls ListCases. - * @function listCases - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.IListCasesRequest} request ListCasesRequest message or plain object - * @param {google.cloud.support.v2beta.CaseService.ListCasesCallback} callback Node-style callback called with the error, if any, and ListCasesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.listCases = function listCases(request, callback) { - return this.rpcCall(listCases, $root.google.cloud.support.v2beta.ListCasesRequest, $root.google.cloud.support.v2beta.ListCasesResponse, request, callback); - }, "name", { value: "ListCases" }); - - /** - * Calls ListCases. - * @function listCases - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.IListCasesRequest} request ListCasesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|searchCases}. - * @memberof google.cloud.support.v2beta.CaseService - * @typedef SearchCasesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.SearchCasesResponse} [response] SearchCasesResponse - */ - - /** - * Calls SearchCases. - * @function searchCases - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.ISearchCasesRequest} request SearchCasesRequest message or plain object - * @param {google.cloud.support.v2beta.CaseService.SearchCasesCallback} callback Node-style callback called with the error, if any, and SearchCasesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.searchCases = function searchCases(request, callback) { - return this.rpcCall(searchCases, $root.google.cloud.support.v2beta.SearchCasesRequest, $root.google.cloud.support.v2beta.SearchCasesResponse, request, callback); - }, "name", { value: "SearchCases" }); - - /** - * Calls SearchCases. - * @function searchCases - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.ISearchCasesRequest} request SearchCasesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|createCase}. - * @memberof google.cloud.support.v2beta.CaseService - * @typedef CreateCaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.Case} [response] Case - */ - - /** - * Calls CreateCase. - * @function createCase - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.ICreateCaseRequest} request CreateCaseRequest message or plain object - * @param {google.cloud.support.v2beta.CaseService.CreateCaseCallback} callback Node-style callback called with the error, if any, and Case - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.createCase = function createCase(request, callback) { - return this.rpcCall(createCase, $root.google.cloud.support.v2beta.CreateCaseRequest, $root.google.cloud.support.v2beta.Case, request, callback); - }, "name", { value: "CreateCase" }); - - /** - * Calls CreateCase. - * @function createCase - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.ICreateCaseRequest} request CreateCaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|updateCase}. - * @memberof google.cloud.support.v2beta.CaseService - * @typedef UpdateCaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.Case} [response] Case - */ - - /** - * Calls UpdateCase. - * @function updateCase - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.IUpdateCaseRequest} request UpdateCaseRequest message or plain object - * @param {google.cloud.support.v2beta.CaseService.UpdateCaseCallback} callback Node-style callback called with the error, if any, and Case - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.updateCase = function updateCase(request, callback) { - return this.rpcCall(updateCase, $root.google.cloud.support.v2beta.UpdateCaseRequest, $root.google.cloud.support.v2beta.Case, request, callback); - }, "name", { value: "UpdateCase" }); - - /** - * Calls UpdateCase. - * @function updateCase - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.IUpdateCaseRequest} request UpdateCaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|escalateCase}. - * @memberof google.cloud.support.v2beta.CaseService - * @typedef EscalateCaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.Case} [response] Case - */ - - /** - * Calls EscalateCase. - * @function escalateCase - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.IEscalateCaseRequest} request EscalateCaseRequest message or plain object - * @param {google.cloud.support.v2beta.CaseService.EscalateCaseCallback} callback Node-style callback called with the error, if any, and Case - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.escalateCase = function escalateCase(request, callback) { - return this.rpcCall(escalateCase, $root.google.cloud.support.v2beta.EscalateCaseRequest, $root.google.cloud.support.v2beta.Case, request, callback); - }, "name", { value: "EscalateCase" }); - - /** - * Calls EscalateCase. - * @function escalateCase - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.IEscalateCaseRequest} request EscalateCaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|closeCase}. - * @memberof google.cloud.support.v2beta.CaseService - * @typedef CloseCaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.Case} [response] Case - */ - - /** - * Calls CloseCase. - * @function closeCase - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.ICloseCaseRequest} request CloseCaseRequest message or plain object - * @param {google.cloud.support.v2beta.CaseService.CloseCaseCallback} callback Node-style callback called with the error, if any, and Case - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.closeCase = function closeCase(request, callback) { - return this.rpcCall(closeCase, $root.google.cloud.support.v2beta.CloseCaseRequest, $root.google.cloud.support.v2beta.Case, request, callback); - }, "name", { value: "CloseCase" }); - - /** - * Calls CloseCase. - * @function closeCase - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.ICloseCaseRequest} request CloseCaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2beta.CaseService|searchCaseClassifications}. - * @memberof google.cloud.support.v2beta.CaseService - * @typedef SearchCaseClassificationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.SearchCaseClassificationsResponse} [response] SearchCaseClassificationsResponse - */ - - /** - * Calls SearchCaseClassifications. - * @function searchCaseClassifications - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.ISearchCaseClassificationsRequest} request SearchCaseClassificationsRequest message or plain object - * @param {google.cloud.support.v2beta.CaseService.SearchCaseClassificationsCallback} callback Node-style callback called with the error, if any, and SearchCaseClassificationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CaseService.prototype.searchCaseClassifications = function searchCaseClassifications(request, callback) { - return this.rpcCall(searchCaseClassifications, $root.google.cloud.support.v2beta.SearchCaseClassificationsRequest, $root.google.cloud.support.v2beta.SearchCaseClassificationsResponse, request, callback); - }, "name", { value: "SearchCaseClassifications" }); - - /** - * Calls SearchCaseClassifications. - * @function searchCaseClassifications - * @memberof google.cloud.support.v2beta.CaseService - * @instance - * @param {google.cloud.support.v2beta.ISearchCaseClassificationsRequest} request SearchCaseClassificationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CaseService; - })(); - - v2beta.GetCaseRequest = (function() { - - /** - * Properties of a GetCaseRequest. - * @memberof google.cloud.support.v2beta - * @interface IGetCaseRequest - * @property {string|null} [name] GetCaseRequest name - */ - - /** - * Constructs a new GetCaseRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a GetCaseRequest. - * @implements IGetCaseRequest - * @constructor - * @param {google.cloud.support.v2beta.IGetCaseRequest=} [properties] Properties to set - */ - function GetCaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCaseRequest name. - * @member {string} name - * @memberof google.cloud.support.v2beta.GetCaseRequest - * @instance - */ - GetCaseRequest.prototype.name = ""; - - /** - * Creates a new GetCaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.GetCaseRequest - * @static - * @param {google.cloud.support.v2beta.IGetCaseRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.GetCaseRequest} GetCaseRequest instance - */ - GetCaseRequest.create = function create(properties) { - return new GetCaseRequest(properties); - }; - - /** - * Encodes the specified GetCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.GetCaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.GetCaseRequest - * @static - * @param {google.cloud.support.v2beta.IGetCaseRequest} message GetCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCaseRequest.encode = function encode(message, writer) { - 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 GetCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.GetCaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.GetCaseRequest - * @static - * @param {google.cloud.support.v2beta.IGetCaseRequest} message GetCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.GetCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.GetCaseRequest} GetCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.GetCaseRequest(); - 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 GetCaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.GetCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.GetCaseRequest} GetCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCaseRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.GetCaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCaseRequest.verify = function verify(message) { - if (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 GetCaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.GetCaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.GetCaseRequest} GetCaseRequest - */ - GetCaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.GetCaseRequest) - return object; - var message = new $root.google.cloud.support.v2beta.GetCaseRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetCaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.GetCaseRequest - * @static - * @param {google.cloud.support.v2beta.GetCaseRequest} message GetCaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCaseRequest.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 GetCaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.GetCaseRequest - * @instance - * @returns {Object.} JSON object - */ - GetCaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCaseRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.GetCaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.GetCaseRequest"; - }; - - return GetCaseRequest; - })(); - - v2beta.CreateCaseRequest = (function() { - - /** - * Properties of a CreateCaseRequest. - * @memberof google.cloud.support.v2beta - * @interface ICreateCaseRequest - * @property {string|null} [parent] CreateCaseRequest parent - * @property {google.cloud.support.v2beta.ICase|null} ["case"] CreateCaseRequest case - */ - - /** - * Constructs a new CreateCaseRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a CreateCaseRequest. - * @implements ICreateCaseRequest - * @constructor - * @param {google.cloud.support.v2beta.ICreateCaseRequest=} [properties] Properties to set - */ - function CreateCaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateCaseRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2beta.CreateCaseRequest - * @instance - */ - CreateCaseRequest.prototype.parent = ""; - - /** - * CreateCaseRequest case. - * @member {google.cloud.support.v2beta.ICase|null|undefined} case - * @memberof google.cloud.support.v2beta.CreateCaseRequest - * @instance - */ - CreateCaseRequest.prototype["case"] = null; - - /** - * Creates a new CreateCaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.CreateCaseRequest - * @static - * @param {google.cloud.support.v2beta.ICreateCaseRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.CreateCaseRequest} CreateCaseRequest instance - */ - CreateCaseRequest.create = function create(properties) { - return new CreateCaseRequest(properties); - }; - - /** - * Encodes the specified CreateCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.CreateCaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.CreateCaseRequest - * @static - * @param {google.cloud.support.v2beta.ICreateCaseRequest} message CreateCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) - $root.google.cloud.support.v2beta.Case.encode(message["case"], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CreateCaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.CreateCaseRequest - * @static - * @param {google.cloud.support.v2beta.ICreateCaseRequest} message CreateCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.CreateCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.CreateCaseRequest} CreateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.CreateCaseRequest(); - 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["case"] = $root.google.cloud.support.v2beta.Case.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.CreateCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.CreateCaseRequest} CreateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCaseRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.CreateCaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message["case"] != null && message.hasOwnProperty("case")) { - var error = $root.google.cloud.support.v2beta.Case.verify(message["case"]); - if (error) - return "case." + error; - } - return null; - }; - - /** - * Creates a CreateCaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.CreateCaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.CreateCaseRequest} CreateCaseRequest - */ - CreateCaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.CreateCaseRequest) - return object; - var message = new $root.google.cloud.support.v2beta.CreateCaseRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object["case"] != null) { - if (typeof object["case"] !== "object") - throw TypeError(".google.cloud.support.v2beta.CreateCaseRequest.case: object expected"); - message["case"] = $root.google.cloud.support.v2beta.Case.fromObject(object["case"]); - } - return message; - }; - - /** - * Creates a plain object from a CreateCaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.CreateCaseRequest - * @static - * @param {google.cloud.support.v2beta.CreateCaseRequest} message CreateCaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object["case"] = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message["case"] != null && message.hasOwnProperty("case")) - object["case"] = $root.google.cloud.support.v2beta.Case.toObject(message["case"], options); - return object; - }; - - /** - * Converts this CreateCaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.CreateCaseRequest - * @instance - * @returns {Object.} JSON object - */ - CreateCaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCaseRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.CreateCaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.CreateCaseRequest"; - }; - - return CreateCaseRequest; - })(); - - v2beta.ListCasesRequest = (function() { - - /** - * Properties of a ListCasesRequest. - * @memberof google.cloud.support.v2beta - * @interface IListCasesRequest - * @property {string|null} [parent] ListCasesRequest parent - * @property {string|null} [filter] ListCasesRequest filter - * @property {number|null} [pageSize] ListCasesRequest pageSize - * @property {string|null} [pageToken] ListCasesRequest pageToken - * @property {google.cloud.support.v2beta.ProductLine|null} [productLine] ListCasesRequest productLine - */ - - /** - * Constructs a new ListCasesRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a ListCasesRequest. - * @implements IListCasesRequest - * @constructor - * @param {google.cloud.support.v2beta.IListCasesRequest=} [properties] Properties to set - */ - function ListCasesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCasesRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @instance - */ - ListCasesRequest.prototype.parent = ""; - - /** - * ListCasesRequest filter. - * @member {string} filter - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @instance - */ - ListCasesRequest.prototype.filter = ""; - - /** - * ListCasesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @instance - */ - ListCasesRequest.prototype.pageSize = 0; - - /** - * ListCasesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @instance - */ - ListCasesRequest.prototype.pageToken = ""; - - /** - * ListCasesRequest productLine. - * @member {google.cloud.support.v2beta.ProductLine|null|undefined} productLine - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @instance - */ - ListCasesRequest.prototype.productLine = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ListCasesRequest.prototype, "_productLine", { - get: $util.oneOfGetter($oneOfFields = ["productLine"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ListCasesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @static - * @param {google.cloud.support.v2beta.IListCasesRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.ListCasesRequest} ListCasesRequest instance - */ - ListCasesRequest.create = function create(properties) { - return new ListCasesRequest(properties); - }; - - /** - * Encodes the specified ListCasesRequest message. Does not implicitly {@link google.cloud.support.v2beta.ListCasesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @static - * @param {google.cloud.support.v2beta.IListCasesRequest} message ListCasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCasesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - if (message.productLine != null && Object.hasOwnProperty.call(message, "productLine")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.productLine); - return writer; - }; - - /** - * Encodes the specified ListCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCasesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @static - * @param {google.cloud.support.v2beta.IListCasesRequest} message ListCasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCasesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.ListCasesRequest} ListCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCasesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ListCasesRequest(); - 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.filter = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.pageToken = reader.string(); - break; - } - case 8: { - message.productLine = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCasesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.ListCasesRequest} ListCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCasesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCasesRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCasesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: 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"; - if (message.productLine != null && message.hasOwnProperty("productLine")) { - properties._productLine = 1; - switch (message.productLine) { - default: - return "productLine: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - return null; - }; - - /** - * Creates a ListCasesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.ListCasesRequest} ListCasesRequest - */ - ListCasesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.ListCasesRequest) - return object; - var message = new $root.google.cloud.support.v2beta.ListCasesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - 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); - switch (object.productLine) { - default: - if (typeof object.productLine === "number") { - message.productLine = object.productLine; - break; - } - break; - case "PRODUCT_LINE_UNSPECIFIED": - case 0: - message.productLine = 0; - break; - case "GOOGLE_CLOUD": - case 1: - message.productLine = 1; - break; - case "GOOGLE_MAPS": - case 2: - message.productLine = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ListCasesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @static - * @param {google.cloud.support.v2beta.ListCasesRequest} message ListCasesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCasesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - 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.productLine != null && message.hasOwnProperty("productLine")) { - object.productLine = options.enums === String ? $root.google.cloud.support.v2beta.ProductLine[message.productLine] === undefined ? message.productLine : $root.google.cloud.support.v2beta.ProductLine[message.productLine] : message.productLine; - if (options.oneofs) - object._productLine = "productLine"; - } - return object; - }; - - /** - * Converts this ListCasesRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @instance - * @returns {Object.} JSON object - */ - ListCasesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCasesRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.ListCasesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.ListCasesRequest"; - }; - - return ListCasesRequest; - })(); - - v2beta.ListCasesResponse = (function() { - - /** - * Properties of a ListCasesResponse. - * @memberof google.cloud.support.v2beta - * @interface IListCasesResponse - * @property {Array.|null} [cases] ListCasesResponse cases - * @property {string|null} [nextPageToken] ListCasesResponse nextPageToken - */ - - /** - * Constructs a new ListCasesResponse. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a ListCasesResponse. - * @implements IListCasesResponse - * @constructor - * @param {google.cloud.support.v2beta.IListCasesResponse=} [properties] Properties to set - */ - function ListCasesResponse(properties) { - this.cases = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCasesResponse cases. - * @member {Array.} cases - * @memberof google.cloud.support.v2beta.ListCasesResponse - * @instance - */ - ListCasesResponse.prototype.cases = $util.emptyArray; - - /** - * ListCasesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.support.v2beta.ListCasesResponse - * @instance - */ - ListCasesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListCasesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.ListCasesResponse - * @static - * @param {google.cloud.support.v2beta.IListCasesResponse=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.ListCasesResponse} ListCasesResponse instance - */ - ListCasesResponse.create = function create(properties) { - return new ListCasesResponse(properties); - }; - - /** - * Encodes the specified ListCasesResponse message. Does not implicitly {@link google.cloud.support.v2beta.ListCasesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.ListCasesResponse - * @static - * @param {google.cloud.support.v2beta.IListCasesResponse} message ListCasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCasesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cases != null && message.cases.length) - for (var i = 0; i < message.cases.length; ++i) - $root.google.cloud.support.v2beta.Case.encode(message.cases[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 ListCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCasesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.ListCasesResponse - * @static - * @param {google.cloud.support.v2beta.IListCasesResponse} message ListCasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCasesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.ListCasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.ListCasesResponse} ListCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCasesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ListCasesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.cases && message.cases.length)) - message.cases = []; - message.cases.push($root.google.cloud.support.v2beta.Case.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCasesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.ListCasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.ListCasesResponse} ListCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCasesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCasesResponse message. - * @function verify - * @memberof google.cloud.support.v2beta.ListCasesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCasesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cases != null && message.hasOwnProperty("cases")) { - if (!Array.isArray(message.cases)) - return "cases: array expected"; - for (var i = 0; i < message.cases.length; ++i) { - var error = $root.google.cloud.support.v2beta.Case.verify(message.cases[i]); - if (error) - return "cases." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListCasesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.ListCasesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.ListCasesResponse} ListCasesResponse - */ - ListCasesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.ListCasesResponse) - return object; - var message = new $root.google.cloud.support.v2beta.ListCasesResponse(); - if (object.cases) { - if (!Array.isArray(object.cases)) - throw TypeError(".google.cloud.support.v2beta.ListCasesResponse.cases: array expected"); - message.cases = []; - for (var i = 0; i < object.cases.length; ++i) { - if (typeof object.cases[i] !== "object") - throw TypeError(".google.cloud.support.v2beta.ListCasesResponse.cases: object expected"); - message.cases[i] = $root.google.cloud.support.v2beta.Case.fromObject(object.cases[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListCasesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.ListCasesResponse - * @static - * @param {google.cloud.support.v2beta.ListCasesResponse} message ListCasesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCasesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.cases = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.cases && message.cases.length) { - object.cases = []; - for (var j = 0; j < message.cases.length; ++j) - object.cases[j] = $root.google.cloud.support.v2beta.Case.toObject(message.cases[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListCasesResponse to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.ListCasesResponse - * @instance - * @returns {Object.} JSON object - */ - ListCasesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCasesResponse - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.ListCasesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.ListCasesResponse"; - }; - - return ListCasesResponse; - })(); - - v2beta.SearchCasesRequest = (function() { - - /** - * Properties of a SearchCasesRequest. - * @memberof google.cloud.support.v2beta - * @interface ISearchCasesRequest - * @property {string|null} [parent] SearchCasesRequest parent - * @property {string|null} [query] SearchCasesRequest query - * @property {number|null} [pageSize] SearchCasesRequest pageSize - * @property {string|null} [pageToken] SearchCasesRequest pageToken - */ - - /** - * Constructs a new SearchCasesRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a SearchCasesRequest. - * @implements ISearchCasesRequest - * @constructor - * @param {google.cloud.support.v2beta.ISearchCasesRequest=} [properties] Properties to set - */ - function SearchCasesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SearchCasesRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @instance - */ - SearchCasesRequest.prototype.parent = ""; - - /** - * SearchCasesRequest query. - * @member {string} query - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @instance - */ - SearchCasesRequest.prototype.query = ""; - - /** - * SearchCasesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @instance - */ - SearchCasesRequest.prototype.pageSize = 0; - - /** - * SearchCasesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @instance - */ - SearchCasesRequest.prototype.pageToken = ""; - - /** - * Creates a new SearchCasesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @static - * @param {google.cloud.support.v2beta.ISearchCasesRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.SearchCasesRequest} SearchCasesRequest instance - */ - SearchCasesRequest.create = function create(properties) { - return new SearchCasesRequest(properties); - }; - - /** - * Encodes the specified SearchCasesRequest message. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @static - * @param {google.cloud.support.v2beta.ISearchCasesRequest} message SearchCasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCasesRequest.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.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.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); - return writer; - }; - - /** - * Encodes the specified SearchCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @static - * @param {google.cloud.support.v2beta.ISearchCasesRequest} message SearchCasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchCasesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.SearchCasesRequest} SearchCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCasesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.SearchCasesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.parent = reader.string(); - break; - } - case 1: { - message.query = 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 SearchCasesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.SearchCasesRequest} SearchCasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCasesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchCasesRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchCasesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: 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 SearchCasesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.SearchCasesRequest} SearchCasesRequest - */ - SearchCasesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.SearchCasesRequest) - return object; - var message = new $root.google.cloud.support.v2beta.SearchCasesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.query != null) - message.query = String(object.query); - 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 SearchCasesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @static - * @param {google.cloud.support.v2beta.SearchCasesRequest} message SearchCasesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchCasesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.query = ""; - object.pageSize = 0; - object.pageToken = ""; - object.parent = ""; - } - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - return object; - }; - - /** - * Converts this SearchCasesRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @instance - * @returns {Object.} JSON object - */ - SearchCasesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchCasesRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.SearchCasesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.SearchCasesRequest"; - }; - - return SearchCasesRequest; - })(); - - v2beta.SearchCasesResponse = (function() { - - /** - * Properties of a SearchCasesResponse. - * @memberof google.cloud.support.v2beta - * @interface ISearchCasesResponse - * @property {Array.|null} [cases] SearchCasesResponse cases - * @property {string|null} [nextPageToken] SearchCasesResponse nextPageToken - */ - - /** - * Constructs a new SearchCasesResponse. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a SearchCasesResponse. - * @implements ISearchCasesResponse - * @constructor - * @param {google.cloud.support.v2beta.ISearchCasesResponse=} [properties] Properties to set - */ - function SearchCasesResponse(properties) { - this.cases = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SearchCasesResponse cases. - * @member {Array.} cases - * @memberof google.cloud.support.v2beta.SearchCasesResponse - * @instance - */ - SearchCasesResponse.prototype.cases = $util.emptyArray; - - /** - * SearchCasesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.support.v2beta.SearchCasesResponse - * @instance - */ - SearchCasesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new SearchCasesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.SearchCasesResponse - * @static - * @param {google.cloud.support.v2beta.ISearchCasesResponse=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.SearchCasesResponse} SearchCasesResponse instance - */ - SearchCasesResponse.create = function create(properties) { - return new SearchCasesResponse(properties); - }; - - /** - * Encodes the specified SearchCasesResponse message. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.SearchCasesResponse - * @static - * @param {google.cloud.support.v2beta.ISearchCasesResponse} message SearchCasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCasesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cases != null && message.cases.length) - for (var i = 0; i < message.cases.length; ++i) - $root.google.cloud.support.v2beta.Case.encode(message.cases[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 SearchCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCasesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.SearchCasesResponse - * @static - * @param {google.cloud.support.v2beta.ISearchCasesResponse} message SearchCasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchCasesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.SearchCasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.SearchCasesResponse} SearchCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCasesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.SearchCasesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.cases && message.cases.length)) - message.cases = []; - message.cases.push($root.google.cloud.support.v2beta.Case.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchCasesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.SearchCasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.SearchCasesResponse} SearchCasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCasesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchCasesResponse message. - * @function verify - * @memberof google.cloud.support.v2beta.SearchCasesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchCasesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cases != null && message.hasOwnProperty("cases")) { - if (!Array.isArray(message.cases)) - return "cases: array expected"; - for (var i = 0; i < message.cases.length; ++i) { - var error = $root.google.cloud.support.v2beta.Case.verify(message.cases[i]); - if (error) - return "cases." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a SearchCasesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.SearchCasesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.SearchCasesResponse} SearchCasesResponse - */ - SearchCasesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.SearchCasesResponse) - return object; - var message = new $root.google.cloud.support.v2beta.SearchCasesResponse(); - if (object.cases) { - if (!Array.isArray(object.cases)) - throw TypeError(".google.cloud.support.v2beta.SearchCasesResponse.cases: array expected"); - message.cases = []; - for (var i = 0; i < object.cases.length; ++i) { - if (typeof object.cases[i] !== "object") - throw TypeError(".google.cloud.support.v2beta.SearchCasesResponse.cases: object expected"); - message.cases[i] = $root.google.cloud.support.v2beta.Case.fromObject(object.cases[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a SearchCasesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.SearchCasesResponse - * @static - * @param {google.cloud.support.v2beta.SearchCasesResponse} message SearchCasesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchCasesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.cases = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.cases && message.cases.length) { - object.cases = []; - for (var j = 0; j < message.cases.length; ++j) - object.cases[j] = $root.google.cloud.support.v2beta.Case.toObject(message.cases[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this SearchCasesResponse to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.SearchCasesResponse - * @instance - * @returns {Object.} JSON object - */ - SearchCasesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchCasesResponse - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.SearchCasesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.SearchCasesResponse"; - }; - - return SearchCasesResponse; - })(); - - v2beta.EscalateCaseRequest = (function() { - - /** - * Properties of an EscalateCaseRequest. - * @memberof google.cloud.support.v2beta - * @interface IEscalateCaseRequest - * @property {string|null} [name] EscalateCaseRequest name - * @property {google.cloud.support.v2beta.IEscalation|null} [escalation] EscalateCaseRequest escalation - */ - - /** - * Constructs a new EscalateCaseRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents an EscalateCaseRequest. - * @implements IEscalateCaseRequest - * @constructor - * @param {google.cloud.support.v2beta.IEscalateCaseRequest=} [properties] Properties to set - */ - function EscalateCaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EscalateCaseRequest name. - * @member {string} name - * @memberof google.cloud.support.v2beta.EscalateCaseRequest - * @instance - */ - EscalateCaseRequest.prototype.name = ""; - - /** - * EscalateCaseRequest escalation. - * @member {google.cloud.support.v2beta.IEscalation|null|undefined} escalation - * @memberof google.cloud.support.v2beta.EscalateCaseRequest - * @instance - */ - EscalateCaseRequest.prototype.escalation = null; - - /** - * Creates a new EscalateCaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.EscalateCaseRequest - * @static - * @param {google.cloud.support.v2beta.IEscalateCaseRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.EscalateCaseRequest} EscalateCaseRequest instance - */ - EscalateCaseRequest.create = function create(properties) { - return new EscalateCaseRequest(properties); - }; - - /** - * Encodes the specified EscalateCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.EscalateCaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.EscalateCaseRequest - * @static - * @param {google.cloud.support.v2beta.IEscalateCaseRequest} message EscalateCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EscalateCaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.escalation != null && Object.hasOwnProperty.call(message, "escalation")) - $root.google.cloud.support.v2beta.Escalation.encode(message.escalation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EscalateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.EscalateCaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.EscalateCaseRequest - * @static - * @param {google.cloud.support.v2beta.IEscalateCaseRequest} message EscalateCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EscalateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EscalateCaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.EscalateCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.EscalateCaseRequest} EscalateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EscalateCaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.EscalateCaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.escalation = $root.google.cloud.support.v2beta.Escalation.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EscalateCaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.EscalateCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.EscalateCaseRequest} EscalateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EscalateCaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EscalateCaseRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.EscalateCaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EscalateCaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.escalation != null && message.hasOwnProperty("escalation")) { - var error = $root.google.cloud.support.v2beta.Escalation.verify(message.escalation); - if (error) - return "escalation." + error; - } - return null; - }; - - /** - * Creates an EscalateCaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.EscalateCaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.EscalateCaseRequest} EscalateCaseRequest - */ - EscalateCaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.EscalateCaseRequest) - return object; - var message = new $root.google.cloud.support.v2beta.EscalateCaseRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.escalation != null) { - if (typeof object.escalation !== "object") - throw TypeError(".google.cloud.support.v2beta.EscalateCaseRequest.escalation: object expected"); - message.escalation = $root.google.cloud.support.v2beta.Escalation.fromObject(object.escalation); - } - return message; - }; - - /** - * Creates a plain object from an EscalateCaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.EscalateCaseRequest - * @static - * @param {google.cloud.support.v2beta.EscalateCaseRequest} message EscalateCaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EscalateCaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.escalation = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.escalation != null && message.hasOwnProperty("escalation")) - object.escalation = $root.google.cloud.support.v2beta.Escalation.toObject(message.escalation, options); - return object; - }; - - /** - * Converts this EscalateCaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.EscalateCaseRequest - * @instance - * @returns {Object.} JSON object - */ - EscalateCaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EscalateCaseRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.EscalateCaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EscalateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.EscalateCaseRequest"; - }; - - return EscalateCaseRequest; - })(); - - v2beta.UpdateCaseRequest = (function() { - - /** - * Properties of an UpdateCaseRequest. - * @memberof google.cloud.support.v2beta - * @interface IUpdateCaseRequest - * @property {google.cloud.support.v2beta.ICase|null} ["case"] UpdateCaseRequest case - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCaseRequest updateMask - */ - - /** - * Constructs a new UpdateCaseRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents an UpdateCaseRequest. - * @implements IUpdateCaseRequest - * @constructor - * @param {google.cloud.support.v2beta.IUpdateCaseRequest=} [properties] Properties to set - */ - function UpdateCaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateCaseRequest case. - * @member {google.cloud.support.v2beta.ICase|null|undefined} case - * @memberof google.cloud.support.v2beta.UpdateCaseRequest - * @instance - */ - UpdateCaseRequest.prototype["case"] = null; - - /** - * UpdateCaseRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.support.v2beta.UpdateCaseRequest - * @instance - */ - UpdateCaseRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateCaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.UpdateCaseRequest - * @static - * @param {google.cloud.support.v2beta.IUpdateCaseRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.UpdateCaseRequest} UpdateCaseRequest instance - */ - UpdateCaseRequest.create = function create(properties) { - return new UpdateCaseRequest(properties); - }; - - /** - * Encodes the specified UpdateCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.UpdateCaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.UpdateCaseRequest - * @static - * @param {google.cloud.support.v2beta.IUpdateCaseRequest} message UpdateCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) - $root.google.cloud.support.v2beta.Case.encode(message["case"], 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 UpdateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.UpdateCaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.UpdateCaseRequest - * @static - * @param {google.cloud.support.v2beta.IUpdateCaseRequest} message UpdateCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateCaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.UpdateCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.UpdateCaseRequest} UpdateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.UpdateCaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message["case"] = $root.google.cloud.support.v2beta.Case.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 UpdateCaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.UpdateCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.UpdateCaseRequest} UpdateCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateCaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateCaseRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.UpdateCaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateCaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message["case"] != null && message.hasOwnProperty("case")) { - var error = $root.google.cloud.support.v2beta.Case.verify(message["case"]); - if (error) - return "case." + 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 UpdateCaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.UpdateCaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.UpdateCaseRequest} UpdateCaseRequest - */ - UpdateCaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.UpdateCaseRequest) - return object; - var message = new $root.google.cloud.support.v2beta.UpdateCaseRequest(); - if (object["case"] != null) { - if (typeof object["case"] !== "object") - throw TypeError(".google.cloud.support.v2beta.UpdateCaseRequest.case: object expected"); - message["case"] = $root.google.cloud.support.v2beta.Case.fromObject(object["case"]); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.support.v2beta.UpdateCaseRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateCaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.UpdateCaseRequest - * @static - * @param {google.cloud.support.v2beta.UpdateCaseRequest} message UpdateCaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateCaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object["case"] = null; - object.updateMask = null; - } - if (message["case"] != null && message.hasOwnProperty("case")) - object["case"] = $root.google.cloud.support.v2beta.Case.toObject(message["case"], options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateCaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.UpdateCaseRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateCaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateCaseRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.UpdateCaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.UpdateCaseRequest"; - }; - - return UpdateCaseRequest; - })(); - - v2beta.CloseCaseRequest = (function() { - - /** - * Properties of a CloseCaseRequest. - * @memberof google.cloud.support.v2beta - * @interface ICloseCaseRequest - * @property {string|null} [name] CloseCaseRequest name - */ - - /** - * Constructs a new CloseCaseRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a CloseCaseRequest. - * @implements ICloseCaseRequest - * @constructor - * @param {google.cloud.support.v2beta.ICloseCaseRequest=} [properties] Properties to set - */ - function CloseCaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloseCaseRequest name. - * @member {string} name - * @memberof google.cloud.support.v2beta.CloseCaseRequest - * @instance - */ - CloseCaseRequest.prototype.name = ""; - - /** - * Creates a new CloseCaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.CloseCaseRequest - * @static - * @param {google.cloud.support.v2beta.ICloseCaseRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.CloseCaseRequest} CloseCaseRequest instance - */ - CloseCaseRequest.create = function create(properties) { - return new CloseCaseRequest(properties); - }; - - /** - * Encodes the specified CloseCaseRequest message. Does not implicitly {@link google.cloud.support.v2beta.CloseCaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.CloseCaseRequest - * @static - * @param {google.cloud.support.v2beta.ICloseCaseRequest} message CloseCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloseCaseRequest.encode = function encode(message, writer) { - 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 CloseCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CloseCaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.CloseCaseRequest - * @static - * @param {google.cloud.support.v2beta.ICloseCaseRequest} message CloseCaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloseCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloseCaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.CloseCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.CloseCaseRequest} CloseCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloseCaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.CloseCaseRequest(); - 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 CloseCaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.CloseCaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.CloseCaseRequest} CloseCaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloseCaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloseCaseRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.CloseCaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloseCaseRequest.verify = function verify(message) { - if (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 CloseCaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.CloseCaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.CloseCaseRequest} CloseCaseRequest - */ - CloseCaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.CloseCaseRequest) - return object; - var message = new $root.google.cloud.support.v2beta.CloseCaseRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CloseCaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.CloseCaseRequest - * @static - * @param {google.cloud.support.v2beta.CloseCaseRequest} message CloseCaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloseCaseRequest.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 CloseCaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.CloseCaseRequest - * @instance - * @returns {Object.} JSON object - */ - CloseCaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloseCaseRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.CloseCaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloseCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.CloseCaseRequest"; - }; - - return CloseCaseRequest; - })(); - - v2beta.SearchCaseClassificationsRequest = (function() { - - /** - * Properties of a SearchCaseClassificationsRequest. - * @memberof google.cloud.support.v2beta - * @interface ISearchCaseClassificationsRequest - * @property {string|null} [query] SearchCaseClassificationsRequest query - * @property {number|null} [pageSize] SearchCaseClassificationsRequest pageSize - * @property {string|null} [pageToken] SearchCaseClassificationsRequest pageToken - * @property {google.cloud.support.v2beta.IProduct|null} [product] SearchCaseClassificationsRequest product - */ - - /** - * Constructs a new SearchCaseClassificationsRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a SearchCaseClassificationsRequest. - * @implements ISearchCaseClassificationsRequest - * @constructor - * @param {google.cloud.support.v2beta.ISearchCaseClassificationsRequest=} [properties] Properties to set - */ - function SearchCaseClassificationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SearchCaseClassificationsRequest query. - * @member {string} query - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @instance - */ - SearchCaseClassificationsRequest.prototype.query = ""; - - /** - * SearchCaseClassificationsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @instance - */ - SearchCaseClassificationsRequest.prototype.pageSize = 0; - - /** - * SearchCaseClassificationsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @instance - */ - SearchCaseClassificationsRequest.prototype.pageToken = ""; - - /** - * SearchCaseClassificationsRequest product. - * @member {google.cloud.support.v2beta.IProduct|null|undefined} product - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @instance - */ - SearchCaseClassificationsRequest.prototype.product = null; - - /** - * Creates a new SearchCaseClassificationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @static - * @param {google.cloud.support.v2beta.ISearchCaseClassificationsRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest instance - */ - SearchCaseClassificationsRequest.create = function create(properties) { - return new SearchCaseClassificationsRequest(properties); - }; - - /** - * Encodes the specified SearchCaseClassificationsRequest message. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @static - * @param {google.cloud.support.v2beta.ISearchCaseClassificationsRequest} message SearchCaseClassificationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCaseClassificationsRequest.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.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.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.support.v2beta.Product.encode(message.product, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SearchCaseClassificationsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @static - * @param {google.cloud.support.v2beta.ISearchCaseClassificationsRequest} message SearchCaseClassificationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCaseClassificationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCaseClassificationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.SearchCaseClassificationsRequest(); - 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.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 7: { - message.product = $root.google.cloud.support.v2beta.Product.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCaseClassificationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchCaseClassificationsRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchCaseClassificationsRequest.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.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.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.support.v2beta.Product.verify(message.product); - if (error) - return "product." + error; - } - return null; - }; - - /** - * Creates a SearchCaseClassificationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest - */ - SearchCaseClassificationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.SearchCaseClassificationsRequest) - return object; - var message = new $root.google.cloud.support.v2beta.SearchCaseClassificationsRequest(); - if (object.query != null) - message.query = String(object.query); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.support.v2beta.SearchCaseClassificationsRequest.product: object expected"); - message.product = $root.google.cloud.support.v2beta.Product.fromObject(object.product); - } - return message; - }; - - /** - * Creates a plain object from a SearchCaseClassificationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @static - * @param {google.cloud.support.v2beta.SearchCaseClassificationsRequest} message SearchCaseClassificationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchCaseClassificationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.query = ""; - object.pageSize = 0; - object.pageToken = ""; - object.product = null; - } - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.support.v2beta.Product.toObject(message.product, options); - return object; - }; - - /** - * Converts this SearchCaseClassificationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @instance - * @returns {Object.} JSON object - */ - SearchCaseClassificationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchCaseClassificationsRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchCaseClassificationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.SearchCaseClassificationsRequest"; - }; - - return SearchCaseClassificationsRequest; - })(); - - v2beta.SearchCaseClassificationsResponse = (function() { - - /** - * Properties of a SearchCaseClassificationsResponse. - * @memberof google.cloud.support.v2beta - * @interface ISearchCaseClassificationsResponse - * @property {Array.|null} [caseClassifications] SearchCaseClassificationsResponse caseClassifications - * @property {string|null} [nextPageToken] SearchCaseClassificationsResponse nextPageToken - */ - - /** - * Constructs a new SearchCaseClassificationsResponse. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a SearchCaseClassificationsResponse. - * @implements ISearchCaseClassificationsResponse - * @constructor - * @param {google.cloud.support.v2beta.ISearchCaseClassificationsResponse=} [properties] Properties to set - */ - function SearchCaseClassificationsResponse(properties) { - this.caseClassifications = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SearchCaseClassificationsResponse caseClassifications. - * @member {Array.} caseClassifications - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse - * @instance - */ - SearchCaseClassificationsResponse.prototype.caseClassifications = $util.emptyArray; - - /** - * SearchCaseClassificationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse - * @instance - */ - SearchCaseClassificationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new SearchCaseClassificationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse - * @static - * @param {google.cloud.support.v2beta.ISearchCaseClassificationsResponse=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse instance - */ - SearchCaseClassificationsResponse.create = function create(properties) { - return new SearchCaseClassificationsResponse(properties); - }; - - /** - * Encodes the specified SearchCaseClassificationsResponse message. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse - * @static - * @param {google.cloud.support.v2beta.ISearchCaseClassificationsResponse} message SearchCaseClassificationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCaseClassificationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.caseClassifications != null && message.caseClassifications.length) - for (var i = 0; i < message.caseClassifications.length; ++i) - $root.google.cloud.support.v2beta.CaseClassification.encode(message.caseClassifications[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 SearchCaseClassificationsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.SearchCaseClassificationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse - * @static - * @param {google.cloud.support.v2beta.ISearchCaseClassificationsResponse} message SearchCaseClassificationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchCaseClassificationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCaseClassificationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.SearchCaseClassificationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.caseClassifications && message.caseClassifications.length)) - message.caseClassifications = []; - message.caseClassifications.push($root.google.cloud.support.v2beta.CaseClassification.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchCaseClassificationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchCaseClassificationsResponse message. - * @function verify - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchCaseClassificationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.caseClassifications != null && message.hasOwnProperty("caseClassifications")) { - if (!Array.isArray(message.caseClassifications)) - return "caseClassifications: array expected"; - for (var i = 0; i < message.caseClassifications.length; ++i) { - var error = $root.google.cloud.support.v2beta.CaseClassification.verify(message.caseClassifications[i]); - if (error) - return "caseClassifications." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a SearchCaseClassificationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse - */ - SearchCaseClassificationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.SearchCaseClassificationsResponse) - return object; - var message = new $root.google.cloud.support.v2beta.SearchCaseClassificationsResponse(); - if (object.caseClassifications) { - if (!Array.isArray(object.caseClassifications)) - throw TypeError(".google.cloud.support.v2beta.SearchCaseClassificationsResponse.caseClassifications: array expected"); - message.caseClassifications = []; - for (var i = 0; i < object.caseClassifications.length; ++i) { - if (typeof object.caseClassifications[i] !== "object") - throw TypeError(".google.cloud.support.v2beta.SearchCaseClassificationsResponse.caseClassifications: object expected"); - message.caseClassifications[i] = $root.google.cloud.support.v2beta.CaseClassification.fromObject(object.caseClassifications[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a SearchCaseClassificationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse - * @static - * @param {google.cloud.support.v2beta.SearchCaseClassificationsResponse} message SearchCaseClassificationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchCaseClassificationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.caseClassifications = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.caseClassifications && message.caseClassifications.length) { - object.caseClassifications = []; - for (var j = 0; j < message.caseClassifications.length; ++j) - object.caseClassifications[j] = $root.google.cloud.support.v2beta.CaseClassification.toObject(message.caseClassifications[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this SearchCaseClassificationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse - * @instance - * @returns {Object.} JSON object - */ - SearchCaseClassificationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchCaseClassificationsResponse - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.SearchCaseClassificationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchCaseClassificationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.SearchCaseClassificationsResponse"; - }; - - return SearchCaseClassificationsResponse; - })(); - - v2beta.Escalation = (function() { - - /** - * Properties of an Escalation. - * @memberof google.cloud.support.v2beta - * @interface IEscalation - * @property {google.cloud.support.v2beta.Escalation.Reason|null} [reason] Escalation reason - * @property {string|null} [justification] Escalation justification - */ - - /** - * Constructs a new Escalation. - * @memberof google.cloud.support.v2beta - * @classdesc Represents an Escalation. - * @implements IEscalation - * @constructor - * @param {google.cloud.support.v2beta.IEscalation=} [properties] Properties to set - */ - function Escalation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Escalation reason. - * @member {google.cloud.support.v2beta.Escalation.Reason} reason - * @memberof google.cloud.support.v2beta.Escalation - * @instance - */ - Escalation.prototype.reason = 0; - - /** - * Escalation justification. - * @member {string} justification - * @memberof google.cloud.support.v2beta.Escalation - * @instance - */ - Escalation.prototype.justification = ""; - - /** - * Creates a new Escalation instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.Escalation - * @static - * @param {google.cloud.support.v2beta.IEscalation=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.Escalation} Escalation instance - */ - Escalation.create = function create(properties) { - return new Escalation(properties); - }; - - /** - * Encodes the specified Escalation message. Does not implicitly {@link google.cloud.support.v2beta.Escalation.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.Escalation - * @static - * @param {google.cloud.support.v2beta.IEscalation} message Escalation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Escalation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.reason); - if (message.justification != null && Object.hasOwnProperty.call(message, "justification")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.justification); - return writer; - }; - - /** - * Encodes the specified Escalation message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Escalation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.Escalation - * @static - * @param {google.cloud.support.v2beta.IEscalation} message Escalation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Escalation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Escalation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.Escalation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.Escalation} Escalation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Escalation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.Escalation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.reason = reader.int32(); - break; - } - case 5: { - message.justification = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Escalation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.Escalation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.Escalation} Escalation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Escalation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Escalation message. - * @function verify - * @memberof google.cloud.support.v2beta.Escalation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Escalation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.reason != null && message.hasOwnProperty("reason")) - switch (message.reason) { - default: - return "reason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.justification != null && message.hasOwnProperty("justification")) - if (!$util.isString(message.justification)) - return "justification: string expected"; - return null; - }; - - /** - * Creates an Escalation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.Escalation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.Escalation} Escalation - */ - Escalation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.Escalation) - return object; - var message = new $root.google.cloud.support.v2beta.Escalation(); - switch (object.reason) { - default: - if (typeof object.reason === "number") { - message.reason = object.reason; - break; - } - break; - case "REASON_UNSPECIFIED": - case 0: - message.reason = 0; - break; - case "RESOLUTION_TIME": - case 1: - message.reason = 1; - break; - case "TECHNICAL_EXPERTISE": - case 2: - message.reason = 2; - break; - case "BUSINESS_IMPACT": - case 3: - message.reason = 3; - break; - } - if (object.justification != null) - message.justification = String(object.justification); - return message; - }; - - /** - * Creates a plain object from an Escalation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.Escalation - * @static - * @param {google.cloud.support.v2beta.Escalation} message Escalation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Escalation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.reason = options.enums === String ? "REASON_UNSPECIFIED" : 0; - object.justification = ""; - } - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = options.enums === String ? $root.google.cloud.support.v2beta.Escalation.Reason[message.reason] === undefined ? message.reason : $root.google.cloud.support.v2beta.Escalation.Reason[message.reason] : message.reason; - if (message.justification != null && message.hasOwnProperty("justification")) - object.justification = message.justification; - return object; - }; - - /** - * Converts this Escalation to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.Escalation - * @instance - * @returns {Object.} JSON object - */ - Escalation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Escalation - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.Escalation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Escalation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.Escalation"; - }; - - /** - * Reason enum. - * @name google.cloud.support.v2beta.Escalation.Reason - * @enum {number} - * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value - * @property {number} RESOLUTION_TIME=1 RESOLUTION_TIME value - * @property {number} TECHNICAL_EXPERTISE=2 TECHNICAL_EXPERTISE value - * @property {number} BUSINESS_IMPACT=3 BUSINESS_IMPACT value - */ - Escalation.Reason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOLUTION_TIME"] = 1; - values[valuesById[2] = "TECHNICAL_EXPERTISE"] = 2; - values[valuesById[3] = "BUSINESS_IMPACT"] = 3; - return values; - })(); - - return Escalation; - })(); - - v2beta.Comment = (function() { - - /** - * Properties of a Comment. - * @memberof google.cloud.support.v2beta - * @interface IComment - * @property {string|null} [name] Comment name - * @property {google.protobuf.ITimestamp|null} [createTime] Comment createTime - * @property {google.cloud.support.v2beta.IActor|null} [creator] Comment creator - * @property {string|null} [body] Comment body - * @property {string|null} [plainTextBody] Comment plainTextBody - */ - - /** - * Constructs a new Comment. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a Comment. - * @implements IComment - * @constructor - * @param {google.cloud.support.v2beta.IComment=} [properties] Properties to set - */ - function Comment(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Comment name. - * @member {string} name - * @memberof google.cloud.support.v2beta.Comment - * @instance - */ - Comment.prototype.name = ""; - - /** - * Comment createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.support.v2beta.Comment - * @instance - */ - Comment.prototype.createTime = null; - - /** - * Comment creator. - * @member {google.cloud.support.v2beta.IActor|null|undefined} creator - * @memberof google.cloud.support.v2beta.Comment - * @instance - */ - Comment.prototype.creator = null; - - /** - * Comment body. - * @member {string} body - * @memberof google.cloud.support.v2beta.Comment - * @instance - */ - Comment.prototype.body = ""; - - /** - * Comment plainTextBody. - * @member {string} plainTextBody - * @memberof google.cloud.support.v2beta.Comment - * @instance - */ - Comment.prototype.plainTextBody = ""; - - /** - * Creates a new Comment instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.Comment - * @static - * @param {google.cloud.support.v2beta.IComment=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.Comment} Comment instance - */ - Comment.create = function create(properties) { - return new Comment(properties); - }; - - /** - * Encodes the specified Comment message. Does not implicitly {@link google.cloud.support.v2beta.Comment.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.Comment - * @static - * @param {google.cloud.support.v2beta.IComment} message Comment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Comment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - $root.google.cloud.support.v2beta.Actor.encode(message.creator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.body); - if (message.plainTextBody != null && Object.hasOwnProperty.call(message, "plainTextBody")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plainTextBody); - return writer; - }; - - /** - * Encodes the specified Comment message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.Comment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.Comment - * @static - * @param {google.cloud.support.v2beta.IComment} message Comment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Comment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Comment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.Comment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.Comment} Comment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Comment.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.Comment(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.creator = $root.google.cloud.support.v2beta.Actor.decode(reader, reader.uint32()); - break; - } - case 4: { - message.body = reader.string(); - break; - } - case 5: { - message.plainTextBody = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Comment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.Comment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.Comment} Comment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Comment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Comment message. - * @function verify - * @memberof google.cloud.support.v2beta.Comment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Comment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: 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.creator != null && message.hasOwnProperty("creator")) { - var error = $root.google.cloud.support.v2beta.Actor.verify(message.creator); - if (error) - return "creator." + error; - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.plainTextBody != null && message.hasOwnProperty("plainTextBody")) - if (!$util.isString(message.plainTextBody)) - return "plainTextBody: string expected"; - return null; - }; - - /** - * Creates a Comment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.Comment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.Comment} Comment - */ - Comment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.Comment) - return object; - var message = new $root.google.cloud.support.v2beta.Comment(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.support.v2beta.Comment.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.creator != null) { - if (typeof object.creator !== "object") - throw TypeError(".google.cloud.support.v2beta.Comment.creator: object expected"); - message.creator = $root.google.cloud.support.v2beta.Actor.fromObject(object.creator); - } - if (object.body != null) - message.body = String(object.body); - if (object.plainTextBody != null) - message.plainTextBody = String(object.plainTextBody); - return message; - }; - - /** - * Creates a plain object from a Comment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.Comment - * @static - * @param {google.cloud.support.v2beta.Comment} message Comment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Comment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.creator = null; - object.body = ""; - object.plainTextBody = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = $root.google.cloud.support.v2beta.Actor.toObject(message.creator, options); - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.plainTextBody != null && message.hasOwnProperty("plainTextBody")) - object.plainTextBody = message.plainTextBody; - return object; - }; - - /** - * Converts this Comment to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.Comment - * @instance - * @returns {Object.} JSON object - */ - Comment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Comment - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.Comment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Comment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.Comment"; - }; - - return Comment; - })(); - - v2beta.CommentService = (function() { - - /** - * Constructs a new CommentService service. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a CommentService - * @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 CommentService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CommentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CommentService; - - /** - * Creates new CommentService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.support.v2beta.CommentService - * @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 {CommentService} RPC service. Useful where requests and/or responses are streamed. - */ - CommentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.support.v2beta.CommentService|listComments}. - * @memberof google.cloud.support.v2beta.CommentService - * @typedef ListCommentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.ListCommentsResponse} [response] ListCommentsResponse - */ - - /** - * Calls ListComments. - * @function listComments - * @memberof google.cloud.support.v2beta.CommentService - * @instance - * @param {google.cloud.support.v2beta.IListCommentsRequest} request ListCommentsRequest message or plain object - * @param {google.cloud.support.v2beta.CommentService.ListCommentsCallback} callback Node-style callback called with the error, if any, and ListCommentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CommentService.prototype.listComments = function listComments(request, callback) { - return this.rpcCall(listComments, $root.google.cloud.support.v2beta.ListCommentsRequest, $root.google.cloud.support.v2beta.ListCommentsResponse, request, callback); - }, "name", { value: "ListComments" }); - - /** - * Calls ListComments. - * @function listComments - * @memberof google.cloud.support.v2beta.CommentService - * @instance - * @param {google.cloud.support.v2beta.IListCommentsRequest} request ListCommentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2beta.CommentService|createComment}. - * @memberof google.cloud.support.v2beta.CommentService - * @typedef CreateCommentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.Comment} [response] Comment - */ - - /** - * Calls CreateComment. - * @function createComment - * @memberof google.cloud.support.v2beta.CommentService - * @instance - * @param {google.cloud.support.v2beta.ICreateCommentRequest} request CreateCommentRequest message or plain object - * @param {google.cloud.support.v2beta.CommentService.CreateCommentCallback} callback Node-style callback called with the error, if any, and Comment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CommentService.prototype.createComment = function createComment(request, callback) { - return this.rpcCall(createComment, $root.google.cloud.support.v2beta.CreateCommentRequest, $root.google.cloud.support.v2beta.Comment, request, callback); - }, "name", { value: "CreateComment" }); - - /** - * Calls CreateComment. - * @function createComment - * @memberof google.cloud.support.v2beta.CommentService - * @instance - * @param {google.cloud.support.v2beta.ICreateCommentRequest} request CreateCommentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.support.v2beta.CommentService|getComment}. - * @memberof google.cloud.support.v2beta.CommentService - * @typedef GetCommentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.Comment} [response] Comment - */ - - /** - * Calls GetComment. - * @function getComment - * @memberof google.cloud.support.v2beta.CommentService - * @instance - * @param {google.cloud.support.v2beta.IGetCommentRequest} request GetCommentRequest message or plain object - * @param {google.cloud.support.v2beta.CommentService.GetCommentCallback} callback Node-style callback called with the error, if any, and Comment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CommentService.prototype.getComment = function getComment(request, callback) { - return this.rpcCall(getComment, $root.google.cloud.support.v2beta.GetCommentRequest, $root.google.cloud.support.v2beta.Comment, request, callback); - }, "name", { value: "GetComment" }); - - /** - * Calls GetComment. - * @function getComment - * @memberof google.cloud.support.v2beta.CommentService - * @instance - * @param {google.cloud.support.v2beta.IGetCommentRequest} request GetCommentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CommentService; - })(); - - v2beta.ListCommentsRequest = (function() { - - /** - * Properties of a ListCommentsRequest. - * @memberof google.cloud.support.v2beta - * @interface IListCommentsRequest - * @property {string|null} [parent] ListCommentsRequest parent - * @property {number|null} [pageSize] ListCommentsRequest pageSize - * @property {string|null} [pageToken] ListCommentsRequest pageToken - */ - - /** - * Constructs a new ListCommentsRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a ListCommentsRequest. - * @implements IListCommentsRequest - * @constructor - * @param {google.cloud.support.v2beta.IListCommentsRequest=} [properties] Properties to set - */ - function ListCommentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCommentsRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @instance - */ - ListCommentsRequest.prototype.parent = ""; - - /** - * ListCommentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @instance - */ - ListCommentsRequest.prototype.pageSize = 0; - - /** - * ListCommentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @instance - */ - ListCommentsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListCommentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @static - * @param {google.cloud.support.v2beta.IListCommentsRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.ListCommentsRequest} ListCommentsRequest instance - */ - ListCommentsRequest.create = function create(properties) { - return new ListCommentsRequest(properties); - }; - - /** - * Encodes the specified ListCommentsRequest message. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @static - * @param {google.cloud.support.v2beta.IListCommentsRequest} message ListCommentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCommentsRequest.encode = function encode(message, writer) { - if (!writer) - 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 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListCommentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @static - * @param {google.cloud.support.v2beta.IListCommentsRequest} message ListCommentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCommentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCommentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.ListCommentsRequest} ListCommentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCommentsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ListCommentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCommentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.ListCommentsRequest} ListCommentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCommentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCommentsRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCommentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListCommentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.ListCommentsRequest} ListCommentsRequest - */ - ListCommentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.ListCommentsRequest) - return object; - var message = new $root.google.cloud.support.v2beta.ListCommentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListCommentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @static - * @param {google.cloud.support.v2beta.ListCommentsRequest} message ListCommentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCommentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListCommentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListCommentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCommentsRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.ListCommentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCommentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.ListCommentsRequest"; - }; - - return ListCommentsRequest; - })(); - - v2beta.ListCommentsResponse = (function() { - - /** - * Properties of a ListCommentsResponse. - * @memberof google.cloud.support.v2beta - * @interface IListCommentsResponse - * @property {Array.|null} [comments] ListCommentsResponse comments - * @property {string|null} [nextPageToken] ListCommentsResponse nextPageToken - */ - - /** - * Constructs a new ListCommentsResponse. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a ListCommentsResponse. - * @implements IListCommentsResponse - * @constructor - * @param {google.cloud.support.v2beta.IListCommentsResponse=} [properties] Properties to set - */ - function ListCommentsResponse(properties) { - this.comments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCommentsResponse comments. - * @member {Array.} comments - * @memberof google.cloud.support.v2beta.ListCommentsResponse - * @instance - */ - ListCommentsResponse.prototype.comments = $util.emptyArray; - - /** - * ListCommentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.support.v2beta.ListCommentsResponse - * @instance - */ - ListCommentsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListCommentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.ListCommentsResponse - * @static - * @param {google.cloud.support.v2beta.IListCommentsResponse=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.ListCommentsResponse} ListCommentsResponse instance - */ - ListCommentsResponse.create = function create(properties) { - return new ListCommentsResponse(properties); - }; - - /** - * Encodes the specified ListCommentsResponse message. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.ListCommentsResponse - * @static - * @param {google.cloud.support.v2beta.IListCommentsResponse} message ListCommentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCommentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.comments != null && message.comments.length) - for (var i = 0; i < message.comments.length; ++i) - $root.google.cloud.support.v2beta.Comment.encode(message.comments[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 ListCommentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ListCommentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.ListCommentsResponse - * @static - * @param {google.cloud.support.v2beta.IListCommentsResponse} message ListCommentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListCommentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListCommentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.ListCommentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.ListCommentsResponse} ListCommentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCommentsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ListCommentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.comments && message.comments.length)) - message.comments = []; - message.comments.push($root.google.cloud.support.v2beta.Comment.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListCommentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.ListCommentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.ListCommentsResponse} ListCommentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListCommentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListCommentsResponse message. - * @function verify - * @memberof google.cloud.support.v2beta.ListCommentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListCommentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.comments != null && message.hasOwnProperty("comments")) { - if (!Array.isArray(message.comments)) - return "comments: array expected"; - for (var i = 0; i < message.comments.length; ++i) { - var error = $root.google.cloud.support.v2beta.Comment.verify(message.comments[i]); - if (error) - return "comments." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListCommentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.ListCommentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.ListCommentsResponse} ListCommentsResponse - */ - ListCommentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.ListCommentsResponse) - return object; - var message = new $root.google.cloud.support.v2beta.ListCommentsResponse(); - if (object.comments) { - if (!Array.isArray(object.comments)) - throw TypeError(".google.cloud.support.v2beta.ListCommentsResponse.comments: array expected"); - message.comments = []; - for (var i = 0; i < object.comments.length; ++i) { - if (typeof object.comments[i] !== "object") - throw TypeError(".google.cloud.support.v2beta.ListCommentsResponse.comments: object expected"); - message.comments[i] = $root.google.cloud.support.v2beta.Comment.fromObject(object.comments[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListCommentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.ListCommentsResponse - * @static - * @param {google.cloud.support.v2beta.ListCommentsResponse} message ListCommentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListCommentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.comments = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.comments && message.comments.length) { - object.comments = []; - for (var j = 0; j < message.comments.length; ++j) - object.comments[j] = $root.google.cloud.support.v2beta.Comment.toObject(message.comments[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListCommentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.ListCommentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListCommentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListCommentsResponse - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.ListCommentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListCommentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.ListCommentsResponse"; - }; - - return ListCommentsResponse; - })(); - - v2beta.CreateCommentRequest = (function() { - - /** - * Properties of a CreateCommentRequest. - * @memberof google.cloud.support.v2beta - * @interface ICreateCommentRequest - * @property {string|null} [parent] CreateCommentRequest parent - * @property {google.cloud.support.v2beta.IComment|null} [comment] CreateCommentRequest comment - */ - - /** - * Constructs a new CreateCommentRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a CreateCommentRequest. - * @implements ICreateCommentRequest - * @constructor - * @param {google.cloud.support.v2beta.ICreateCommentRequest=} [properties] Properties to set - */ - function CreateCommentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateCommentRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2beta.CreateCommentRequest - * @instance - */ - CreateCommentRequest.prototype.parent = ""; - - /** - * CreateCommentRequest comment. - * @member {google.cloud.support.v2beta.IComment|null|undefined} comment - * @memberof google.cloud.support.v2beta.CreateCommentRequest - * @instance - */ - CreateCommentRequest.prototype.comment = null; - - /** - * Creates a new CreateCommentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.CreateCommentRequest - * @static - * @param {google.cloud.support.v2beta.ICreateCommentRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.CreateCommentRequest} CreateCommentRequest instance - */ - CreateCommentRequest.create = function create(properties) { - return new CreateCommentRequest(properties); - }; - - /** - * Encodes the specified CreateCommentRequest message. Does not implicitly {@link google.cloud.support.v2beta.CreateCommentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.CreateCommentRequest - * @static - * @param {google.cloud.support.v2beta.ICreateCommentRequest} message CreateCommentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCommentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) - $root.google.cloud.support.v2beta.Comment.encode(message.comment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.CreateCommentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.CreateCommentRequest - * @static - * @param {google.cloud.support.v2beta.ICreateCommentRequest} message CreateCommentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateCommentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateCommentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.CreateCommentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.CreateCommentRequest} CreateCommentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCommentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.CreateCommentRequest(); - 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.comment = $root.google.cloud.support.v2beta.Comment.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateCommentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.CreateCommentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.CreateCommentRequest} CreateCommentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateCommentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateCommentRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.CreateCommentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateCommentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.comment != null && message.hasOwnProperty("comment")) { - var error = $root.google.cloud.support.v2beta.Comment.verify(message.comment); - if (error) - return "comment." + error; - } - return null; - }; - - /** - * Creates a CreateCommentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.CreateCommentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.CreateCommentRequest} CreateCommentRequest - */ - CreateCommentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.CreateCommentRequest) - return object; - var message = new $root.google.cloud.support.v2beta.CreateCommentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.comment != null) { - if (typeof object.comment !== "object") - throw TypeError(".google.cloud.support.v2beta.CreateCommentRequest.comment: object expected"); - message.comment = $root.google.cloud.support.v2beta.Comment.fromObject(object.comment); - } - return message; - }; - - /** - * Creates a plain object from a CreateCommentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.CreateCommentRequest - * @static - * @param {google.cloud.support.v2beta.CreateCommentRequest} message CreateCommentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateCommentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.comment = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.comment != null && message.hasOwnProperty("comment")) - object.comment = $root.google.cloud.support.v2beta.Comment.toObject(message.comment, options); - return object; - }; - - /** - * Converts this CreateCommentRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.CreateCommentRequest - * @instance - * @returns {Object.} JSON object - */ - CreateCommentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateCommentRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.CreateCommentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateCommentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.CreateCommentRequest"; - }; - - return CreateCommentRequest; - })(); - - v2beta.GetCommentRequest = (function() { - - /** - * Properties of a GetCommentRequest. - * @memberof google.cloud.support.v2beta - * @interface IGetCommentRequest - * @property {string|null} [name] GetCommentRequest name - */ - - /** - * Constructs a new GetCommentRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a GetCommentRequest. - * @implements IGetCommentRequest - * @constructor - * @param {google.cloud.support.v2beta.IGetCommentRequest=} [properties] Properties to set - */ - function GetCommentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCommentRequest name. - * @member {string} name - * @memberof google.cloud.support.v2beta.GetCommentRequest - * @instance - */ - GetCommentRequest.prototype.name = ""; - - /** - * Creates a new GetCommentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.GetCommentRequest - * @static - * @param {google.cloud.support.v2beta.IGetCommentRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.GetCommentRequest} GetCommentRequest instance - */ - GetCommentRequest.create = function create(properties) { - return new GetCommentRequest(properties); - }; - - /** - * Encodes the specified GetCommentRequest message. Does not implicitly {@link google.cloud.support.v2beta.GetCommentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.GetCommentRequest - * @static - * @param {google.cloud.support.v2beta.IGetCommentRequest} message GetCommentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCommentRequest.encode = function encode(message, writer) { - 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 GetCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.GetCommentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.GetCommentRequest - * @static - * @param {google.cloud.support.v2beta.IGetCommentRequest} message GetCommentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCommentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCommentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.GetCommentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.GetCommentRequest} GetCommentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCommentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.GetCommentRequest(); - 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 GetCommentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.GetCommentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.GetCommentRequest} GetCommentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCommentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCommentRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.GetCommentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCommentRequest.verify = function verify(message) { - if (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 GetCommentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.GetCommentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.GetCommentRequest} GetCommentRequest - */ - GetCommentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.GetCommentRequest) - return object; - var message = new $root.google.cloud.support.v2beta.GetCommentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetCommentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.GetCommentRequest - * @static - * @param {google.cloud.support.v2beta.GetCommentRequest} message GetCommentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCommentRequest.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 GetCommentRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.GetCommentRequest - * @instance - * @returns {Object.} JSON object - */ - GetCommentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetCommentRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.GetCommentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetCommentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.GetCommentRequest"; - }; - - return GetCommentRequest; - })(); - - v2beta.TextContent = (function() { - - /** - * Properties of a TextContent. - * @memberof google.cloud.support.v2beta - * @interface ITextContent - * @property {string|null} [plainText] TextContent plainText - */ - - /** - * Constructs a new TextContent. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a TextContent. - * @implements ITextContent - * @constructor - * @param {google.cloud.support.v2beta.ITextContent=} [properties] Properties to set - */ - function TextContent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TextContent plainText. - * @member {string} plainText - * @memberof google.cloud.support.v2beta.TextContent - * @instance - */ - TextContent.prototype.plainText = ""; - - /** - * Creates a new TextContent instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.TextContent - * @static - * @param {google.cloud.support.v2beta.ITextContent=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.TextContent} TextContent instance - */ - TextContent.create = function create(properties) { - return new TextContent(properties); - }; - - /** - * Encodes the specified TextContent message. Does not implicitly {@link google.cloud.support.v2beta.TextContent.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.TextContent - * @static - * @param {google.cloud.support.v2beta.ITextContent} message TextContent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextContent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.plainText != null && Object.hasOwnProperty.call(message, "plainText")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.plainText); - return writer; - }; - - /** - * Encodes the specified TextContent message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.TextContent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.TextContent - * @static - * @param {google.cloud.support.v2beta.ITextContent} message TextContent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextContent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TextContent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.TextContent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.TextContent} TextContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextContent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.TextContent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.plainText = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TextContent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.TextContent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.TextContent} TextContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextContent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TextContent message. - * @function verify - * @memberof google.cloud.support.v2beta.TextContent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextContent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.plainText != null && message.hasOwnProperty("plainText")) - if (!$util.isString(message.plainText)) - return "plainText: string expected"; - return null; - }; - - /** - * Creates a TextContent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.TextContent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.TextContent} TextContent - */ - TextContent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.TextContent) - return object; - var message = new $root.google.cloud.support.v2beta.TextContent(); - if (object.plainText != null) - message.plainText = String(object.plainText); - return message; - }; - - /** - * Creates a plain object from a TextContent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.TextContent - * @static - * @param {google.cloud.support.v2beta.TextContent} message TextContent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextContent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.plainText = ""; - if (message.plainText != null && message.hasOwnProperty("plainText")) - object.plainText = message.plainText; - return object; - }; - - /** - * Converts this TextContent to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.TextContent - * @instance - * @returns {Object.} JSON object - */ - TextContent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TextContent - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.TextContent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.TextContent"; - }; - - return TextContent; - })(); - - v2beta.EmailMessage = (function() { - - /** - * Properties of an EmailMessage. - * @memberof google.cloud.support.v2beta - * @interface IEmailMessage - * @property {string|null} [name] EmailMessage name - * @property {google.protobuf.ITimestamp|null} [createTime] EmailMessage createTime - * @property {google.cloud.support.v2beta.IActor|null} [actor] EmailMessage actor - * @property {string|null} [subject] EmailMessage subject - * @property {Array.|null} [recipientEmailAddresses] EmailMessage recipientEmailAddresses - * @property {Array.|null} [ccEmailAddresses] EmailMessage ccEmailAddresses - * @property {google.cloud.support.v2beta.ITextContent|null} [bodyContent] EmailMessage bodyContent - */ - - /** - * Constructs a new EmailMessage. - * @memberof google.cloud.support.v2beta - * @classdesc Represents an EmailMessage. - * @implements IEmailMessage - * @constructor - * @param {google.cloud.support.v2beta.IEmailMessage=} [properties] Properties to set - */ - function EmailMessage(properties) { - this.recipientEmailAddresses = []; - this.ccEmailAddresses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EmailMessage name. - * @member {string} name - * @memberof google.cloud.support.v2beta.EmailMessage - * @instance - */ - EmailMessage.prototype.name = ""; - - /** - * EmailMessage createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.support.v2beta.EmailMessage - * @instance - */ - EmailMessage.prototype.createTime = null; - - /** - * EmailMessage actor. - * @member {google.cloud.support.v2beta.IActor|null|undefined} actor - * @memberof google.cloud.support.v2beta.EmailMessage - * @instance - */ - EmailMessage.prototype.actor = null; - - /** - * EmailMessage subject. - * @member {string} subject - * @memberof google.cloud.support.v2beta.EmailMessage - * @instance - */ - EmailMessage.prototype.subject = ""; - - /** - * EmailMessage recipientEmailAddresses. - * @member {Array.} recipientEmailAddresses - * @memberof google.cloud.support.v2beta.EmailMessage - * @instance - */ - EmailMessage.prototype.recipientEmailAddresses = $util.emptyArray; - - /** - * EmailMessage ccEmailAddresses. - * @member {Array.} ccEmailAddresses - * @memberof google.cloud.support.v2beta.EmailMessage - * @instance - */ - EmailMessage.prototype.ccEmailAddresses = $util.emptyArray; - - /** - * EmailMessage bodyContent. - * @member {google.cloud.support.v2beta.ITextContent|null|undefined} bodyContent - * @memberof google.cloud.support.v2beta.EmailMessage - * @instance - */ - EmailMessage.prototype.bodyContent = null; - - /** - * Creates a new EmailMessage instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.EmailMessage - * @static - * @param {google.cloud.support.v2beta.IEmailMessage=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.EmailMessage} EmailMessage instance - */ - EmailMessage.create = function create(properties) { - return new EmailMessage(properties); - }; - - /** - * Encodes the specified EmailMessage message. Does not implicitly {@link google.cloud.support.v2beta.EmailMessage.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.EmailMessage - * @static - * @param {google.cloud.support.v2beta.IEmailMessage} message EmailMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmailMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.actor != null && Object.hasOwnProperty.call(message, "actor")) - $root.google.cloud.support.v2beta.Actor.encode(message.actor, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.subject); - if (message.recipientEmailAddresses != null && message.recipientEmailAddresses.length) - for (var i = 0; i < message.recipientEmailAddresses.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.recipientEmailAddresses[i]); - if (message.ccEmailAddresses != null && message.ccEmailAddresses.length) - for (var i = 0; i < message.ccEmailAddresses.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.ccEmailAddresses[i]); - if (message.bodyContent != null && Object.hasOwnProperty.call(message, "bodyContent")) - $root.google.cloud.support.v2beta.TextContent.encode(message.bodyContent, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EmailMessage message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.EmailMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.EmailMessage - * @static - * @param {google.cloud.support.v2beta.IEmailMessage} message EmailMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmailMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EmailMessage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.EmailMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.EmailMessage} EmailMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmailMessage.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.EmailMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.actor = $root.google.cloud.support.v2beta.Actor.decode(reader, reader.uint32()); - break; - } - case 4: { - message.subject = reader.string(); - break; - } - case 5: { - if (!(message.recipientEmailAddresses && message.recipientEmailAddresses.length)) - message.recipientEmailAddresses = []; - message.recipientEmailAddresses.push(reader.string()); - break; - } - case 6: { - if (!(message.ccEmailAddresses && message.ccEmailAddresses.length)) - message.ccEmailAddresses = []; - message.ccEmailAddresses.push(reader.string()); - break; - } - case 8: { - message.bodyContent = $root.google.cloud.support.v2beta.TextContent.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EmailMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.EmailMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.EmailMessage} EmailMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmailMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EmailMessage message. - * @function verify - * @memberof google.cloud.support.v2beta.EmailMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EmailMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: 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.actor != null && message.hasOwnProperty("actor")) { - var error = $root.google.cloud.support.v2beta.Actor.verify(message.actor); - if (error) - return "actor." + error; - } - if (message.subject != null && message.hasOwnProperty("subject")) - if (!$util.isString(message.subject)) - return "subject: string expected"; - if (message.recipientEmailAddresses != null && message.hasOwnProperty("recipientEmailAddresses")) { - if (!Array.isArray(message.recipientEmailAddresses)) - return "recipientEmailAddresses: array expected"; - for (var i = 0; i < message.recipientEmailAddresses.length; ++i) - if (!$util.isString(message.recipientEmailAddresses[i])) - return "recipientEmailAddresses: string[] expected"; - } - if (message.ccEmailAddresses != null && message.hasOwnProperty("ccEmailAddresses")) { - if (!Array.isArray(message.ccEmailAddresses)) - return "ccEmailAddresses: array expected"; - for (var i = 0; i < message.ccEmailAddresses.length; ++i) - if (!$util.isString(message.ccEmailAddresses[i])) - return "ccEmailAddresses: string[] expected"; - } - if (message.bodyContent != null && message.hasOwnProperty("bodyContent")) { - var error = $root.google.cloud.support.v2beta.TextContent.verify(message.bodyContent); - if (error) - return "bodyContent." + error; - } - return null; - }; - - /** - * Creates an EmailMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.EmailMessage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.EmailMessage} EmailMessage - */ - EmailMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.EmailMessage) - return object; - var message = new $root.google.cloud.support.v2beta.EmailMessage(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.support.v2beta.EmailMessage.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.actor != null) { - if (typeof object.actor !== "object") - throw TypeError(".google.cloud.support.v2beta.EmailMessage.actor: object expected"); - message.actor = $root.google.cloud.support.v2beta.Actor.fromObject(object.actor); - } - if (object.subject != null) - message.subject = String(object.subject); - if (object.recipientEmailAddresses) { - if (!Array.isArray(object.recipientEmailAddresses)) - throw TypeError(".google.cloud.support.v2beta.EmailMessage.recipientEmailAddresses: array expected"); - message.recipientEmailAddresses = []; - for (var i = 0; i < object.recipientEmailAddresses.length; ++i) - message.recipientEmailAddresses[i] = String(object.recipientEmailAddresses[i]); - } - if (object.ccEmailAddresses) { - if (!Array.isArray(object.ccEmailAddresses)) - throw TypeError(".google.cloud.support.v2beta.EmailMessage.ccEmailAddresses: array expected"); - message.ccEmailAddresses = []; - for (var i = 0; i < object.ccEmailAddresses.length; ++i) - message.ccEmailAddresses[i] = String(object.ccEmailAddresses[i]); - } - if (object.bodyContent != null) { - if (typeof object.bodyContent !== "object") - throw TypeError(".google.cloud.support.v2beta.EmailMessage.bodyContent: object expected"); - message.bodyContent = $root.google.cloud.support.v2beta.TextContent.fromObject(object.bodyContent); - } - return message; - }; - - /** - * Creates a plain object from an EmailMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.EmailMessage - * @static - * @param {google.cloud.support.v2beta.EmailMessage} message EmailMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EmailMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.recipientEmailAddresses = []; - object.ccEmailAddresses = []; - } - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.actor = null; - object.subject = ""; - object.bodyContent = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.actor != null && message.hasOwnProperty("actor")) - object.actor = $root.google.cloud.support.v2beta.Actor.toObject(message.actor, options); - if (message.subject != null && message.hasOwnProperty("subject")) - object.subject = message.subject; - if (message.recipientEmailAddresses && message.recipientEmailAddresses.length) { - object.recipientEmailAddresses = []; - for (var j = 0; j < message.recipientEmailAddresses.length; ++j) - object.recipientEmailAddresses[j] = message.recipientEmailAddresses[j]; - } - if (message.ccEmailAddresses && message.ccEmailAddresses.length) { - object.ccEmailAddresses = []; - for (var j = 0; j < message.ccEmailAddresses.length; ++j) - object.ccEmailAddresses[j] = message.ccEmailAddresses[j]; - } - if (message.bodyContent != null && message.hasOwnProperty("bodyContent")) - object.bodyContent = $root.google.cloud.support.v2beta.TextContent.toObject(message.bodyContent, options); - return object; - }; - - /** - * Converts this EmailMessage to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.EmailMessage - * @instance - * @returns {Object.} JSON object - */ - EmailMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EmailMessage - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.EmailMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EmailMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.EmailMessage"; - }; - - return EmailMessage; - })(); - - v2beta.FeedItem = (function() { - - /** - * Properties of a FeedItem. - * @memberof google.cloud.support.v2beta - * @interface IFeedItem - * @property {google.cloud.support.v2beta.IComment|null} [comment] FeedItem comment - * @property {google.cloud.support.v2beta.IAttachment|null} [attachment] FeedItem attachment - * @property {google.cloud.support.v2beta.IEmailMessage|null} [emailMessage] FeedItem emailMessage - * @property {google.cloud.support.v2beta.IAttachment|null} [deletedAttachment] FeedItem deletedAttachment - * @property {google.protobuf.ITimestamp|null} [eventTime] FeedItem eventTime - */ - - /** - * Constructs a new FeedItem. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a FeedItem. - * @implements IFeedItem - * @constructor - * @param {google.cloud.support.v2beta.IFeedItem=} [properties] Properties to set - */ - function FeedItem(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeedItem comment. - * @member {google.cloud.support.v2beta.IComment|null|undefined} comment - * @memberof google.cloud.support.v2beta.FeedItem - * @instance - */ - FeedItem.prototype.comment = null; - - /** - * FeedItem attachment. - * @member {google.cloud.support.v2beta.IAttachment|null|undefined} attachment - * @memberof google.cloud.support.v2beta.FeedItem - * @instance - */ - FeedItem.prototype.attachment = null; - - /** - * FeedItem emailMessage. - * @member {google.cloud.support.v2beta.IEmailMessage|null|undefined} emailMessage - * @memberof google.cloud.support.v2beta.FeedItem - * @instance - */ - FeedItem.prototype.emailMessage = null; - - /** - * FeedItem deletedAttachment. - * @member {google.cloud.support.v2beta.IAttachment|null|undefined} deletedAttachment - * @memberof google.cloud.support.v2beta.FeedItem - * @instance - */ - FeedItem.prototype.deletedAttachment = null; - - /** - * FeedItem eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.support.v2beta.FeedItem - * @instance - */ - FeedItem.prototype.eventTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * FeedItem eventObject. - * @member {"comment"|"attachment"|"emailMessage"|"deletedAttachment"|undefined} eventObject - * @memberof google.cloud.support.v2beta.FeedItem - * @instance - */ - Object.defineProperty(FeedItem.prototype, "eventObject", { - get: $util.oneOfGetter($oneOfFields = ["comment", "attachment", "emailMessage", "deletedAttachment"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new FeedItem instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.FeedItem - * @static - * @param {google.cloud.support.v2beta.IFeedItem=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.FeedItem} FeedItem instance - */ - FeedItem.create = function create(properties) { - return new FeedItem(properties); - }; - - /** - * Encodes the specified FeedItem message. Does not implicitly {@link google.cloud.support.v2beta.FeedItem.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.FeedItem - * @static - * @param {google.cloud.support.v2beta.IFeedItem} message FeedItem message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeedItem.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) - $root.google.cloud.support.v2beta.Comment.encode(message.comment, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); - if (message.attachment != null && Object.hasOwnProperty.call(message, "attachment")) - $root.google.cloud.support.v2beta.Attachment.encode(message.attachment, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); - if (message.emailMessage != null && Object.hasOwnProperty.call(message, "emailMessage")) - $root.google.cloud.support.v2beta.EmailMessage.encode(message.emailMessage, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); - if (message.deletedAttachment != null && Object.hasOwnProperty.call(message, "deletedAttachment")) - $root.google.cloud.support.v2beta.Attachment.encode(message.deletedAttachment, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FeedItem message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.FeedItem.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.FeedItem - * @static - * @param {google.cloud.support.v2beta.IFeedItem} message FeedItem message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeedItem.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeedItem message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.FeedItem - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.FeedItem} FeedItem - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeedItem.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.FeedItem(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 100: { - message.comment = $root.google.cloud.support.v2beta.Comment.decode(reader, reader.uint32()); - break; - } - case 101: { - message.attachment = $root.google.cloud.support.v2beta.Attachment.decode(reader, reader.uint32()); - break; - } - case 102: { - message.emailMessage = $root.google.cloud.support.v2beta.EmailMessage.decode(reader, reader.uint32()); - break; - } - case 103: { - message.deletedAttachment = $root.google.cloud.support.v2beta.Attachment.decode(reader, reader.uint32()); - break; - } - case 1: { - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeedItem message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.FeedItem - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.FeedItem} FeedItem - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeedItem.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeedItem message. - * @function verify - * @memberof google.cloud.support.v2beta.FeedItem - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeedItem.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.comment != null && message.hasOwnProperty("comment")) { - properties.eventObject = 1; - { - var error = $root.google.cloud.support.v2beta.Comment.verify(message.comment); - if (error) - return "comment." + error; - } - } - if (message.attachment != null && message.hasOwnProperty("attachment")) { - if (properties.eventObject === 1) - return "eventObject: multiple values"; - properties.eventObject = 1; - { - var error = $root.google.cloud.support.v2beta.Attachment.verify(message.attachment); - if (error) - return "attachment." + error; - } - } - if (message.emailMessage != null && message.hasOwnProperty("emailMessage")) { - if (properties.eventObject === 1) - return "eventObject: multiple values"; - properties.eventObject = 1; - { - var error = $root.google.cloud.support.v2beta.EmailMessage.verify(message.emailMessage); - if (error) - return "emailMessage." + error; - } - } - if (message.deletedAttachment != null && message.hasOwnProperty("deletedAttachment")) { - if (properties.eventObject === 1) - return "eventObject: multiple values"; - properties.eventObject = 1; - { - var error = $root.google.cloud.support.v2beta.Attachment.verify(message.deletedAttachment); - if (error) - return "deletedAttachment." + 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 FeedItem message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.FeedItem - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.FeedItem} FeedItem - */ - FeedItem.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.FeedItem) - return object; - var message = new $root.google.cloud.support.v2beta.FeedItem(); - if (object.comment != null) { - if (typeof object.comment !== "object") - throw TypeError(".google.cloud.support.v2beta.FeedItem.comment: object expected"); - message.comment = $root.google.cloud.support.v2beta.Comment.fromObject(object.comment); - } - if (object.attachment != null) { - if (typeof object.attachment !== "object") - throw TypeError(".google.cloud.support.v2beta.FeedItem.attachment: object expected"); - message.attachment = $root.google.cloud.support.v2beta.Attachment.fromObject(object.attachment); - } - if (object.emailMessage != null) { - if (typeof object.emailMessage !== "object") - throw TypeError(".google.cloud.support.v2beta.FeedItem.emailMessage: object expected"); - message.emailMessage = $root.google.cloud.support.v2beta.EmailMessage.fromObject(object.emailMessage); - } - if (object.deletedAttachment != null) { - if (typeof object.deletedAttachment !== "object") - throw TypeError(".google.cloud.support.v2beta.FeedItem.deletedAttachment: object expected"); - message.deletedAttachment = $root.google.cloud.support.v2beta.Attachment.fromObject(object.deletedAttachment); - } - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.support.v2beta.FeedItem.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - return message; - }; - - /** - * Creates a plain object from a FeedItem message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.FeedItem - * @static - * @param {google.cloud.support.v2beta.FeedItem} message FeedItem - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeedItem.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.eventTime = null; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.comment != null && message.hasOwnProperty("comment")) { - object.comment = $root.google.cloud.support.v2beta.Comment.toObject(message.comment, options); - if (options.oneofs) - object.eventObject = "comment"; - } - if (message.attachment != null && message.hasOwnProperty("attachment")) { - object.attachment = $root.google.cloud.support.v2beta.Attachment.toObject(message.attachment, options); - if (options.oneofs) - object.eventObject = "attachment"; - } - if (message.emailMessage != null && message.hasOwnProperty("emailMessage")) { - object.emailMessage = $root.google.cloud.support.v2beta.EmailMessage.toObject(message.emailMessage, options); - if (options.oneofs) - object.eventObject = "emailMessage"; - } - if (message.deletedAttachment != null && message.hasOwnProperty("deletedAttachment")) { - object.deletedAttachment = $root.google.cloud.support.v2beta.Attachment.toObject(message.deletedAttachment, options); - if (options.oneofs) - object.eventObject = "deletedAttachment"; - } - return object; - }; - - /** - * Converts this FeedItem to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.FeedItem - * @instance - * @returns {Object.} JSON object - */ - FeedItem.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeedItem - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.FeedItem - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeedItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.FeedItem"; - }; - - return FeedItem; - })(); - - v2beta.FeedService = (function() { - - /** - * Constructs a new FeedService service. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a FeedService - * @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 FeedService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (FeedService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = FeedService; - - /** - * Creates new FeedService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.support.v2beta.FeedService - * @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 {FeedService} RPC service. Useful where requests and/or responses are streamed. - */ - FeedService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.support.v2beta.FeedService|showFeed}. - * @memberof google.cloud.support.v2beta.FeedService - * @typedef ShowFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.support.v2beta.ShowFeedResponse} [response] ShowFeedResponse - */ - - /** - * Calls ShowFeed. - * @function showFeed - * @memberof google.cloud.support.v2beta.FeedService - * @instance - * @param {google.cloud.support.v2beta.IShowFeedRequest} request ShowFeedRequest message or plain object - * @param {google.cloud.support.v2beta.FeedService.ShowFeedCallback} callback Node-style callback called with the error, if any, and ShowFeedResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(FeedService.prototype.showFeed = function showFeed(request, callback) { - return this.rpcCall(showFeed, $root.google.cloud.support.v2beta.ShowFeedRequest, $root.google.cloud.support.v2beta.ShowFeedResponse, request, callback); - }, "name", { value: "ShowFeed" }); - - /** - * Calls ShowFeed. - * @function showFeed - * @memberof google.cloud.support.v2beta.FeedService - * @instance - * @param {google.cloud.support.v2beta.IShowFeedRequest} request ShowFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return FeedService; - })(); - - v2beta.ShowFeedRequest = (function() { - - /** - * Properties of a ShowFeedRequest. - * @memberof google.cloud.support.v2beta - * @interface IShowFeedRequest - * @property {string|null} [parent] ShowFeedRequest parent - * @property {string|null} [orderBy] ShowFeedRequest orderBy - * @property {number|null} [pageSize] ShowFeedRequest pageSize - * @property {string|null} [pageToken] ShowFeedRequest pageToken - */ - - /** - * Constructs a new ShowFeedRequest. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a ShowFeedRequest. - * @implements IShowFeedRequest - * @constructor - * @param {google.cloud.support.v2beta.IShowFeedRequest=} [properties] Properties to set - */ - function ShowFeedRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ShowFeedRequest parent. - * @member {string} parent - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @instance - */ - ShowFeedRequest.prototype.parent = ""; - - /** - * ShowFeedRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @instance - */ - ShowFeedRequest.prototype.orderBy = ""; - - /** - * ShowFeedRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @instance - */ - ShowFeedRequest.prototype.pageSize = 0; - - /** - * ShowFeedRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @instance - */ - ShowFeedRequest.prototype.pageToken = ""; - - /** - * Creates a new ShowFeedRequest instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @static - * @param {google.cloud.support.v2beta.IShowFeedRequest=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.ShowFeedRequest} ShowFeedRequest instance - */ - ShowFeedRequest.create = function create(properties) { - return new ShowFeedRequest(properties); - }; - - /** - * Encodes the specified ShowFeedRequest message. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @static - * @param {google.cloud.support.v2beta.IShowFeedRequest} message ShowFeedRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShowFeedRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.orderBy); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ShowFeedRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @static - * @param {google.cloud.support.v2beta.IShowFeedRequest} message ShowFeedRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShowFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ShowFeedRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.ShowFeedRequest} ShowFeedRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShowFeedRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ShowFeedRequest(); - 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.orderBy = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ShowFeedRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.ShowFeedRequest} ShowFeedRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShowFeedRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ShowFeedRequest message. - * @function verify - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ShowFeedRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: 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 ShowFeedRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.ShowFeedRequest} ShowFeedRequest - */ - ShowFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.ShowFeedRequest) - return object; - var message = new $root.google.cloud.support.v2beta.ShowFeedRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - 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 ShowFeedRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @static - * @param {google.cloud.support.v2beta.ShowFeedRequest} message ShowFeedRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ShowFeedRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.orderBy = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ShowFeedRequest to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @instance - * @returns {Object.} JSON object - */ - ShowFeedRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ShowFeedRequest - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.ShowFeedRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ShowFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.ShowFeedRequest"; - }; - - return ShowFeedRequest; - })(); - - v2beta.ShowFeedResponse = (function() { - - /** - * Properties of a ShowFeedResponse. - * @memberof google.cloud.support.v2beta - * @interface IShowFeedResponse - * @property {Array.|null} [feedItems] ShowFeedResponse feedItems - * @property {string|null} [nextPageToken] ShowFeedResponse nextPageToken - */ - - /** - * Constructs a new ShowFeedResponse. - * @memberof google.cloud.support.v2beta - * @classdesc Represents a ShowFeedResponse. - * @implements IShowFeedResponse - * @constructor - * @param {google.cloud.support.v2beta.IShowFeedResponse=} [properties] Properties to set - */ - function ShowFeedResponse(properties) { - this.feedItems = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ShowFeedResponse feedItems. - * @member {Array.} feedItems - * @memberof google.cloud.support.v2beta.ShowFeedResponse - * @instance - */ - ShowFeedResponse.prototype.feedItems = $util.emptyArray; - - /** - * ShowFeedResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.support.v2beta.ShowFeedResponse - * @instance - */ - ShowFeedResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ShowFeedResponse instance using the specified properties. - * @function create - * @memberof google.cloud.support.v2beta.ShowFeedResponse - * @static - * @param {google.cloud.support.v2beta.IShowFeedResponse=} [properties] Properties to set - * @returns {google.cloud.support.v2beta.ShowFeedResponse} ShowFeedResponse instance - */ - ShowFeedResponse.create = function create(properties) { - return new ShowFeedResponse(properties); - }; - - /** - * Encodes the specified ShowFeedResponse message. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.support.v2beta.ShowFeedResponse - * @static - * @param {google.cloud.support.v2beta.IShowFeedResponse} message ShowFeedResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShowFeedResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.feedItems != null && message.feedItems.length) - for (var i = 0; i < message.feedItems.length; ++i) - $root.google.cloud.support.v2beta.FeedItem.encode(message.feedItems[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 ShowFeedResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2beta.ShowFeedResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.support.v2beta.ShowFeedResponse - * @static - * @param {google.cloud.support.v2beta.IShowFeedResponse} message ShowFeedResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShowFeedResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ShowFeedResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.support.v2beta.ShowFeedResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.support.v2beta.ShowFeedResponse} ShowFeedResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShowFeedResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2beta.ShowFeedResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.feedItems && message.feedItems.length)) - message.feedItems = []; - message.feedItems.push($root.google.cloud.support.v2beta.FeedItem.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ShowFeedResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.support.v2beta.ShowFeedResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.support.v2beta.ShowFeedResponse} ShowFeedResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShowFeedResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ShowFeedResponse message. - * @function verify - * @memberof google.cloud.support.v2beta.ShowFeedResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ShowFeedResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.feedItems != null && message.hasOwnProperty("feedItems")) { - if (!Array.isArray(message.feedItems)) - return "feedItems: array expected"; - for (var i = 0; i < message.feedItems.length; ++i) { - var error = $root.google.cloud.support.v2beta.FeedItem.verify(message.feedItems[i]); - if (error) - return "feedItems." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ShowFeedResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.support.v2beta.ShowFeedResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.support.v2beta.ShowFeedResponse} ShowFeedResponse - */ - ShowFeedResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.support.v2beta.ShowFeedResponse) - return object; - var message = new $root.google.cloud.support.v2beta.ShowFeedResponse(); - if (object.feedItems) { - if (!Array.isArray(object.feedItems)) - throw TypeError(".google.cloud.support.v2beta.ShowFeedResponse.feedItems: array expected"); - message.feedItems = []; - for (var i = 0; i < object.feedItems.length; ++i) { - if (typeof object.feedItems[i] !== "object") - throw TypeError(".google.cloud.support.v2beta.ShowFeedResponse.feedItems: object expected"); - message.feedItems[i] = $root.google.cloud.support.v2beta.FeedItem.fromObject(object.feedItems[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ShowFeedResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.support.v2beta.ShowFeedResponse - * @static - * @param {google.cloud.support.v2beta.ShowFeedResponse} message ShowFeedResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ShowFeedResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.feedItems = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.feedItems && message.feedItems.length) { - object.feedItems = []; - for (var j = 0; j < message.feedItems.length; ++j) - object.feedItems[j] = $root.google.cloud.support.v2beta.FeedItem.toObject(message.feedItems[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ShowFeedResponse to JSON. - * @function toJSON - * @memberof google.cloud.support.v2beta.ShowFeedResponse - * @instance - * @returns {Object.} JSON object - */ - ShowFeedResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ShowFeedResponse - * @function getTypeUrl - * @memberof google.cloud.support.v2beta.ShowFeedResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ShowFeedResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.support.v2beta.ShowFeedResponse"; - }; - - return ShowFeedResponse; - })(); - - return v2beta; - })(); - - return support; - })(); - - 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 - */ - - /** - * 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; - - /** - * 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.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; - } - 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"; - } - 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]); - } - 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.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.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.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.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.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; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-support/protos/protos.json b/owl-bot-staging/google-cloud-support/protos/protos.json deleted file mode 100644 index 461f1eefc45..00000000000 --- a/owl-bot-staging/google-cloud-support/protos/protos.json +++ /dev/null @@ -1,3752 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "support": { - "nested": { - "v2": { - "options": { - "csharp_namespace": "Google.Cloud.Support.V2", - "go_package": "cloud.google.com/go/support/apiv2/supportpb;supportpb", - "java_multiple_files": true, - "java_outer_classname": "CommentServiceProto", - "java_package": "com.google.cloud.support.v2", - "php_namespace": "Google\\Cloud\\Support\\V2", - "ruby_package": "Google::Cloud::Support::V2" - }, - "nested": { - "Actor": { - "fields": { - "displayName": { - "type": "string", - "id": 1 - }, - "email": { - "type": "string", - "id": 2, - "options": { - "deprecated": true - } - }, - "googleSupport": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "username": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Attachment": { - "options": { - "(google.api.resource).type": "cloudsupport.googleapis.com/Attachment", - "(google.api.resource).pattern": "projects/{project}/cases/{case}/attachments/{attachment_id}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "Actor", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "filename": { - "type": "string", - "id": 4 - }, - "mimeType": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sizeBytes": { - "type": "int64", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CaseAttachmentService": { - "options": { - "(google.api.default_host)": "cloudsupport.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListAttachments": { - "requestType": "ListAttachmentsRequest", - "responseType": "ListAttachmentsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/cases/*}/attachments", - "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/cases/*}/attachments", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/cases/*}/attachments", - "additional_bindings": { - "get": "/v2/{parent=organizations/*/cases/*}/attachments" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "ListAttachmentsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListAttachmentsResponse": { - "fields": { - "attachments": { - "rule": "repeated", - "type": "Attachment", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "Case": { - "options": { - "(google.api.resource).type": "cloudsupport.googleapis.com/Case", - "(google.api.resource).pattern": "projects/{project}/cases/{case}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "classification": { - "type": "CaseClassification", - "id": 4 - }, - "timeZone": { - "type": "string", - "id": 8 - }, - "subscriberEmailAddresses": { - "rule": "repeated", - "type": "string", - "id": 9 - }, - "state": { - "type": "State", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "Actor", - "id": 15 - }, - "contactEmail": { - "type": "string", - "id": 35 - }, - "escalated": { - "type": "bool", - "id": 17 - }, - "testCase": { - "type": "bool", - "id": 19 - }, - "languageCode": { - "type": "string", - "id": 23 - }, - "priority": { - "type": "Priority", - "id": 32 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "NEW": 1, - "IN_PROGRESS_GOOGLE_SUPPORT": 2, - "ACTION_REQUIRED": 3, - "SOLUTION_PROVIDED": 4, - "CLOSED": 5 - } - }, - "Priority": { - "values": { - "PRIORITY_UNSPECIFIED": 0, - "P0": 1, - "P1": 2, - "P2": 3, - "P3": 4, - "P4": 5 - } - } - } - }, - "CaseClassification": { - "fields": { - "id": { - "type": "string", - "id": 3 - }, - "displayName": { - "type": "string", - "id": 4 - } - } - }, - "CaseService": { - "options": { - "(google.api.default_host)": "cloudsupport.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "GetCase": { - "requestType": "GetCaseRequest", - "responseType": "Case", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/cases/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*/cases/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/cases/*}", - "additional_bindings": { - "get": "/v2/{name=organizations/*/cases/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListCases": { - "requestType": "ListCasesRequest", - "responseType": "ListCasesResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*}/cases", - "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*}/cases", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*}/cases", - "additional_bindings": { - "get": "/v2/{parent=organizations/*}/cases" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "SearchCases": { - "requestType": "SearchCasesRequest", - "responseType": "SearchCasesResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*}/cases:search", - "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*}/cases:search" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*}/cases:search", - "additional_bindings": { - "get": "/v2/{parent=organizations/*}/cases:search" - } - } - } - ] - }, - "CreateCase": { - "requestType": "CreateCaseRequest", - "responseType": "Case", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*}/cases", - "(google.api.http).body": "case", - "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*}/cases", - "(google.api.http).additional_bindings.body": "case", - "(google.api.method_signature)": "parent,case" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*}/cases", - "body": "case", - "additional_bindings": { - "post": "/v2/{parent=organizations/*}/cases", - "body": "case" - } - } - }, - { - "(google.api.method_signature)": "parent,case" - } - ] - }, - "UpdateCase": { - "requestType": "UpdateCaseRequest", - "responseType": "Case", - "options": { - "(google.api.http).patch": "/v2/{case.name=projects/*/cases/*}", - "(google.api.http).body": "case", - "(google.api.http).additional_bindings.patch": "/v2/{case.name=organizations/*/cases/*}", - "(google.api.http).additional_bindings.body": "case", - "(google.api.method_signature)": "case,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{case.name=projects/*/cases/*}", - "body": "case", - "additional_bindings": { - "patch": "/v2/{case.name=organizations/*/cases/*}", - "body": "case" - } - } - }, - { - "(google.api.method_signature)": "case,update_mask" - } - ] - }, - "EscalateCase": { - "requestType": "EscalateCaseRequest", - "responseType": "Case", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/cases/*}:escalate", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2/{name=organizations/*/cases/*}:escalate", - "(google.api.http).additional_bindings.body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/cases/*}:escalate", - "body": "*", - "additional_bindings": { - "post": "/v2/{name=organizations/*/cases/*}:escalate", - "body": "*" - } - } - } - ] - }, - "CloseCase": { - "requestType": "CloseCaseRequest", - "responseType": "Case", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/cases/*}:close", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2/{name=organizations/*/cases/*}:close", - "(google.api.http).additional_bindings.body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/cases/*}:close", - "body": "*", - "additional_bindings": { - "post": "/v2/{name=organizations/*/cases/*}:close", - "body": "*" - } - } - } - ] - }, - "SearchCaseClassifications": { - "requestType": "SearchCaseClassificationsRequest", - "responseType": "SearchCaseClassificationsResponse", - "options": { - "(google.api.http).get": "/v2/caseClassifications:search" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/caseClassifications:search" - } - } - ] - } - } - }, - "GetCaseRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - } - } - }, - "CreateCaseRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudsupport.googleapis.com/Case" - } - }, - "case": { - "type": "Case", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListCasesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudsupport.googleapis.com/Case" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "pageToken": { - "type": "string", - "id": 5 - } - } - }, - "ListCasesResponse": { - "fields": { - "cases": { - "rule": "repeated", - "type": "Case", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "SearchCasesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 4 - }, - "query": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "SearchCasesResponse": { - "fields": { - "cases": { - "rule": "repeated", - "type": "Case", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "EscalateCaseRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - }, - "escalation": { - "type": "Escalation", - "id": 2 - } - } - }, - "UpdateCaseRequest": { - "fields": { - "case": { - "type": "Case", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "CloseCaseRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - } - } - }, - "SearchCaseClassificationsRequest": { - "fields": { - "query": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "SearchCaseClassificationsResponse": { - "fields": { - "caseClassifications": { - "rule": "repeated", - "type": "CaseClassification", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "Escalation": { - "fields": { - "reason": { - "type": "Reason", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "justification": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "Reason": { - "values": { - "REASON_UNSPECIFIED": 0, - "RESOLUTION_TIME": 1, - "TECHNICAL_EXPERTISE": 2, - "BUSINESS_IMPACT": 3 - } - } - } - }, - "Comment": { - "options": { - "(google.api.resource).type": "cloudsupport.googleapis.com/Comment", - "(google.api.resource).pattern": "projects/{project}/cases/{case}/comments/{comment}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "Actor", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "body": { - "type": "string", - "id": 4 - }, - "plainTextBody": { - "type": "string", - "id": 5, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CommentService": { - "options": { - "(google.api.default_host)": "cloudsupport.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListComments": { - "requestType": "ListCommentsRequest", - "responseType": "ListCommentsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/cases/*}/comments", - "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/cases/*}/comments", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/cases/*}/comments", - "additional_bindings": { - "get": "/v2/{parent=organizations/*/cases/*}/comments" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "CreateComment": { - "requestType": "CreateCommentRequest", - "responseType": "Comment", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/cases/*}/comments", - "(google.api.http).body": "comment", - "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*/cases/*}/comments", - "(google.api.http).additional_bindings.body": "comment", - "(google.api.method_signature)": "parent,comment" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/cases/*}/comments", - "body": "comment", - "additional_bindings": { - "post": "/v2/{parent=organizations/*/cases/*}/comments", - "body": "comment" - } - } - }, - { - "(google.api.method_signature)": "parent,comment" - } - ] - } - } - }, - "ListCommentsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "pageToken": { - "type": "string", - "id": 5 - } - } - }, - "ListCommentsResponse": { - "fields": { - "comments": { - "rule": "repeated", - "type": "Comment", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CreateCommentRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - }, - "comment": { - "type": "Comment", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "v2beta": { - "options": { - "csharp_namespace": "Google.Cloud.Support.V2Beta", - "go_package": "cloud.google.com/go/support/apiv2beta/supportpb;supportpb", - "java_multiple_files": true, - "java_outer_classname": "FeedServiceProto", - "java_package": "com.google.cloud.support.v2beta", - "php_namespace": "Google\\Cloud\\Support\\V2beta", - "ruby_package": "Google::Cloud::Support::V2beta" - }, - "nested": { - "Actor": { - "fields": { - "displayName": { - "type": "string", - "id": 1 - }, - "email": { - "type": "string", - "id": 2, - "options": { - "deprecated": true - } - }, - "googleSupport": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "username": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Attachment": { - "options": { - "(google.api.resource).type": "cloudsupport.googleapis.com/Attachment", - "(google.api.resource).pattern": "projects/{project}/cases/{case}/attachments/{attachment_id}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "Actor", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "filename": { - "type": "string", - "id": 4 - }, - "mimeType": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sizeBytes": { - "type": "int64", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CaseAttachmentService": { - "options": { - "(google.api.default_host)": "cloudsupport.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListAttachments": { - "requestType": "ListAttachmentsRequest", - "responseType": "ListAttachmentsResponse", - "options": { - "(google.api.http).get": "/v2beta/{parent=projects/*/cases/*}/attachments", - "(google.api.http).additional_bindings.get": "/v2beta/{parent=organizations/*/cases/*}/attachments", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta/{parent=projects/*/cases/*}/attachments", - "additional_bindings": { - "get": "/v2beta/{parent=organizations/*/cases/*}/attachments" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetAttachment": { - "requestType": "GetAttachmentRequest", - "responseType": "Attachment", - "options": { - "(google.api.http).get": "/v2beta/{name=*/*/cases/*/attachments/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta/{name=*/*/cases/*/attachments/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "ListAttachmentsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "GetAttachmentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Attachment" - } - } - } - }, - "ListAttachmentsResponse": { - "fields": { - "attachments": { - "rule": "repeated", - "type": "Attachment", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ProductLine": { - "values": { - "PRODUCT_LINE_UNSPECIFIED": 0, - "GOOGLE_CLOUD": 1, - "GOOGLE_MAPS": 2 - } - }, - "Case": { - "options": { - "(google.api.resource).type": "cloudsupport.googleapis.com/Case", - "(google.api.resource).pattern": "projects/{project}/cases/{case}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "classification": { - "type": "CaseClassification", - "id": 4 - }, - "timeZone": { - "type": "string", - "id": 8 - }, - "subscriberEmailAddresses": { - "rule": "repeated", - "type": "string", - "id": 9 - }, - "state": { - "type": "State", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "Actor", - "id": 15 - }, - "contactEmail": { - "type": "string", - "id": 35 - }, - "escalated": { - "type": "bool", - "id": 17 - }, - "testCase": { - "type": "bool", - "id": 19 - }, - "languageCode": { - "type": "string", - "id": 23 - }, - "priority": { - "type": "Priority", - "id": 32 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "NEW": 1, - "IN_PROGRESS_GOOGLE_SUPPORT": 2, - "ACTION_REQUIRED": 3, - "SOLUTION_PROVIDED": 4, - "CLOSED": 5 - } - }, - "Priority": { - "values": { - "PRIORITY_UNSPECIFIED": 0, - "P0": 1, - "P1": 2, - "P2": 3, - "P3": 4, - "P4": 5 - } - } - } - }, - "CaseClassification": { - "fields": { - "id": { - "type": "string", - "id": 3 - }, - "displayName": { - "type": "string", - "id": 4 - }, - "product": { - "type": "Product", - "id": 10 - } - } - }, - "Product": { - "fields": { - "productLine": { - "type": "ProductLine", - "id": 1 - } - } - }, - "CaseService": { - "options": { - "(google.api.default_host)": "cloudsupport.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "GetCase": { - "requestType": "GetCaseRequest", - "responseType": "Case", - "options": { - "(google.api.http).get": "/v2beta/{name=projects/*/cases/*}", - "(google.api.http).additional_bindings.get": "/v2beta/{name=organizations/*/cases/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta/{name=projects/*/cases/*}", - "additional_bindings": { - "get": "/v2beta/{name=organizations/*/cases/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListCases": { - "requestType": "ListCasesRequest", - "responseType": "ListCasesResponse", - "options": { - "(google.api.http).get": "/v2beta/{parent=projects/*}/cases", - "(google.api.http).additional_bindings.get": "/v2beta/{parent=organizations/*}/cases", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta/{parent=projects/*}/cases", - "additional_bindings": { - "get": "/v2beta/{parent=organizations/*}/cases" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "SearchCases": { - "requestType": "SearchCasesRequest", - "responseType": "SearchCasesResponse", - "options": { - "(google.api.http).get": "/v2beta/{parent=projects/*}/cases:search", - "(google.api.http).additional_bindings.get": "/v2beta/{parent=organizations/*}/cases:search" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta/{parent=projects/*}/cases:search", - "additional_bindings": { - "get": "/v2beta/{parent=organizations/*}/cases:search" - } - } - } - ] - }, - "CreateCase": { - "requestType": "CreateCaseRequest", - "responseType": "Case", - "options": { - "(google.api.http).post": "/v2beta/{parent=projects/*}/cases", - "(google.api.http).body": "case", - "(google.api.http).additional_bindings.post": "/v2beta/{parent=organizations/*}/cases", - "(google.api.http).additional_bindings.body": "case", - "(google.api.method_signature)": "parent,case" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta/{parent=projects/*}/cases", - "body": "case", - "additional_bindings": { - "post": "/v2beta/{parent=organizations/*}/cases", - "body": "case" - } - } - }, - { - "(google.api.method_signature)": "parent,case" - } - ] - }, - "UpdateCase": { - "requestType": "UpdateCaseRequest", - "responseType": "Case", - "options": { - "(google.api.http).patch": "/v2beta/{case.name=projects/*/cases/*}", - "(google.api.http).body": "case", - "(google.api.http).additional_bindings.patch": "/v2beta/{case.name=organizations/*/cases/*}", - "(google.api.http).additional_bindings.body": "case", - "(google.api.method_signature)": "case,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2beta/{case.name=projects/*/cases/*}", - "body": "case", - "additional_bindings": { - "patch": "/v2beta/{case.name=organizations/*/cases/*}", - "body": "case" - } - } - }, - { - "(google.api.method_signature)": "case,update_mask" - } - ] - }, - "EscalateCase": { - "requestType": "EscalateCaseRequest", - "responseType": "Case", - "options": { - "(google.api.http).post": "/v2beta/{name=projects/*/cases/*}:escalate", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta/{name=organizations/*/cases/*}:escalate", - "(google.api.http).additional_bindings.body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta/{name=projects/*/cases/*}:escalate", - "body": "*", - "additional_bindings": { - "post": "/v2beta/{name=organizations/*/cases/*}:escalate", - "body": "*" - } - } - } - ] - }, - "CloseCase": { - "requestType": "CloseCaseRequest", - "responseType": "Case", - "options": { - "(google.api.http).post": "/v2beta/{name=projects/*/cases/*}:close", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta/{name=organizations/*/cases/*}:close", - "(google.api.http).additional_bindings.body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta/{name=projects/*/cases/*}:close", - "body": "*", - "additional_bindings": { - "post": "/v2beta/{name=organizations/*/cases/*}:close", - "body": "*" - } - } - } - ] - }, - "SearchCaseClassifications": { - "requestType": "SearchCaseClassificationsRequest", - "responseType": "SearchCaseClassificationsResponse", - "options": { - "(google.api.http).get": "/v2beta/caseClassifications:search" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta/caseClassifications:search" - } - } - ] - } - } - }, - "GetCaseRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - } - } - }, - "CreateCaseRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudsupport.googleapis.com/Case" - } - }, - "case": { - "type": "Case", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListCasesRequest": { - "oneofs": { - "_productLine": { - "oneof": [ - "productLine" - ] - } - }, - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudsupport.googleapis.com/Case" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "pageToken": { - "type": "string", - "id": 5 - }, - "productLine": { - "type": "ProductLine", - "id": 8, - "options": { - "proto3_optional": true - } - } - } - }, - "ListCasesResponse": { - "fields": { - "cases": { - "rule": "repeated", - "type": "Case", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "SearchCasesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 4 - }, - "query": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "SearchCasesResponse": { - "fields": { - "cases": { - "rule": "repeated", - "type": "Case", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "EscalateCaseRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - }, - "escalation": { - "type": "Escalation", - "id": 2 - } - } - }, - "UpdateCaseRequest": { - "fields": { - "case": { - "type": "Case", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "CloseCaseRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - } - } - }, - "SearchCaseClassificationsRequest": { - "fields": { - "query": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "product": { - "type": "Product", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SearchCaseClassificationsResponse": { - "fields": { - "caseClassifications": { - "rule": "repeated", - "type": "CaseClassification", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "Escalation": { - "fields": { - "reason": { - "type": "Reason", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "justification": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "Reason": { - "values": { - "REASON_UNSPECIFIED": 0, - "RESOLUTION_TIME": 1, - "TECHNICAL_EXPERTISE": 2, - "BUSINESS_IMPACT": 3 - } - } - } - }, - "Comment": { - "options": { - "(google.api.resource).type": "cloudsupport.googleapis.com/Comment", - "(google.api.resource).pattern": "projects/{project}/cases/{case}/comments/{comment}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "Actor", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "body": { - "type": "string", - "id": 4 - }, - "plainTextBody": { - "type": "string", - "id": 5, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CommentService": { - "options": { - "(google.api.default_host)": "cloudsupport.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListComments": { - "requestType": "ListCommentsRequest", - "responseType": "ListCommentsResponse", - "options": { - "(google.api.http).get": "/v2beta/{parent=projects/*/cases/*}/comments", - "(google.api.http).additional_bindings.get": "/v2beta/{parent=organizations/*/cases/*}/comments", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta/{parent=projects/*/cases/*}/comments", - "additional_bindings": { - "get": "/v2beta/{parent=organizations/*/cases/*}/comments" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "CreateComment": { - "requestType": "CreateCommentRequest", - "responseType": "Comment", - "options": { - "(google.api.http).post": "/v2beta/{parent=projects/*/cases/*}/comments", - "(google.api.http).body": "comment", - "(google.api.http).additional_bindings.post": "/v2beta/{parent=organizations/*/cases/*}/comments", - "(google.api.http).additional_bindings.body": "comment", - "(google.api.method_signature)": "parent,comment" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta/{parent=projects/*/cases/*}/comments", - "body": "comment", - "additional_bindings": { - "post": "/v2beta/{parent=organizations/*/cases/*}/comments", - "body": "comment" - } - } - }, - { - "(google.api.method_signature)": "parent,comment" - } - ] - }, - "GetComment": { - "requestType": "GetCommentRequest", - "responseType": "Comment", - "options": { - "(google.api.http).get": "/v2beta/{name=*/*/cases/*/comments/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta/{name=*/*/cases/*/comments/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "ListCommentsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "pageToken": { - "type": "string", - "id": 5 - } - } - }, - "ListCommentsResponse": { - "fields": { - "comments": { - "rule": "repeated", - "type": "Comment", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CreateCommentRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - }, - "comment": { - "type": "Comment", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetCommentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Comment" - } - } - } - }, - "TextContent": { - "fields": { - "plainText": { - "type": "string", - "id": 1 - } - } - }, - "EmailMessage": { - "options": { - "(google.api.resource).type": "cloudsupport.googleapis.com/EmailMessage", - "(google.api.resource).pattern": "organizations/{organization}/cases/{case}/emailMessages/{email_message}", - "(google.api.resource).plural": "emailMessages", - "(google.api.resource).singular": "emailMessage" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "actor": { - "type": "Actor", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "subject": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "recipientEmailAddresses": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "ccEmailAddresses": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "bodyContent": { - "type": "TextContent", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "FeedItem": { - "oneofs": { - "eventObject": { - "oneof": [ - "comment", - "attachment", - "emailMessage", - "deletedAttachment" - ] - } - }, - "fields": { - "comment": { - "type": "Comment", - "id": 100, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "attachment": { - "type": "Attachment", - "id": 101, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "emailMessage": { - "type": "EmailMessage", - "id": 102, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deletedAttachment": { - "type": "Attachment", - "id": 103, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "FeedService": { - "options": { - "(google.api.default_host)": "cloudsupport.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ShowFeed": { - "requestType": "ShowFeedRequest", - "responseType": "ShowFeedResponse", - "options": { - "(google.api.http).get": "/v2beta/{parent=projects/*/cases/*}:showFeed", - "(google.api.http).additional_bindings.get": "/v2beta/{parent=organizations/*/cases/*}:showFeed", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta/{parent=projects/*/cases/*}:showFeed", - "additional_bindings": { - "get": "/v2beta/{parent=organizations/*/cases/*}:showFeed" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "ShowFeedRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" - } - }, - "orderBy": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ShowFeedResponse": { - "fields": { - "feedItems": { - "rule": "repeated", - "type": "FeedItem", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api;api", - "java_multiple_files": true, - "java_outer_classname": "LaunchStageProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "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 - } - } - } - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js deleted file mode 100644 index c6962a4f15a..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 case for which attachments should be listed. - */ - // const parent = 'abc123' - /** - * The maximum number of attachments fetched with each request. - * If not provided, the default is 10. The maximum page size that will be - * returned is 100. - * The size of each page can be smaller than the requested page size and can - * include zero. For example, you could request 100 attachments on one page, - * receive 0, and then on the next page, receive 90. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - */ - // const pageToken = 'abc123' - - // Imports the Support library - const {CaseAttachmentServiceClient} = require('@google-cloud/support').v2; - - // Instantiates a client - const supportClient = new CaseAttachmentServiceClient(); - - async function callListAttachments() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = supportClient.listAttachmentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAttachments(); - // [END cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.close_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.close_case.js deleted file mode 100644 index 3f6593141e3..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.close_case.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 cloudsupport_v2_generated_CaseService_CloseCase_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 case to close. - */ - // const name = 'abc123' - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callCloseCase() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await supportClient.closeCase(request); - console.log(response); - } - - callCloseCase(); - // [END cloudsupport_v2_generated_CaseService_CloseCase_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.create_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.create_case.js deleted file mode 100644 index e3677fcb459..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.create_case.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(parent, case) { - // [START cloudsupport_v2_generated_CaseService_CreateCase_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent under which the case should be created. - */ - // const parent = 'abc123' - /** - * Required. The case to be created. - */ - // const case = {} - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callCreateCase() { - // Construct request - const request = { - parent, - case, - }; - - // Run request - const response = await supportClient.createCase(request); - console.log(response); - } - - callCreateCase(); - // [END cloudsupport_v2_generated_CaseService_CreateCase_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.escalate_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.escalate_case.js deleted file mode 100644 index 287ee208360..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.escalate_case.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(name) { - // [START cloudsupport_v2_generated_CaseService_EscalateCase_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 case to be escalated. - */ - // const name = 'abc123' - /** - * The escalation information to be sent with the escalation request. - */ - // const escalation = {} - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callEscalateCase() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await supportClient.escalateCase(request); - console.log(response); - } - - callEscalateCase(); - // [END cloudsupport_v2_generated_CaseService_EscalateCase_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.get_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.get_case.js deleted file mode 100644 index 18fa9969cb8..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.get_case.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 cloudsupport_v2_generated_CaseService_GetCase_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The full name of a case to be retrieved. - */ - // const name = 'abc123' - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callGetCase() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await supportClient.getCase(request); - console.log(response); - } - - callGetCase(); - // [END cloudsupport_v2_generated_CaseService_GetCase_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.list_cases.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.list_cases.js deleted file mode 100644 index 0742afa4322..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.list_cases.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START cloudsupport_v2_generated_CaseService_ListCases_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 a parent to list cases under. - */ - // const parent = 'abc123' - /** - * An expression used to filter cases. - * If it's an empty string, then no filtering happens. Otherwise, the endpoint - * returns the cases that match the filter. - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * EXAMPLES: - * - `state=CLOSED` - * - `state=OPEN AND creator.email="tester@example.com"` - * - `state=OPEN AND (priority=P0 OR priority=P1)` - */ - // const filter = 'abc123' - /** - * The maximum number of cases fetched with each request. Defaults to 10. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - */ - // const pageToken = 'abc123' - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callListCases() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = supportClient.listCasesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCases(); - // [END cloudsupport_v2_generated_CaseService_ListCases_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js deleted file mode 100644 index fd17e1b24df..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.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() { - // [START cloudsupport_v2_generated_CaseService_SearchCaseClassifications_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * An expression used to filter case classifications. - * If it's an empty string, then no filtering happens. Otherwise, case - * classifications will be returned that match the filter. - */ - // const query = 'abc123' - /** - * The maximum number of classifications fetched with each request. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - */ - // const pageToken = 'abc123' - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callSearchCaseClassifications() { - // Construct request - const request = { - }; - - // Run request - const iterable = supportClient.searchCaseClassificationsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callSearchCaseClassifications(); - // [END cloudsupport_v2_generated_CaseService_SearchCaseClassifications_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_cases.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_cases.js deleted file mode 100644 index 82971582ba7..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.search_cases.js +++ /dev/null @@ -1,100 +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 cloudsupport_v2_generated_CaseService_SearchCases_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 name of the parent resource to search for cases under. - */ - // const parent = 'abc123' - /** - * An expression used to filter cases. - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - `organization`: An organization name in the form - * `organizations/`. - * - `project`: A project name in the form `projects/`. - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * You must specify either `organization` or `project`. - * To search across `displayName`, `description`, and comments, use a global - * restriction with no keyword or operator. For example, `"my search"`. - * To search only cases updated after a certain date, use `update_time` - * restricted with that particular date, time, and timezone in ISO datetime - * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - * `update_time` only supports the greater than operator (`>`). - * Examples: - * - `organization="organizations/123456789"` - * - `project="projects/my-project-id"` - * - `project="projects/123456789"` - * - `organization="organizations/123456789" AND state=CLOSED` - * - `project="projects/my-project-id" AND creator.email="tester@example.com"` - * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - */ - // const query = 'abc123' - /** - * The maximum number of cases fetched with each request. The default page - * size is 10. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - */ - // const pageToken = 'abc123' - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callSearchCases() { - // Construct request - const request = { - }; - - // Run request - const iterable = supportClient.searchCasesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callSearchCases(); - // [END cloudsupport_v2_generated_CaseService_SearchCases_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.update_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.update_case.js deleted file mode 100644 index 1fa63a79ae2..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2/case_service.update_case.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(case) { - // [START cloudsupport_v2_generated_CaseService_UpdateCase_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The case to update. - */ - // const case = {} - /** - * A list of attributes of the case that should be updated. Supported values - * are `priority`, `display_name`, and `subscriber_email_addresses`. If no - * fields are specified, all supported fields are updated. - * Be careful - if you do not provide a field mask, then you might - * accidentally clear some fields. For example, if you leave the field mask - * empty and do not provide a value for `subscriber_email_addresses`, then - * `subscriber_email_addresses` is updated to empty. - */ - // const updateMask = {} - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callUpdateCase() { - // Construct request - const request = { - case, - }; - - // Run request - const response = await supportClient.updateCase(request); - console.log(response); - } - - callUpdateCase(); - // [END cloudsupport_v2_generated_CaseService_UpdateCase_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.create_comment.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.create_comment.js deleted file mode 100644 index da6bf18fec6..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.create_comment.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(parent, comment) { - // [START cloudsupport_v2_generated_CommentService_CreateComment_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 case to which the comment should be added. - */ - // const parent = 'abc123' - /** - * Required. The comment to be added. - */ - // const comment = {} - - // Imports the Support library - const {CommentServiceClient} = require('@google-cloud/support').v2; - - // Instantiates a client - const supportClient = new CommentServiceClient(); - - async function callCreateComment() { - // Construct request - const request = { - parent, - comment, - }; - - // Run request - const response = await supportClient.createComment(request); - console.log(response); - } - - callCreateComment(); - // [END cloudsupport_v2_generated_CommentService_CreateComment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.list_comments.js b/owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.list_comments.js deleted file mode 100644 index f2944c228e2..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2/comment_service.list_comments.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) { - // [START cloudsupport_v2_generated_CommentService_ListComments_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 case for which to list comments. - */ - // const parent = 'abc123' - /** - * The maximum number of comments to fetch. Defaults to 10. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. If unspecified, the - * first page is returned. - */ - // const pageToken = 'abc123' - - // Imports the Support library - const {CommentServiceClient} = require('@google-cloud/support').v2; - - // Instantiates a client - const supportClient = new CommentServiceClient(); - - async function callListComments() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = supportClient.listCommentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListComments(); - // [END cloudsupport_v2_generated_CommentService_ListComments_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2/snippet_metadata_google.cloud.support.v2.json b/owl-bot-staging/google-cloud-support/samples/generated/v2/snippet_metadata_google.cloud.support.v2.json deleted file mode 100644 index fa991325c32..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2/snippet_metadata_google.cloud.support.v2.json +++ /dev/null @@ -1,519 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-support", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.support.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "regionTag": "cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_async", - "title": "CaseAttachmentService listAttachments Sample", - "origin": "API_DEFINITION", - "description": " List all the attachments associated with a support case.", - "canonical": true, - "file": "case_attachment_service.list_attachments.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAttachments", - "fullName": "google.cloud.support.v2.CaseAttachmentService.ListAttachments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2.ListAttachmentsResponse", - "client": { - "shortName": "CaseAttachmentServiceClient", - "fullName": "google.cloud.support.v2.CaseAttachmentServiceClient" - }, - "method": { - "shortName": "ListAttachments", - "fullName": "google.cloud.support.v2.CaseAttachmentService.ListAttachments", - "service": { - "shortName": "CaseAttachmentService", - "fullName": "google.cloud.support.v2.CaseAttachmentService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2_generated_CaseService_GetCase_async", - "title": "CaseAttachmentService getCase Sample", - "origin": "API_DEFINITION", - "description": " Retrieve a case.", - "canonical": true, - "file": "case_service.get_case.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCase", - "fullName": "google.cloud.support.v2.CaseService.GetCase", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2.Case", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2.CaseServiceClient" - }, - "method": { - "shortName": "GetCase", - "fullName": "google.cloud.support.v2.CaseService.GetCase", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2_generated_CaseService_ListCases_async", - "title": "CaseAttachmentService listCases Sample", - "origin": "API_DEFINITION", - "description": " Retrieve all cases under a parent, but not its children. For example, listing cases under an organization only returns the cases that are directly parented by that organization. To retrieve cases under an organization and its projects, use `cases.search`.", - "canonical": true, - "file": "case_service.list_cases.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCases", - "fullName": "google.cloud.support.v2.CaseService.ListCases", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2.ListCasesResponse", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2.CaseServiceClient" - }, - "method": { - "shortName": "ListCases", - "fullName": "google.cloud.support.v2.CaseService.ListCases", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2_generated_CaseService_SearchCases_async", - "title": "CaseAttachmentService searchCases Sample", - "origin": "API_DEFINITION", - "description": " Search for cases using a query.", - "canonical": true, - "file": "case_service.search_cases.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 92, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchCases", - "fullName": "google.cloud.support.v2.CaseService.SearchCases", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2.SearchCasesResponse", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2.CaseServiceClient" - }, - "method": { - "shortName": "SearchCases", - "fullName": "google.cloud.support.v2.CaseService.SearchCases", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2_generated_CaseService_CreateCase_async", - "title": "CaseAttachmentService createCase Sample", - "origin": "API_DEFINITION", - "description": " Create a new case and associate it with a parent. It must have the following fields set: `display_name`, `description`, `classification`, and `priority`. If you're just testing the API and don't want to route your case to an agent, set `testCase=true`.", - "canonical": true, - "file": "case_service.create_case.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCase", - "fullName": "google.cloud.support.v2.CaseService.CreateCase", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "case", - "type": ".google.cloud.support.v2.Case" - } - ], - "resultType": ".google.cloud.support.v2.Case", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2.CaseServiceClient" - }, - "method": { - "shortName": "CreateCase", - "fullName": "google.cloud.support.v2.CaseService.CreateCase", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2_generated_CaseService_UpdateCase_async", - "title": "CaseAttachmentService updateCase Sample", - "origin": "API_DEFINITION", - "description": " Update a case. Only some fields can be updated.", - "canonical": true, - "file": "case_service.update_case.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCase", - "fullName": "google.cloud.support.v2.CaseService.UpdateCase", - "async": true, - "parameters": [ - { - "name": "case", - "type": ".google.cloud.support.v2.Case" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.support.v2.Case", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2.CaseServiceClient" - }, - "method": { - "shortName": "UpdateCase", - "fullName": "google.cloud.support.v2.CaseService.UpdateCase", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2_generated_CaseService_EscalateCase_async", - "title": "CaseAttachmentService escalateCase Sample", - "origin": "API_DEFINITION", - "description": " Escalate a case, starting the Google Cloud Support escalation management process. This operation is only available for some support services. Go to https://cloud.google.com/support and look for 'Technical support escalations' in the feature list to find out which ones let you do that.", - "canonical": true, - "file": "case_service.escalate_case.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "EscalateCase", - "fullName": "google.cloud.support.v2.CaseService.EscalateCase", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "escalation", - "type": ".google.cloud.support.v2.Escalation" - } - ], - "resultType": ".google.cloud.support.v2.Case", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2.CaseServiceClient" - }, - "method": { - "shortName": "EscalateCase", - "fullName": "google.cloud.support.v2.CaseService.EscalateCase", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2_generated_CaseService_CloseCase_async", - "title": "CaseAttachmentService closeCase Sample", - "origin": "API_DEFINITION", - "description": " Close a case.", - "canonical": true, - "file": "case_service.close_case.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CloseCase", - "fullName": "google.cloud.support.v2.CaseService.CloseCase", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2.Case", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2.CaseServiceClient" - }, - "method": { - "shortName": "CloseCase", - "fullName": "google.cloud.support.v2.CaseService.CloseCase", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2_generated_CaseService_SearchCaseClassifications_async", - "title": "CaseAttachmentService searchCaseClassifications Sample", - "origin": "API_DEFINITION", - "description": " Retrieve valid classifications to use when creating a support case. Classifications are hierarchical. Each classification is a string containing all levels of the hierarchy separated by `\" > \"`. For example, `\"Technical Issue > Compute > Compute Engine\"`. Classification IDs returned by this endpoint are valid for at least six months. When a classification is deactivated, this endpoint immediately stops returning it. After six months, `case.create` requests using the classification will fail.", - "canonical": true, - "file": "case_service.search_case_classifications.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchCaseClassifications", - "fullName": "google.cloud.support.v2.CaseService.SearchCaseClassifications", - "async": true, - "parameters": [ - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2.SearchCaseClassificationsResponse", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2.CaseServiceClient" - }, - "method": { - "shortName": "SearchCaseClassifications", - "fullName": "google.cloud.support.v2.CaseService.SearchCaseClassifications", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2_generated_CommentService_ListComments_async", - "title": "CaseAttachmentService listComments Sample", - "origin": "API_DEFINITION", - "description": " List all the comments associated with a case.", - "canonical": true, - "file": "comment_service.list_comments.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListComments", - "fullName": "google.cloud.support.v2.CommentService.ListComments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2.ListCommentsResponse", - "client": { - "shortName": "CommentServiceClient", - "fullName": "google.cloud.support.v2.CommentServiceClient" - }, - "method": { - "shortName": "ListComments", - "fullName": "google.cloud.support.v2.CommentService.ListComments", - "service": { - "shortName": "CommentService", - "fullName": "google.cloud.support.v2.CommentService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2_generated_CommentService_CreateComment_async", - "title": "CaseAttachmentService createComment Sample", - "origin": "API_DEFINITION", - "description": " Add a new comment to a case. The comment must have the following fields set: `body`.", - "canonical": true, - "file": "comment_service.create_comment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateComment", - "fullName": "google.cloud.support.v2.CommentService.CreateComment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "comment", - "type": ".google.cloud.support.v2.Comment" - } - ], - "resultType": ".google.cloud.support.v2.Comment", - "client": { - "shortName": "CommentServiceClient", - "fullName": "google.cloud.support.v2.CommentServiceClient" - }, - "method": { - "shortName": "CreateComment", - "fullName": "google.cloud.support.v2.CommentService.CreateComment", - "service": { - "shortName": "CommentService", - "fullName": "google.cloud.support.v2.CommentService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.get_attachment.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.get_attachment.js deleted file mode 100644 index 4daed19740b..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.get_attachment.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 cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 attachment to get. - */ - // const name = 'abc123' - - // Imports the Support library - const {CaseAttachmentServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CaseAttachmentServiceClient(); - - async function callGetAttachment() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await supportClient.getAttachment(request); - console.log(response); - } - - callGetAttachment(); - // [END cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.list_attachments.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.list_attachments.js deleted file mode 100644 index 7bfe8cbb5b1..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_attachment_service.list_attachments.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 case for which attachments should be listed. - */ - // const parent = 'abc123' - /** - * The maximum number of attachments fetched with each request. - * If not provided, the default is 10. The maximum page size that will be - * returned is 100. - * The size of each page can be smaller than the requested page size and can - * include zero. For example, you could request 100 attachments on one page, - * receive 0, and then on the next page, receive 90. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - */ - // const pageToken = 'abc123' - - // Imports the Support library - const {CaseAttachmentServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CaseAttachmentServiceClient(); - - async function callListAttachments() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = supportClient.listAttachmentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAttachments(); - // [END cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.close_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.close_case.js deleted file mode 100644 index ebb2c3f8bf0..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.close_case.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 cloudsupport_v2beta_generated_CaseService_CloseCase_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 case to close. - */ - // const name = 'abc123' - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callCloseCase() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await supportClient.closeCase(request); - console.log(response); - } - - callCloseCase(); - // [END cloudsupport_v2beta_generated_CaseService_CloseCase_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.create_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.create_case.js deleted file mode 100644 index 9719dd4d6a5..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.create_case.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(parent, case) { - // [START cloudsupport_v2beta_generated_CaseService_CreateCase_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent under which the case should be created. - */ - // const parent = 'abc123' - /** - * Required. The case to be created. - */ - // const case = {} - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callCreateCase() { - // Construct request - const request = { - parent, - case, - }; - - // Run request - const response = await supportClient.createCase(request); - console.log(response); - } - - callCreateCase(); - // [END cloudsupport_v2beta_generated_CaseService_CreateCase_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.escalate_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.escalate_case.js deleted file mode 100644 index a540a7f3252..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.escalate_case.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(name) { - // [START cloudsupport_v2beta_generated_CaseService_EscalateCase_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 case to be escalated. - */ - // const name = 'abc123' - /** - * The escalation information to be sent with the escalation request. - */ - // const escalation = {} - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callEscalateCase() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await supportClient.escalateCase(request); - console.log(response); - } - - callEscalateCase(); - // [END cloudsupport_v2beta_generated_CaseService_EscalateCase_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.get_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.get_case.js deleted file mode 100644 index 69fcd3a222e..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.get_case.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 cloudsupport_v2beta_generated_CaseService_GetCase_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The full name of a case to be retrieved. - */ - // const name = 'abc123' - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callGetCase() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await supportClient.getCase(request); - console.log(response); - } - - callGetCase(); - // [END cloudsupport_v2beta_generated_CaseService_GetCase_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.list_cases.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.list_cases.js deleted file mode 100644 index 9a406ebdf7e..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.list_cases.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START cloudsupport_v2beta_generated_CaseService_ListCases_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 a parent to list cases under. - */ - // const parent = 'abc123' - /** - * An expression used to filter cases. - * If it's an empty string, then no filtering happens. Otherwise, the endpoint - * returns the cases that match the filter. - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * EXAMPLES: - * - `state=CLOSED` - * - `state=OPEN AND creator.email="tester@example.com"` - * - `state=OPEN AND (priority=P0 OR priority=P1)` - */ - // const filter = 'abc123' - /** - * The maximum number of cases fetched with each request. Defaults to 10. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - */ - // const pageToken = 'abc123' - /** - * The product line to request cases for. If unspecified, only - * Google Cloud cases will be returned. - */ - // const productLine = {} - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callListCases() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = supportClient.listCasesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCases(); - // [END cloudsupport_v2beta_generated_CaseService_ListCases_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_case_classifications.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_case_classifications.js deleted file mode 100644 index e48944ac618..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_case_classifications.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() { - // [START cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * An expression used to filter case classifications. - * If it's an empty string, then no filtering happens. Otherwise, case - * classifications will be returned that match the filter. - */ - // const query = 'abc123' - /** - * The maximum number of classifications fetched with each request. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - */ - // const pageToken = 'abc123' - /** - * Optional. The product to return case classifications for. - */ - // const product = {} - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callSearchCaseClassifications() { - // Construct request - const request = { - }; - - // Run request - const iterable = supportClient.searchCaseClassificationsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callSearchCaseClassifications(); - // [END cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_cases.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_cases.js deleted file mode 100644 index d801f1e7d48..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.search_cases.js +++ /dev/null @@ -1,100 +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 cloudsupport_v2beta_generated_CaseService_SearchCases_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 name of the parent resource to search for cases under. - */ - // const parent = 'abc123' - /** - * An expression used to filter cases. - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - `organization`: An organization name in the form - * `organizations/`. - * - `project`: A project name in the form `projects/`. - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * You must specify either `organization` or `project`. - * To search across `displayName`, `description`, and comments, use a global - * restriction with no keyword or operator. For example, `"my search"`. - * To search only cases updated after a certain date, use `update_time` - * restricted with that particular date, time, and timezone in ISO datetime - * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - * `update_time` only supports the greater than operator (`>`). - * Examples: - * - `organization="organizations/123456789"` - * - `project="projects/my-project-id"` - * - `project="projects/123456789"` - * - `organization="organizations/123456789" AND state=CLOSED` - * - `project="projects/my-project-id" AND creator.email="tester@example.com"` - * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - */ - // const query = 'abc123' - /** - * The maximum number of cases fetched with each request. The default page - * size is 10. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - */ - // const pageToken = 'abc123' - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callSearchCases() { - // Construct request - const request = { - }; - - // Run request - const iterable = supportClient.searchCasesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callSearchCases(); - // [END cloudsupport_v2beta_generated_CaseService_SearchCases_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.update_case.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.update_case.js deleted file mode 100644 index 69696767fca..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/case_service.update_case.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(case) { - // [START cloudsupport_v2beta_generated_CaseService_UpdateCase_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The case to update. - */ - // const case = {} - /** - * A list of attributes of the case that should be updated. Supported values - * are `priority`, `display_name`, and `subscriber_email_addresses`. If no - * fields are specified, all supported fields are updated. - * Be careful - if you do not provide a field mask, then you might - * accidentally clear some fields. For example, if you leave the field mask - * empty and do not provide a value for `subscriber_email_addresses`, then - * `subscriber_email_addresses` is updated to empty. - */ - // const updateMask = {} - - // Imports the Support library - const {CaseServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CaseServiceClient(); - - async function callUpdateCase() { - // Construct request - const request = { - case, - }; - - // Run request - const response = await supportClient.updateCase(request); - console.log(response); - } - - callUpdateCase(); - // [END cloudsupport_v2beta_generated_CaseService_UpdateCase_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.create_comment.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.create_comment.js deleted file mode 100644 index 2bb63bc5bfc..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.create_comment.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(parent, comment) { - // [START cloudsupport_v2beta_generated_CommentService_CreateComment_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 case to which the comment should be added. - */ - // const parent = 'abc123' - /** - * Required. The comment to be added. - */ - // const comment = {} - - // Imports the Support library - const {CommentServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CommentServiceClient(); - - async function callCreateComment() { - // Construct request - const request = { - parent, - comment, - }; - - // Run request - const response = await supportClient.createComment(request); - console.log(response); - } - - callCreateComment(); - // [END cloudsupport_v2beta_generated_CommentService_CreateComment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.get_comment.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.get_comment.js deleted file mode 100644 index 52098d93ab3..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.get_comment.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 cloudsupport_v2beta_generated_CommentService_GetComment_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 comment to retrieve. - */ - // const name = 'abc123' - - // Imports the Support library - const {CommentServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CommentServiceClient(); - - async function callGetComment() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await supportClient.getComment(request); - console.log(response); - } - - callGetComment(); - // [END cloudsupport_v2beta_generated_CommentService_GetComment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.list_comments.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.list_comments.js deleted file mode 100644 index 98d2dde3539..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/comment_service.list_comments.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) { - // [START cloudsupport_v2beta_generated_CommentService_ListComments_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 case for which to list comments. - */ - // const parent = 'abc123' - /** - * The maximum number of comments to fetch. Defaults to 10. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. If unspecified, the - * first page is returned. - */ - // const pageToken = 'abc123' - - // Imports the Support library - const {CommentServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new CommentServiceClient(); - - async function callListComments() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = supportClient.listCommentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListComments(); - // [END cloudsupport_v2beta_generated_CommentService_ListComments_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/feed_service.show_feed.js b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/feed_service.show_feed.js deleted file mode 100644 index f50cc73f2d4..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/feed_service.show_feed.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START cloudsupport_v2beta_generated_FeedService_ShowFeed_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require 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 case for which feed items should be - * listed. - */ - // const parent = 'abc123' - /** - * Optional. Field to order feed items by, followed by `asc` or `desc` - * postfix. The only valid field is - * `creation_time`. This list is case-insensitive, default sorting order is - * ascending, and the redundant space characters are insignificant. - * Example: `creation_time desc` - */ - // const orderBy = 'abc123' - /** - * Optional. The maximum number of feed items fetched with each request. - */ - // const pageSize = 1234 - /** - * Optional. A token identifying the page of results to return. If - * unspecified, it retrieves the first page. - */ - // const pageToken = 'abc123' - - // Imports the Support library - const {FeedServiceClient} = require('@google-cloud/support').v2beta; - - // Instantiates a client - const supportClient = new FeedServiceClient(); - - async function callShowFeed() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = supportClient.showFeedAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callShowFeed(); - // [END cloudsupport_v2beta_generated_FeedService_ShowFeed_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/snippet_metadata_google.cloud.support.v2beta.json b/owl-bot-staging/google-cloud-support/samples/generated/v2beta/snippet_metadata_google.cloud.support.v2beta.json deleted file mode 100644 index b1a16161856..00000000000 --- a/owl-bot-staging/google-cloud-support/samples/generated/v2beta/snippet_metadata_google.cloud.support.v2beta.json +++ /dev/null @@ -1,659 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-support", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.support.v2beta", - "version": "v2beta" - } - ] - }, - "snippets": [ - { - "regionTag": "cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_async", - "title": "CaseAttachmentService listAttachments Sample", - "origin": "API_DEFINITION", - "description": " List all the attachments associated with a support case.", - "canonical": true, - "file": "case_attachment_service.list_attachments.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAttachments", - "fullName": "google.cloud.support.v2beta.CaseAttachmentService.ListAttachments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2beta.ListAttachmentsResponse", - "client": { - "shortName": "CaseAttachmentServiceClient", - "fullName": "google.cloud.support.v2beta.CaseAttachmentServiceClient" - }, - "method": { - "shortName": "ListAttachments", - "fullName": "google.cloud.support.v2beta.CaseAttachmentService.ListAttachments", - "service": { - "shortName": "CaseAttachmentService", - "fullName": "google.cloud.support.v2beta.CaseAttachmentService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_async", - "title": "CaseAttachmentService getAttachment Sample", - "origin": "API_DEFINITION", - "description": " Retrieve an attachment.", - "canonical": true, - "file": "case_attachment_service.get_attachment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAttachment", - "fullName": "google.cloud.support.v2beta.CaseAttachmentService.GetAttachment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2beta.Attachment", - "client": { - "shortName": "CaseAttachmentServiceClient", - "fullName": "google.cloud.support.v2beta.CaseAttachmentServiceClient" - }, - "method": { - "shortName": "GetAttachment", - "fullName": "google.cloud.support.v2beta.CaseAttachmentService.GetAttachment", - "service": { - "shortName": "CaseAttachmentService", - "fullName": "google.cloud.support.v2beta.CaseAttachmentService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_CaseService_GetCase_async", - "title": "CaseAttachmentService getCase Sample", - "origin": "API_DEFINITION", - "description": " Retrieve a case.", - "canonical": true, - "file": "case_service.get_case.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCase", - "fullName": "google.cloud.support.v2beta.CaseService.GetCase", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2beta.Case", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2beta.CaseServiceClient" - }, - "method": { - "shortName": "GetCase", - "fullName": "google.cloud.support.v2beta.CaseService.GetCase", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2beta.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_CaseService_ListCases_async", - "title": "CaseAttachmentService listCases Sample", - "origin": "API_DEFINITION", - "description": " Retrieve all cases under a parent, but not its children. For example, listing cases under an organization only returns the cases that are directly parented by that organization. To retrieve cases under an organization and its projects, use `cases.search`.", - "canonical": true, - "file": "case_service.list_cases.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 86, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCases", - "fullName": "google.cloud.support.v2beta.CaseService.ListCases", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "product_line", - "type": ".google.cloud.support.v2beta.ProductLine" - } - ], - "resultType": ".google.cloud.support.v2beta.ListCasesResponse", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2beta.CaseServiceClient" - }, - "method": { - "shortName": "ListCases", - "fullName": "google.cloud.support.v2beta.CaseService.ListCases", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2beta.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_CaseService_SearchCases_async", - "title": "CaseAttachmentService searchCases Sample", - "origin": "API_DEFINITION", - "description": " Search for cases using a query.", - "canonical": true, - "file": "case_service.search_cases.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 92, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchCases", - "fullName": "google.cloud.support.v2beta.CaseService.SearchCases", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2beta.SearchCasesResponse", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2beta.CaseServiceClient" - }, - "method": { - "shortName": "SearchCases", - "fullName": "google.cloud.support.v2beta.CaseService.SearchCases", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2beta.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_CaseService_CreateCase_async", - "title": "CaseAttachmentService createCase Sample", - "origin": "API_DEFINITION", - "description": " Create a new case and associate it with a parent. It must have the following fields set: `display_name`, `description`, `classification`, and `priority`. If you're just testing the API and don't want to route your case to an agent, set `testCase=true`.", - "canonical": true, - "file": "case_service.create_case.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCase", - "fullName": "google.cloud.support.v2beta.CaseService.CreateCase", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "case", - "type": ".google.cloud.support.v2beta.Case" - } - ], - "resultType": ".google.cloud.support.v2beta.Case", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2beta.CaseServiceClient" - }, - "method": { - "shortName": "CreateCase", - "fullName": "google.cloud.support.v2beta.CaseService.CreateCase", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2beta.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_CaseService_UpdateCase_async", - "title": "CaseAttachmentService updateCase Sample", - "origin": "API_DEFINITION", - "description": " Update a case. Only some fields can be updated.", - "canonical": true, - "file": "case_service.update_case.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCase", - "fullName": "google.cloud.support.v2beta.CaseService.UpdateCase", - "async": true, - "parameters": [ - { - "name": "case", - "type": ".google.cloud.support.v2beta.Case" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.support.v2beta.Case", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2beta.CaseServiceClient" - }, - "method": { - "shortName": "UpdateCase", - "fullName": "google.cloud.support.v2beta.CaseService.UpdateCase", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2beta.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_CaseService_EscalateCase_async", - "title": "CaseAttachmentService escalateCase Sample", - "origin": "API_DEFINITION", - "description": " Escalate a case, starting the Google Cloud Support escalation management process. This operation is only available for some support services. Go to https://cloud.google.com/support and look for 'Technical support escalations' in the feature list to find out which ones let you do that.", - "canonical": true, - "file": "case_service.escalate_case.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "EscalateCase", - "fullName": "google.cloud.support.v2beta.CaseService.EscalateCase", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "escalation", - "type": ".google.cloud.support.v2beta.Escalation" - } - ], - "resultType": ".google.cloud.support.v2beta.Case", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2beta.CaseServiceClient" - }, - "method": { - "shortName": "EscalateCase", - "fullName": "google.cloud.support.v2beta.CaseService.EscalateCase", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2beta.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_CaseService_CloseCase_async", - "title": "CaseAttachmentService closeCase Sample", - "origin": "API_DEFINITION", - "description": " Close a case.", - "canonical": true, - "file": "case_service.close_case.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CloseCase", - "fullName": "google.cloud.support.v2beta.CaseService.CloseCase", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2beta.Case", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2beta.CaseServiceClient" - }, - "method": { - "shortName": "CloseCase", - "fullName": "google.cloud.support.v2beta.CaseService.CloseCase", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2beta.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_async", - "title": "CaseAttachmentService searchCaseClassifications Sample", - "origin": "API_DEFINITION", - "description": " Retrieve valid classifications to use when creating a support case. Classifications are hierarchical. Each classification is a string containing all levels of the hierarchy separated by `\" > \"`. For example, `\"Technical Issue > Compute > Compute Engine\"`. Classification IDs returned by this endpoint are valid for at least six months. When a classification is deactivated, this endpoint immediately stops returning it. After six months, `case.create` requests using the classification will fail.", - "canonical": true, - "file": "case_service.search_case_classifications.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchCaseClassifications", - "fullName": "google.cloud.support.v2beta.CaseService.SearchCaseClassifications", - "async": true, - "parameters": [ - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "product", - "type": ".google.cloud.support.v2beta.Product" - } - ], - "resultType": ".google.cloud.support.v2beta.SearchCaseClassificationsResponse", - "client": { - "shortName": "CaseServiceClient", - "fullName": "google.cloud.support.v2beta.CaseServiceClient" - }, - "method": { - "shortName": "SearchCaseClassifications", - "fullName": "google.cloud.support.v2beta.CaseService.SearchCaseClassifications", - "service": { - "shortName": "CaseService", - "fullName": "google.cloud.support.v2beta.CaseService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_CommentService_ListComments_async", - "title": "CaseAttachmentService listComments Sample", - "origin": "API_DEFINITION", - "description": " List all the comments associated with a case.", - "canonical": true, - "file": "comment_service.list_comments.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListComments", - "fullName": "google.cloud.support.v2beta.CommentService.ListComments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2beta.ListCommentsResponse", - "client": { - "shortName": "CommentServiceClient", - "fullName": "google.cloud.support.v2beta.CommentServiceClient" - }, - "method": { - "shortName": "ListComments", - "fullName": "google.cloud.support.v2beta.CommentService.ListComments", - "service": { - "shortName": "CommentService", - "fullName": "google.cloud.support.v2beta.CommentService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_CommentService_CreateComment_async", - "title": "CaseAttachmentService createComment Sample", - "origin": "API_DEFINITION", - "description": " Add a new comment to a case. The comment must have the following fields set: `body`.", - "canonical": true, - "file": "comment_service.create_comment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateComment", - "fullName": "google.cloud.support.v2beta.CommentService.CreateComment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "comment", - "type": ".google.cloud.support.v2beta.Comment" - } - ], - "resultType": ".google.cloud.support.v2beta.Comment", - "client": { - "shortName": "CommentServiceClient", - "fullName": "google.cloud.support.v2beta.CommentServiceClient" - }, - "method": { - "shortName": "CreateComment", - "fullName": "google.cloud.support.v2beta.CommentService.CreateComment", - "service": { - "shortName": "CommentService", - "fullName": "google.cloud.support.v2beta.CommentService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_CommentService_GetComment_async", - "title": "CaseAttachmentService getComment Sample", - "origin": "API_DEFINITION", - "description": " Retrieve a comment.", - "canonical": true, - "file": "comment_service.get_comment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetComment", - "fullName": "google.cloud.support.v2beta.CommentService.GetComment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2beta.Comment", - "client": { - "shortName": "CommentServiceClient", - "fullName": "google.cloud.support.v2beta.CommentServiceClient" - }, - "method": { - "shortName": "GetComment", - "fullName": "google.cloud.support.v2beta.CommentService.GetComment", - "service": { - "shortName": "CommentService", - "fullName": "google.cloud.support.v2beta.CommentService" - } - } - } - }, - { - "regionTag": "cloudsupport_v2beta_generated_FeedService_ShowFeed_async", - "title": "CaseAttachmentService showFeed Sample", - "origin": "API_DEFINITION", - "description": " Show items in the feed of this case, including case emails, attachments, and comments.", - "canonical": true, - "file": "feed_service.show_feed.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ShowFeed", - "fullName": "google.cloud.support.v2beta.FeedService.ShowFeed", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.support.v2beta.ShowFeedResponse", - "client": { - "shortName": "FeedServiceClient", - "fullName": "google.cloud.support.v2beta.FeedServiceClient" - }, - "method": { - "shortName": "ShowFeed", - "fullName": "google.cloud.support.v2beta.FeedService.ShowFeed", - "service": { - "shortName": "FeedService", - "fullName": "google.cloud.support.v2beta.FeedService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-support/src/index.ts b/owl-bot-staging/google-cloud-support/src/index.ts deleted file mode 100644 index fc0d62b6479..00000000000 --- a/owl-bot-staging/google-cloud-support/src/index.ts +++ /dev/null @@ -1,32 +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 v2 from './v2'; -import * as v2beta from './v2beta'; - -const CaseAttachmentServiceClient = v2.CaseAttachmentServiceClient; -type CaseAttachmentServiceClient = v2.CaseAttachmentServiceClient; -const CaseServiceClient = v2.CaseServiceClient; -type CaseServiceClient = v2.CaseServiceClient; -const CommentServiceClient = v2.CommentServiceClient; -type CommentServiceClient = v2.CommentServiceClient; - -export {v2, v2beta, CaseAttachmentServiceClient, CaseServiceClient, CommentServiceClient}; -export default {v2, v2beta, CaseAttachmentServiceClient, CaseServiceClient, CommentServiceClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client.ts deleted file mode 100644 index e1ed9634d72..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client.ts +++ /dev/null @@ -1,858 +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, PaginationCallback, GaxCall} 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/v2/case_attachment_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './case_attachment_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * A service to manage file attachments for Google Cloud support cases. - * @class - * @memberof v2 - */ -export class CaseAttachmentServiceClient { - 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('support'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - caseAttachmentServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of CaseAttachmentServiceClient. - * - * @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 CaseAttachmentServiceClient({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 CaseAttachmentServiceClient; - 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 = 'cloudsupport.' + 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; - } - - // 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 = { - organizationCasePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}' - ), - organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' - ), - organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/comments/{comment}' - ), - projectCasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}' - ), - projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/attachments/{attachment_id}' - ), - projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/comments/{comment}' - ), - }; - - // 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 = { - listAttachments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attachments') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.support.v2.CaseAttachmentService', 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.caseAttachmentServiceStub) { - return this.caseAttachmentServiceStub; - } - - // Put together the "service stub" for - // google.cloud.support.v2.CaseAttachmentService. - this.caseAttachmentServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.support.v2.CaseAttachmentService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.support.v2.CaseAttachmentService, - 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 caseAttachmentServiceStubMethods = - ['listAttachments']; - for (const methodName of caseAttachmentServiceStubMethods) { - const callPromise = this.caseAttachmentServiceStub.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] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.caseAttachmentServiceStub; - } - - /** - * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * List all the attachments associated with a support case. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case for which attachments should be listed. - * @param {number} request.pageSize - * The maximum number of attachments fetched with each request. - * - * If not provided, the default is 10. The maximum page size that will be - * returned is 100. - * - * The size of each page can be smaller than the requested page size and can - * include zero. For example, you could request 100 attachments on one page, - * receive 0, and then on the next page, receive 90. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2.Attachment|Attachment}. - * 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 `listAttachmentsAsync()` - * 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. - */ - listAttachments( - request?: protos.google.cloud.support.v2.IListAttachmentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2.IAttachment[], - protos.google.cloud.support.v2.IListAttachmentsRequest|null, - protos.google.cloud.support.v2.IListAttachmentsResponse - ]>; - listAttachments( - request: protos.google.cloud.support.v2.IListAttachmentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.support.v2.IListAttachmentsRequest, - protos.google.cloud.support.v2.IListAttachmentsResponse|null|undefined, - protos.google.cloud.support.v2.IAttachment>): void; - listAttachments( - request: protos.google.cloud.support.v2.IListAttachmentsRequest, - callback: PaginationCallback< - protos.google.cloud.support.v2.IListAttachmentsRequest, - protos.google.cloud.support.v2.IListAttachmentsResponse|null|undefined, - protos.google.cloud.support.v2.IAttachment>): void; - listAttachments( - request?: protos.google.cloud.support.v2.IListAttachmentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.support.v2.IListAttachmentsRequest, - protos.google.cloud.support.v2.IListAttachmentsResponse|null|undefined, - protos.google.cloud.support.v2.IAttachment>, - callback?: PaginationCallback< - protos.google.cloud.support.v2.IListAttachmentsRequest, - protos.google.cloud.support.v2.IListAttachmentsResponse|null|undefined, - protos.google.cloud.support.v2.IAttachment>): - Promise<[ - protos.google.cloud.support.v2.IAttachment[], - protos.google.cloud.support.v2.IListAttachmentsRequest|null, - protos.google.cloud.support.v2.IListAttachmentsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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.support.v2.IListAttachmentsRequest, - protos.google.cloud.support.v2.IListAttachmentsResponse|null|undefined, - protos.google.cloud.support.v2.IAttachment>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listAttachments values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listAttachments request %j', request); - return this.innerApiCalls - .listAttachments(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.support.v2.IAttachment[], - protos.google.cloud.support.v2.IListAttachmentsRequest|null, - protos.google.cloud.support.v2.IListAttachmentsResponse - ]) => { - this._log.info('listAttachments values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listAttachments`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case for which attachments should be listed. - * @param {number} request.pageSize - * The maximum number of attachments fetched with each request. - * - * If not provided, the default is 10. The maximum page size that will be - * returned is 100. - * - * The size of each page can be smaller than the requested page size and can - * include zero. For example, you could request 100 attachments on one page, - * receive 0, and then on the next page, receive 90. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @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.support.v2.Attachment|Attachment} 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 `listAttachmentsAsync()` - * 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. - */ - listAttachmentsStream( - request?: protos.google.cloud.support.v2.IListAttachmentsRequest, - 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['listAttachments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAttachments stream %j', request); - return this.descriptors.page.listAttachments.createStream( - this.innerApiCalls.listAttachments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAttachments`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case for which attachments should be listed. - * @param {number} request.pageSize - * The maximum number of attachments fetched with each request. - * - * If not provided, the default is 10. The maximum page size that will be - * returned is 100. - * - * The size of each page can be smaller than the requested page size and can - * include zero. For example, you could request 100 attachments on one page, - * receive 0, and then on the next page, receive 90. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @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.support.v2.Attachment|Attachment}. 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/v2/case_attachment_service.list_attachments.js - * region_tag:cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_async - */ - listAttachmentsAsync( - request?: protos.google.cloud.support.v2.IListAttachmentsRequest, - 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['listAttachments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAttachments iterate %j', request); - return this.descriptors.page.listAttachments.asyncIterate( - this.innerApiCalls['listAttachments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified organizationCase resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @returns {string} Resource name string. - */ - organizationCasePath(organization:string,caseParam:string) { - return this.pathTemplates.organizationCasePathTemplate.render({ - organization: organization, - case: caseParam, - }); - } - - /** - * Parse the organization from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; - } - - /** - * Parse the case from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; - } - - /** - * Return a fully-qualified organizationCaseAttachmentId resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ - organization: organization, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the organization from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; - } - - /** - * Parse the case from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified organizationCaseComment resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.render({ - organization: organization, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the organization from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; - } - - /** - * Parse the case from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; - } - - /** - * Parse the comment from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; - } - - /** - * Return a fully-qualified projectCase resource name string. - * - * @param {string} project - * @param {string} caseParam - * @returns {string} Resource name string. - */ - projectCasePath(project:string,caseParam:string) { - return this.pathTemplates.projectCasePathTemplate.render({ - project: project, - case: caseParam, - }); - } - - /** - * Parse the project from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; - } - - /** - * Parse the case from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; - } - - /** - * Return a fully-qualified projectCaseAttachmentId resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ - project: project, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the project from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; - } - - /** - * Parse the case from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified projectCaseComment resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - projectCaseCommentPath(project:string,caseParam:string,comment:string) { - return this.pathTemplates.projectCaseCommentPathTemplate.render({ - project: project, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the project from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; - } - - /** - * Parse the case from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; - } - - /** - * Parse the comment from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; - } - - /** - * 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.caseAttachmentServiceStub && !this._terminated) { - return this.caseAttachmentServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client_config.json deleted file mode 100644 index cbbee7880fd..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_client_config.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "interfaces": { - "google.cloud.support.v2.CaseAttachmentService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListAttachments": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_proto_list.json deleted file mode 100644 index e71d4155489..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2/case_attachment_service_proto_list.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - "../../protos/google/cloud/support/v2/actor.proto", - "../../protos/google/cloud/support/v2/attachment.proto", - "../../protos/google/cloud/support/v2/attachment_service.proto", - "../../protos/google/cloud/support/v2/case.proto", - "../../protos/google/cloud/support/v2/case_service.proto", - "../../protos/google/cloud/support/v2/comment.proto", - "../../protos/google/cloud/support/v2/comment_service.proto", - "../../protos/google/cloud/support/v2/escalation.proto" -] diff --git a/owl-bot-staging/google-cloud-support/src/v2/case_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2/case_service_client.ts deleted file mode 100644 index 2906526ea18..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2/case_service_client.ts +++ /dev/null @@ -1,1917 +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, PaginationCallback, GaxCall} 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/v2/case_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './case_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * A service to manage Google Cloud support cases. - * @class - * @memberof v2 - */ -export class CaseServiceClient { - 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('support'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - caseServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of CaseServiceClient. - * - * @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 CaseServiceClient({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 CaseServiceClient; - 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 = 'cloudsupport.' + 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; - } - - // 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 = { - organizationPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}' - ), - organizationCasePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}' - ), - organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' - ), - organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/comments/{comment}' - ), - projectCasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}' - ), - projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/attachments/{attachment_id}' - ), - projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/comments/{comment}' - ), - }; - - // 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 = { - listCases: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'cases'), - searchCases: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'cases'), - searchCaseClassifications: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'caseClassifications') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.support.v2.CaseService', 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.caseServiceStub) { - return this.caseServiceStub; - } - - // Put together the "service stub" for - // google.cloud.support.v2.CaseService. - this.caseServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.support.v2.CaseService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.support.v2.CaseService, - 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 caseServiceStubMethods = - ['getCase', 'listCases', 'searchCases', 'createCase', 'updateCase', 'escalateCase', 'closeCase', 'searchCaseClassifications']; - for (const methodName of caseServiceStubMethods) { - const callPromise = this.caseServiceStub.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] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.caseServiceStub; - } - - /** - * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Retrieve a case. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of a case to be retrieved. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Case|Case}. - * 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/v2/case_service.get_case.js - * region_tag:cloudsupport_v2_generated_CaseService_GetCase_async - */ - getCase( - request?: protos.google.cloud.support.v2.IGetCaseRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IGetCaseRequest|undefined, {}|undefined - ]>; - getCase( - request: protos.google.cloud.support.v2.IGetCaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IGetCaseRequest|null|undefined, - {}|null|undefined>): void; - getCase( - request: protos.google.cloud.support.v2.IGetCaseRequest, - callback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IGetCaseRequest|null|undefined, - {}|null|undefined>): void; - getCase( - request?: protos.google.cloud.support.v2.IGetCaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IGetCaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IGetCaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IGetCaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - 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('getCase request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IGetCaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getCase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IGetCaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('getCase 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; - }); - } -/** - * Create a new case and associate it with a parent. - * - * It must have the following fields set: `display_name`, `description`, - * `classification`, and `priority`. If you're just testing the API and don't - * want to route your case to an agent, set `testCase=true`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent under which the case should be created. - * @param {google.cloud.support.v2.Case} request.case - * Required. The case to be created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.support.v2.Case|Case}. - * 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/v2/case_service.create_case.js - * region_tag:cloudsupport_v2_generated_CaseService_CreateCase_async - */ - createCase( - request?: protos.google.cloud.support.v2.ICreateCaseRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICreateCaseRequest|undefined, {}|undefined - ]>; - createCase( - request: protos.google.cloud.support.v2.ICreateCaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICreateCaseRequest|null|undefined, - {}|null|undefined>): void; - createCase( - request: protos.google.cloud.support.v2.ICreateCaseRequest, - callback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICreateCaseRequest|null|undefined, - {}|null|undefined>): void; - createCase( - request?: protos.google.cloud.support.v2.ICreateCaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICreateCaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICreateCaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICreateCaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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('createCase request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICreateCaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createCase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createCase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICreateCaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('createCase 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; - }); - } -/** - * Update a case. Only some fields can be updated. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.support.v2.Case} request.case - * Required. The case to update. - * @param {google.protobuf.FieldMask} request.updateMask - * A list of attributes of the case that should be updated. Supported values - * are `priority`, `display_name`, and `subscriber_email_addresses`. If no - * fields are specified, all supported fields are updated. - * - * Be careful - if you do not provide a field mask, then you might - * accidentally clear some fields. For example, if you leave the field mask - * empty and do not provide a value for `subscriber_email_addresses`, then - * `subscriber_email_addresses` is updated to empty. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Case|Case}. - * 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/v2/case_service.update_case.js - * region_tag:cloudsupport_v2_generated_CaseService_UpdateCase_async - */ - updateCase( - request?: protos.google.cloud.support.v2.IUpdateCaseRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IUpdateCaseRequest|undefined, {}|undefined - ]>; - updateCase( - request: protos.google.cloud.support.v2.IUpdateCaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IUpdateCaseRequest|null|undefined, - {}|null|undefined>): void; - updateCase( - request: protos.google.cloud.support.v2.IUpdateCaseRequest, - callback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IUpdateCaseRequest|null|undefined, - {}|null|undefined>): void; - updateCase( - request?: protos.google.cloud.support.v2.IUpdateCaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IUpdateCaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IUpdateCaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IUpdateCaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'case.name': request.case!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateCase request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IUpdateCaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateCase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateCase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IUpdateCaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateCase 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; - }); - } -/** - * Escalate a case, starting the Google Cloud Support escalation management - * process. - * - * This operation is only available for some support services. Go to - * https://cloud.google.com/support and look for 'Technical support - * escalations' in the feature list to find out which ones let you - * do that. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the case to be escalated. - * @param {google.cloud.support.v2.Escalation} request.escalation - * The escalation information to be sent with the escalation request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.support.v2.Case|Case}. - * 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/v2/case_service.escalate_case.js - * region_tag:cloudsupport_v2_generated_CaseService_EscalateCase_async - */ - escalateCase( - request?: protos.google.cloud.support.v2.IEscalateCaseRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IEscalateCaseRequest|undefined, {}|undefined - ]>; - escalateCase( - request: protos.google.cloud.support.v2.IEscalateCaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IEscalateCaseRequest|null|undefined, - {}|null|undefined>): void; - escalateCase( - request: protos.google.cloud.support.v2.IEscalateCaseRequest, - callback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IEscalateCaseRequest|null|undefined, - {}|null|undefined>): void; - escalateCase( - request?: protos.google.cloud.support.v2.IEscalateCaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IEscalateCaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IEscalateCaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IEscalateCaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - 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('escalateCase request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IEscalateCaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('escalateCase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.escalateCase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.IEscalateCaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('escalateCase 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; - }); - } -/** - * Close a case. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the case to close. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Case|Case}. - * 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/v2/case_service.close_case.js - * region_tag:cloudsupport_v2_generated_CaseService_CloseCase_async - */ - closeCase( - request?: protos.google.cloud.support.v2.ICloseCaseRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICloseCaseRequest|undefined, {}|undefined - ]>; - closeCase( - request: protos.google.cloud.support.v2.ICloseCaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICloseCaseRequest|null|undefined, - {}|null|undefined>): void; - closeCase( - request: protos.google.cloud.support.v2.ICloseCaseRequest, - callback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICloseCaseRequest|null|undefined, - {}|null|undefined>): void; - closeCase( - request?: protos.google.cloud.support.v2.ICloseCaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICloseCaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICloseCaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICloseCaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - 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('closeCase request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICloseCaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('closeCase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.closeCase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2.ICase, - protos.google.cloud.support.v2.ICloseCaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('closeCase 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 all cases under a parent, but not its children. - * - * For example, listing cases under an organization only returns the cases - * that are directly parented by that organization. To retrieve cases - * under an organization and its projects, use `cases.search`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of a parent to list cases under. - * @param {string} request.filter - * An expression used to filter cases. - * - * If it's an empty string, then no filtering happens. Otherwise, the endpoint - * returns the cases that match the filter. - * - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * - * EXAMPLES: - * - * - `state=CLOSED` - * - `state=OPEN AND creator.email="tester@example.com"` - * - `state=OPEN AND (priority=P0 OR priority=P1)` - * @param {number} request.pageSize - * The maximum number of cases fetched with each request. Defaults to 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2.Case|Case}. - * 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 `listCasesAsync()` - * 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. - */ - listCases( - request?: protos.google.cloud.support.v2.IListCasesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2.ICase[], - protos.google.cloud.support.v2.IListCasesRequest|null, - protos.google.cloud.support.v2.IListCasesResponse - ]>; - listCases( - request: protos.google.cloud.support.v2.IListCasesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.support.v2.IListCasesRequest, - protos.google.cloud.support.v2.IListCasesResponse|null|undefined, - protos.google.cloud.support.v2.ICase>): void; - listCases( - request: protos.google.cloud.support.v2.IListCasesRequest, - callback: PaginationCallback< - protos.google.cloud.support.v2.IListCasesRequest, - protos.google.cloud.support.v2.IListCasesResponse|null|undefined, - protos.google.cloud.support.v2.ICase>): void; - listCases( - request?: protos.google.cloud.support.v2.IListCasesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.support.v2.IListCasesRequest, - protos.google.cloud.support.v2.IListCasesResponse|null|undefined, - protos.google.cloud.support.v2.ICase>, - callback?: PaginationCallback< - protos.google.cloud.support.v2.IListCasesRequest, - protos.google.cloud.support.v2.IListCasesResponse|null|undefined, - protos.google.cloud.support.v2.ICase>): - Promise<[ - protos.google.cloud.support.v2.ICase[], - protos.google.cloud.support.v2.IListCasesRequest|null, - protos.google.cloud.support.v2.IListCasesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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.support.v2.IListCasesRequest, - protos.google.cloud.support.v2.IListCasesResponse|null|undefined, - protos.google.cloud.support.v2.ICase>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listCases values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listCases request %j', request); - return this.innerApiCalls - .listCases(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.support.v2.ICase[], - protos.google.cloud.support.v2.IListCasesRequest|null, - protos.google.cloud.support.v2.IListCasesResponse - ]) => { - this._log.info('listCases values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listCases`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of a parent to list cases under. - * @param {string} request.filter - * An expression used to filter cases. - * - * If it's an empty string, then no filtering happens. Otherwise, the endpoint - * returns the cases that match the filter. - * - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * - * EXAMPLES: - * - * - `state=CLOSED` - * - `state=OPEN AND creator.email="tester@example.com"` - * - `state=OPEN AND (priority=P0 OR priority=P1)` - * @param {number} request.pageSize - * The maximum number of cases fetched with each request. Defaults to 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @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.support.v2.Case|Case} 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 `listCasesAsync()` - * 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. - */ - listCasesStream( - request?: protos.google.cloud.support.v2.IListCasesRequest, - 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['listCases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listCases stream %j', request); - return this.descriptors.page.listCases.createStream( - this.innerApiCalls.listCases as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listCases`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of a parent to list cases under. - * @param {string} request.filter - * An expression used to filter cases. - * - * If it's an empty string, then no filtering happens. Otherwise, the endpoint - * returns the cases that match the filter. - * - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * - * EXAMPLES: - * - * - `state=CLOSED` - * - `state=OPEN AND creator.email="tester@example.com"` - * - `state=OPEN AND (priority=P0 OR priority=P1)` - * @param {number} request.pageSize - * The maximum number of cases fetched with each request. Defaults to 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @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.support.v2.Case|Case}. 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/v2/case_service.list_cases.js - * region_tag:cloudsupport_v2_generated_CaseService_ListCases_async - */ - listCasesAsync( - request?: protos.google.cloud.support.v2.IListCasesRequest, - 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['listCases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listCases iterate %j', request); - return this.descriptors.page.listCases.asyncIterate( - this.innerApiCalls['listCases'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Search for cases using a query. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the parent resource to search for cases under. - * @param {string} request.query - * An expression used to filter cases. - * - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - * - `organization`: An organization name in the form - * `organizations/`. - * - `project`: A project name in the form `projects/`. - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * - * You must specify either `organization` or `project`. - * - * To search across `displayName`, `description`, and comments, use a global - * restriction with no keyword or operator. For example, `"my search"`. - * - * To search only cases updated after a certain date, use `update_time` - * restricted with that particular date, time, and timezone in ISO datetime - * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - * `update_time` only supports the greater than operator (`>`). - * - * Examples: - * - * - `organization="organizations/123456789"` - * - `project="projects/my-project-id"` - * - `project="projects/123456789"` - * - `organization="organizations/123456789" AND state=CLOSED` - * - `project="projects/my-project-id" AND creator.email="tester@example.com"` - * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - * @param {number} request.pageSize - * The maximum number of cases fetched with each request. The default page - * size is 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2.Case|Case}. - * 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 `searchCasesAsync()` - * 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. - */ - searchCases( - request?: protos.google.cloud.support.v2.ISearchCasesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2.ICase[], - protos.google.cloud.support.v2.ISearchCasesRequest|null, - protos.google.cloud.support.v2.ISearchCasesResponse - ]>; - searchCases( - request: protos.google.cloud.support.v2.ISearchCasesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.support.v2.ISearchCasesRequest, - protos.google.cloud.support.v2.ISearchCasesResponse|null|undefined, - protos.google.cloud.support.v2.ICase>): void; - searchCases( - request: protos.google.cloud.support.v2.ISearchCasesRequest, - callback: PaginationCallback< - protos.google.cloud.support.v2.ISearchCasesRequest, - protos.google.cloud.support.v2.ISearchCasesResponse|null|undefined, - protos.google.cloud.support.v2.ICase>): void; - searchCases( - request?: protos.google.cloud.support.v2.ISearchCasesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.support.v2.ISearchCasesRequest, - protos.google.cloud.support.v2.ISearchCasesResponse|null|undefined, - protos.google.cloud.support.v2.ICase>, - callback?: PaginationCallback< - protos.google.cloud.support.v2.ISearchCasesRequest, - protos.google.cloud.support.v2.ISearchCasesResponse|null|undefined, - protos.google.cloud.support.v2.ICase>): - Promise<[ - protos.google.cloud.support.v2.ICase[], - protos.google.cloud.support.v2.ISearchCasesRequest|null, - protos.google.cloud.support.v2.ISearchCasesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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.support.v2.ISearchCasesRequest, - protos.google.cloud.support.v2.ISearchCasesResponse|null|undefined, - protos.google.cloud.support.v2.ICase>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('searchCases values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('searchCases request %j', request); - return this.innerApiCalls - .searchCases(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.support.v2.ICase[], - protos.google.cloud.support.v2.ISearchCasesRequest|null, - protos.google.cloud.support.v2.ISearchCasesResponse - ]) => { - this._log.info('searchCases values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `searchCases`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the parent resource to search for cases under. - * @param {string} request.query - * An expression used to filter cases. - * - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - * - `organization`: An organization name in the form - * `organizations/`. - * - `project`: A project name in the form `projects/`. - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * - * You must specify either `organization` or `project`. - * - * To search across `displayName`, `description`, and comments, use a global - * restriction with no keyword or operator. For example, `"my search"`. - * - * To search only cases updated after a certain date, use `update_time` - * restricted with that particular date, time, and timezone in ISO datetime - * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - * `update_time` only supports the greater than operator (`>`). - * - * Examples: - * - * - `organization="organizations/123456789"` - * - `project="projects/my-project-id"` - * - `project="projects/123456789"` - * - `organization="organizations/123456789" AND state=CLOSED` - * - `project="projects/my-project-id" AND creator.email="tester@example.com"` - * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - * @param {number} request.pageSize - * The maximum number of cases fetched with each request. The default page - * size is 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @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.support.v2.Case|Case} 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 `searchCasesAsync()` - * 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. - */ - searchCasesStream( - request?: protos.google.cloud.support.v2.ISearchCasesRequest, - 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['searchCases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('searchCases stream %j', request); - return this.descriptors.page.searchCases.createStream( - this.innerApiCalls.searchCases as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchCases`, 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 - * The name of the parent resource to search for cases under. - * @param {string} request.query - * An expression used to filter cases. - * - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - * - `organization`: An organization name in the form - * `organizations/`. - * - `project`: A project name in the form `projects/`. - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * - * You must specify either `organization` or `project`. - * - * To search across `displayName`, `description`, and comments, use a global - * restriction with no keyword or operator. For example, `"my search"`. - * - * To search only cases updated after a certain date, use `update_time` - * restricted with that particular date, time, and timezone in ISO datetime - * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - * `update_time` only supports the greater than operator (`>`). - * - * Examples: - * - * - `organization="organizations/123456789"` - * - `project="projects/my-project-id"` - * - `project="projects/123456789"` - * - `organization="organizations/123456789" AND state=CLOSED` - * - `project="projects/my-project-id" AND creator.email="tester@example.com"` - * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - * @param {number} request.pageSize - * The maximum number of cases fetched with each request. The default page - * size is 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @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.support.v2.Case|Case}. 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/v2/case_service.search_cases.js - * region_tag:cloudsupport_v2_generated_CaseService_SearchCases_async - */ - searchCasesAsync( - request?: protos.google.cloud.support.v2.ISearchCasesRequest, - 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['searchCases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('searchCases iterate %j', request); - return this.descriptors.page.searchCases.asyncIterate( - this.innerApiCalls['searchCases'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Retrieve valid classifications to use when creating a support case. - * - * Classifications are hierarchical. Each classification is a string - * containing all levels of the hierarchy separated by `" > "`. For example, - * `"Technical Issue > Compute > Compute Engine"`. - * - * Classification IDs returned by this endpoint are valid for at least six - * months. When a classification is deactivated, this endpoint immediately - * stops returning it. After six months, `case.create` requests using the - * classification will fail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.query - * An expression used to filter case classifications. - * - * If it's an empty string, then no filtering happens. Otherwise, case - * classifications will be returned that match the filter. - * @param {number} request.pageSize - * The maximum number of classifications fetched with each request. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2.CaseClassification|CaseClassification}. - * 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 `searchCaseClassificationsAsync()` - * 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. - */ - searchCaseClassifications( - request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2.ICaseClassification[], - protos.google.cloud.support.v2.ISearchCaseClassificationsRequest|null, - protos.google.cloud.support.v2.ISearchCaseClassificationsResponse - ]>; - searchCaseClassifications( - request: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, - protos.google.cloud.support.v2.ISearchCaseClassificationsResponse|null|undefined, - protos.google.cloud.support.v2.ICaseClassification>): void; - searchCaseClassifications( - request: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, - callback: PaginationCallback< - protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, - protos.google.cloud.support.v2.ISearchCaseClassificationsResponse|null|undefined, - protos.google.cloud.support.v2.ICaseClassification>): void; - searchCaseClassifications( - request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, - protos.google.cloud.support.v2.ISearchCaseClassificationsResponse|null|undefined, - protos.google.cloud.support.v2.ICaseClassification>, - callback?: PaginationCallback< - protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, - protos.google.cloud.support.v2.ISearchCaseClassificationsResponse|null|undefined, - protos.google.cloud.support.v2.ICaseClassification>): - Promise<[ - protos.google.cloud.support.v2.ICaseClassification[], - protos.google.cloud.support.v2.ISearchCaseClassificationsRequest|null, - protos.google.cloud.support.v2.ISearchCaseClassificationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, - protos.google.cloud.support.v2.ISearchCaseClassificationsResponse|null|undefined, - protos.google.cloud.support.v2.ICaseClassification>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('searchCaseClassifications values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('searchCaseClassifications request %j', request); - return this.innerApiCalls - .searchCaseClassifications(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.support.v2.ICaseClassification[], - protos.google.cloud.support.v2.ISearchCaseClassificationsRequest|null, - protos.google.cloud.support.v2.ISearchCaseClassificationsResponse - ]) => { - this._log.info('searchCaseClassifications values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `searchCaseClassifications`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.query - * An expression used to filter case classifications. - * - * If it's an empty string, then no filtering happens. Otherwise, case - * classifications will be returned that match the filter. - * @param {number} request.pageSize - * The maximum number of classifications fetched with each request. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @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.support.v2.CaseClassification|CaseClassification} 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 `searchCaseClassificationsAsync()` - * 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. - */ - searchCaseClassificationsStream( - request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['searchCaseClassifications']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('searchCaseClassifications stream %j', request); - return this.descriptors.page.searchCaseClassifications.createStream( - this.innerApiCalls.searchCaseClassifications as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchCaseClassifications`, 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.query - * An expression used to filter case classifications. - * - * If it's an empty string, then no filtering happens. Otherwise, case - * classifications will be returned that match the filter. - * @param {number} request.pageSize - * The maximum number of classifications fetched with each request. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @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.support.v2.CaseClassification|CaseClassification}. 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/v2/case_service.search_case_classifications.js - * region_tag:cloudsupport_v2_generated_CaseService_SearchCaseClassifications_async - */ - searchCaseClassificationsAsync( - request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['searchCaseClassifications']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('searchCaseClassifications iterate %j', request); - return this.descriptors.page.searchCaseClassifications.asyncIterate( - this.innerApiCalls['searchCaseClassifications'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified organization resource name string. - * - * @param {string} organization - * @returns {string} Resource name string. - */ - organizationPath(organization:string) { - return this.pathTemplates.organizationPathTemplate.render({ - organization: organization, - }); - } - - /** - * Parse the organization from Organization resource. - * - * @param {string} organizationName - * A fully-qualified path representing Organization resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationName(organizationName: string) { - return this.pathTemplates.organizationPathTemplate.match(organizationName).organization; - } - - /** - * Return a fully-qualified organizationCase resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @returns {string} Resource name string. - */ - organizationCasePath(organization:string,caseParam:string) { - return this.pathTemplates.organizationCasePathTemplate.render({ - organization: organization, - case: caseParam, - }); - } - - /** - * Parse the organization from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; - } - - /** - * Parse the case from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; - } - - /** - * Return a fully-qualified organizationCaseAttachmentId resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ - organization: organization, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the organization from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; - } - - /** - * Parse the case from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified organizationCaseComment resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.render({ - organization: organization, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the organization from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; - } - - /** - * Parse the case from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; - } - - /** - * Parse the comment from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; - } - - /** - * Return a fully-qualified projectCase resource name string. - * - * @param {string} project - * @param {string} caseParam - * @returns {string} Resource name string. - */ - projectCasePath(project:string,caseParam:string) { - return this.pathTemplates.projectCasePathTemplate.render({ - project: project, - case: caseParam, - }); - } - - /** - * Parse the project from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; - } - - /** - * Parse the case from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; - } - - /** - * Return a fully-qualified projectCaseAttachmentId resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ - project: project, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the project from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; - } - - /** - * Parse the case from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified projectCaseComment resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - projectCaseCommentPath(project:string,caseParam:string,comment:string) { - return this.pathTemplates.projectCaseCommentPathTemplate.render({ - project: project, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the project from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; - } - - /** - * Parse the case from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; - } - - /** - * Parse the comment from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; - } - - /** - * 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.caseServiceStub && !this._terminated) { - return this.caseServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2/case_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2/case_service_client_config.json deleted file mode 100644 index a1e21087917..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2/case_service_client_config.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "interfaces": { - "google.cloud.support.v2.CaseService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "GetCase": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListCases": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "SearchCases": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateCase": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateCase": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "EscalateCase": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CloseCase": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SearchCaseClassifications": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-support/src/v2/case_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2/case_service_proto_list.json deleted file mode 100644 index e71d4155489..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2/case_service_proto_list.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - "../../protos/google/cloud/support/v2/actor.proto", - "../../protos/google/cloud/support/v2/attachment.proto", - "../../protos/google/cloud/support/v2/attachment_service.proto", - "../../protos/google/cloud/support/v2/case.proto", - "../../protos/google/cloud/support/v2/case_service.proto", - "../../protos/google/cloud/support/v2/comment.proto", - "../../protos/google/cloud/support/v2/comment_service.proto", - "../../protos/google/cloud/support/v2/escalation.proto" -] diff --git a/owl-bot-staging/google-cloud-support/src/v2/comment_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2/comment_service_client.ts deleted file mode 100644 index b4c4c584214..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2/comment_service_client.ts +++ /dev/null @@ -1,935 +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, PaginationCallback, GaxCall} 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/v2/comment_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './comment_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * A service to manage comments on cases. - * @class - * @memberof v2 - */ -export class CommentServiceClient { - 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('support'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - commentServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of CommentServiceClient. - * - * @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 CommentServiceClient({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 CommentServiceClient; - 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 = 'cloudsupport.' + 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; - } - - // 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 = { - organizationCasePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}' - ), - organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' - ), - organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/comments/{comment}' - ), - projectCasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}' - ), - projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/attachments/{attachment_id}' - ), - projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/comments/{comment}' - ), - }; - - // 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 = { - listComments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'comments') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.support.v2.CommentService', 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.commentServiceStub) { - return this.commentServiceStub; - } - - // Put together the "service stub" for - // google.cloud.support.v2.CommentService. - this.commentServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.support.v2.CommentService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.support.v2.CommentService, - 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 commentServiceStubMethods = - ['listComments', 'createComment']; - for (const methodName of commentServiceStubMethods) { - const callPromise = this.commentServiceStub.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] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.commentServiceStub; - } - - /** - * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Add a new comment to a case. - * - * The comment must have the following fields set: `body`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case to which the comment should be added. - * @param {google.cloud.support.v2.Comment} request.comment - * Required. The comment to be added. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Comment|Comment}. - * 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/v2/comment_service.create_comment.js - * region_tag:cloudsupport_v2_generated_CommentService_CreateComment_async - */ - createComment( - request?: protos.google.cloud.support.v2.ICreateCommentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2.IComment, - protos.google.cloud.support.v2.ICreateCommentRequest|undefined, {}|undefined - ]>; - createComment( - request: protos.google.cloud.support.v2.ICreateCommentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2.IComment, - protos.google.cloud.support.v2.ICreateCommentRequest|null|undefined, - {}|null|undefined>): void; - createComment( - request: protos.google.cloud.support.v2.ICreateCommentRequest, - callback: Callback< - protos.google.cloud.support.v2.IComment, - protos.google.cloud.support.v2.ICreateCommentRequest|null|undefined, - {}|null|undefined>): void; - createComment( - request?: protos.google.cloud.support.v2.ICreateCommentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2.IComment, - protos.google.cloud.support.v2.ICreateCommentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2.IComment, - protos.google.cloud.support.v2.ICreateCommentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2.IComment, - protos.google.cloud.support.v2.ICreateCommentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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('createComment request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2.IComment, - protos.google.cloud.support.v2.ICreateCommentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createComment response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createComment(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2.IComment, - protos.google.cloud.support.v2.ICreateCommentRequest|undefined, - {}|undefined - ]) => { - this._log.info('createComment 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; - }); - } - - /** - * List all the comments associated with a case. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case for which to list comments. - * @param {number} request.pageSize - * The maximum number of comments to fetch. Defaults to 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is 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 Array of {@link protos.google.cloud.support.v2.Comment|Comment}. - * 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 `listCommentsAsync()` - * 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. - */ - listComments( - request?: protos.google.cloud.support.v2.IListCommentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2.IComment[], - protos.google.cloud.support.v2.IListCommentsRequest|null, - protos.google.cloud.support.v2.IListCommentsResponse - ]>; - listComments( - request: protos.google.cloud.support.v2.IListCommentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.support.v2.IListCommentsRequest, - protos.google.cloud.support.v2.IListCommentsResponse|null|undefined, - protos.google.cloud.support.v2.IComment>): void; - listComments( - request: protos.google.cloud.support.v2.IListCommentsRequest, - callback: PaginationCallback< - protos.google.cloud.support.v2.IListCommentsRequest, - protos.google.cloud.support.v2.IListCommentsResponse|null|undefined, - protos.google.cloud.support.v2.IComment>): void; - listComments( - request?: protos.google.cloud.support.v2.IListCommentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.support.v2.IListCommentsRequest, - protos.google.cloud.support.v2.IListCommentsResponse|null|undefined, - protos.google.cloud.support.v2.IComment>, - callback?: PaginationCallback< - protos.google.cloud.support.v2.IListCommentsRequest, - protos.google.cloud.support.v2.IListCommentsResponse|null|undefined, - protos.google.cloud.support.v2.IComment>): - Promise<[ - protos.google.cloud.support.v2.IComment[], - protos.google.cloud.support.v2.IListCommentsRequest|null, - protos.google.cloud.support.v2.IListCommentsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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.support.v2.IListCommentsRequest, - protos.google.cloud.support.v2.IListCommentsResponse|null|undefined, - protos.google.cloud.support.v2.IComment>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listComments values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listComments request %j', request); - return this.innerApiCalls - .listComments(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.support.v2.IComment[], - protos.google.cloud.support.v2.IListCommentsRequest|null, - protos.google.cloud.support.v2.IListCommentsResponse - ]) => { - this._log.info('listComments values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listComments`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case for which to list comments. - * @param {number} request.pageSize - * The maximum number of comments to fetch. Defaults to 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is returned. - * @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.support.v2.Comment|Comment} 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 `listCommentsAsync()` - * 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. - */ - listCommentsStream( - request?: protos.google.cloud.support.v2.IListCommentsRequest, - 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['listComments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listComments stream %j', request); - return this.descriptors.page.listComments.createStream( - this.innerApiCalls.listComments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listComments`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case for which to list comments. - * @param {number} request.pageSize - * The maximum number of comments to fetch. Defaults to 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is returned. - * @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.support.v2.Comment|Comment}. 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/v2/comment_service.list_comments.js - * region_tag:cloudsupport_v2_generated_CommentService_ListComments_async - */ - listCommentsAsync( - request?: protos.google.cloud.support.v2.IListCommentsRequest, - 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['listComments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listComments iterate %j', request); - return this.descriptors.page.listComments.asyncIterate( - this.innerApiCalls['listComments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified organizationCase resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @returns {string} Resource name string. - */ - organizationCasePath(organization:string,caseParam:string) { - return this.pathTemplates.organizationCasePathTemplate.render({ - organization: organization, - case: caseParam, - }); - } - - /** - * Parse the organization from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; - } - - /** - * Parse the case from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; - } - - /** - * Return a fully-qualified organizationCaseAttachmentId resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ - organization: organization, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the organization from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; - } - - /** - * Parse the case from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified organizationCaseComment resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.render({ - organization: organization, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the organization from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; - } - - /** - * Parse the case from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; - } - - /** - * Parse the comment from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; - } - - /** - * Return a fully-qualified projectCase resource name string. - * - * @param {string} project - * @param {string} caseParam - * @returns {string} Resource name string. - */ - projectCasePath(project:string,caseParam:string) { - return this.pathTemplates.projectCasePathTemplate.render({ - project: project, - case: caseParam, - }); - } - - /** - * Parse the project from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; - } - - /** - * Parse the case from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; - } - - /** - * Return a fully-qualified projectCaseAttachmentId resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ - project: project, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the project from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; - } - - /** - * Parse the case from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified projectCaseComment resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - projectCaseCommentPath(project:string,caseParam:string,comment:string) { - return this.pathTemplates.projectCaseCommentPathTemplate.render({ - project: project, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the project from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; - } - - /** - * Parse the case from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; - } - - /** - * Parse the comment from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; - } - - /** - * 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.commentServiceStub && !this._terminated) { - return this.commentServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2/comment_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2/comment_service_client_config.json deleted file mode 100644 index addf5b5e654..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2/comment_service_client_config.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "interfaces": { - "google.cloud.support.v2.CommentService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListComments": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateComment": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-support/src/v2/comment_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2/comment_service_proto_list.json deleted file mode 100644 index e71d4155489..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2/comment_service_proto_list.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - "../../protos/google/cloud/support/v2/actor.proto", - "../../protos/google/cloud/support/v2/attachment.proto", - "../../protos/google/cloud/support/v2/attachment_service.proto", - "../../protos/google/cloud/support/v2/case.proto", - "../../protos/google/cloud/support/v2/case_service.proto", - "../../protos/google/cloud/support/v2/comment.proto", - "../../protos/google/cloud/support/v2/comment_service.proto", - "../../protos/google/cloud/support/v2/escalation.proto" -] diff --git a/owl-bot-staging/google-cloud-support/src/v2/gapic_metadata.json b/owl-bot-staging/google-cloud-support/src/v2/gapic_metadata.json deleted file mode 100644 index 7bb73a8fbd4..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2/gapic_metadata.json +++ /dev/null @@ -1,181 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.support.v2", - "libraryPackage": "@google-cloud/support", - "services": { - "CaseAttachmentService": { - "clients": { - "grpc": { - "libraryClient": "CaseAttachmentServiceClient", - "rpcs": { - "ListAttachments": { - "methods": [ - "listAttachments", - "listAttachmentsStream", - "listAttachmentsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "CaseAttachmentServiceClient", - "rpcs": { - "ListAttachments": { - "methods": [ - "listAttachments", - "listAttachmentsStream", - "listAttachmentsAsync" - ] - } - } - } - } - }, - "CaseService": { - "clients": { - "grpc": { - "libraryClient": "CaseServiceClient", - "rpcs": { - "GetCase": { - "methods": [ - "getCase" - ] - }, - "CreateCase": { - "methods": [ - "createCase" - ] - }, - "UpdateCase": { - "methods": [ - "updateCase" - ] - }, - "EscalateCase": { - "methods": [ - "escalateCase" - ] - }, - "CloseCase": { - "methods": [ - "closeCase" - ] - }, - "ListCases": { - "methods": [ - "listCases", - "listCasesStream", - "listCasesAsync" - ] - }, - "SearchCases": { - "methods": [ - "searchCases", - "searchCasesStream", - "searchCasesAsync" - ] - }, - "SearchCaseClassifications": { - "methods": [ - "searchCaseClassifications", - "searchCaseClassificationsStream", - "searchCaseClassificationsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "CaseServiceClient", - "rpcs": { - "GetCase": { - "methods": [ - "getCase" - ] - }, - "CreateCase": { - "methods": [ - "createCase" - ] - }, - "UpdateCase": { - "methods": [ - "updateCase" - ] - }, - "EscalateCase": { - "methods": [ - "escalateCase" - ] - }, - "CloseCase": { - "methods": [ - "closeCase" - ] - }, - "ListCases": { - "methods": [ - "listCases", - "listCasesStream", - "listCasesAsync" - ] - }, - "SearchCases": { - "methods": [ - "searchCases", - "searchCasesStream", - "searchCasesAsync" - ] - }, - "SearchCaseClassifications": { - "methods": [ - "searchCaseClassifications", - "searchCaseClassificationsStream", - "searchCaseClassificationsAsync" - ] - } - } - } - } - }, - "CommentService": { - "clients": { - "grpc": { - "libraryClient": "CommentServiceClient", - "rpcs": { - "CreateComment": { - "methods": [ - "createComment" - ] - }, - "ListComments": { - "methods": [ - "listComments", - "listCommentsStream", - "listCommentsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "CommentServiceClient", - "rpcs": { - "CreateComment": { - "methods": [ - "createComment" - ] - }, - "ListComments": { - "methods": [ - "listComments", - "listCommentsStream", - "listCommentsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-support/src/v2/index.ts b/owl-bot-staging/google-cloud-support/src/v2/index.ts deleted file mode 100644 index adc3d2e7e29..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2/index.ts +++ /dev/null @@ -1,21 +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 {CaseAttachmentServiceClient} from './case_attachment_service_client'; -export {CaseServiceClient} from './case_service_client'; -export {CommentServiceClient} from './comment_service_client'; diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client.ts deleted file mode 100644 index c26d85e72bc..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client.ts +++ /dev/null @@ -1,1056 +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, PaginationCallback, GaxCall} 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/v2beta/case_attachment_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './case_attachment_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * A service to manage file attachments for Google Cloud support cases. - * @class - * @memberof v2beta - */ -export class CaseAttachmentServiceClient { - 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('support'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - caseAttachmentServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of CaseAttachmentServiceClient. - * - * @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 CaseAttachmentServiceClient({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 CaseAttachmentServiceClient; - 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 = 'cloudsupport.' + 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; - } - - // 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 = { - organizationCasePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}' - ), - organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' - ), - organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/comments/{comment}' - ), - organizationCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/emailMessages/{email_message}' - ), - projectCasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}' - ), - projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/attachments/{attachment_id}' - ), - projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/comments/{comment}' - ), - projectCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/emailMessages/{email_message}' - ), - }; - - // 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 = { - listAttachments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attachments') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.support.v2beta.CaseAttachmentService', 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.caseAttachmentServiceStub) { - return this.caseAttachmentServiceStub; - } - - // Put together the "service stub" for - // google.cloud.support.v2beta.CaseAttachmentService. - this.caseAttachmentServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.support.v2beta.CaseAttachmentService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.support.v2beta.CaseAttachmentService, - 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 caseAttachmentServiceStubMethods = - ['listAttachments', 'getAttachment']; - for (const methodName of caseAttachmentServiceStubMethods) { - const callPromise = this.caseAttachmentServiceStub.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] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.caseAttachmentServiceStub; - } - - /** - * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Retrieve an attachment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the attachment to get. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2beta.Attachment|Attachment}. - * 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/v2beta/case_attachment_service.get_attachment.js - * region_tag:cloudsupport_v2beta_generated_CaseAttachmentService_GetAttachment_async - */ - getAttachment( - request?: protos.google.cloud.support.v2beta.IGetAttachmentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.IAttachment, - protos.google.cloud.support.v2beta.IGetAttachmentRequest|undefined, {}|undefined - ]>; - getAttachment( - request: protos.google.cloud.support.v2beta.IGetAttachmentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2beta.IAttachment, - protos.google.cloud.support.v2beta.IGetAttachmentRequest|null|undefined, - {}|null|undefined>): void; - getAttachment( - request: protos.google.cloud.support.v2beta.IGetAttachmentRequest, - callback: Callback< - protos.google.cloud.support.v2beta.IAttachment, - protos.google.cloud.support.v2beta.IGetAttachmentRequest|null|undefined, - {}|null|undefined>): void; - getAttachment( - request?: protos.google.cloud.support.v2beta.IGetAttachmentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2beta.IAttachment, - protos.google.cloud.support.v2beta.IGetAttachmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2beta.IAttachment, - protos.google.cloud.support.v2beta.IGetAttachmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2beta.IAttachment, - protos.google.cloud.support.v2beta.IGetAttachmentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - 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('getAttachment request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2beta.IAttachment, - protos.google.cloud.support.v2beta.IGetAttachmentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getAttachment response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getAttachment(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2beta.IAttachment, - protos.google.cloud.support.v2beta.IGetAttachmentRequest|undefined, - {}|undefined - ]) => { - this._log.info('getAttachment 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; - }); - } - - /** - * List all the attachments associated with a support case. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case for which attachments should be listed. - * @param {number} request.pageSize - * The maximum number of attachments fetched with each request. - * - * If not provided, the default is 10. The maximum page size that will be - * returned is 100. - * - * The size of each page can be smaller than the requested page size and can - * include zero. For example, you could request 100 attachments on one page, - * receive 0, and then on the next page, receive 90. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2beta.Attachment|Attachment}. - * 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 `listAttachmentsAsync()` - * 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. - */ - listAttachments( - request?: protos.google.cloud.support.v2beta.IListAttachmentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.IAttachment[], - protos.google.cloud.support.v2beta.IListAttachmentsRequest|null, - protos.google.cloud.support.v2beta.IListAttachmentsResponse - ]>; - listAttachments( - request: protos.google.cloud.support.v2beta.IListAttachmentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.support.v2beta.IListAttachmentsRequest, - protos.google.cloud.support.v2beta.IListAttachmentsResponse|null|undefined, - protos.google.cloud.support.v2beta.IAttachment>): void; - listAttachments( - request: protos.google.cloud.support.v2beta.IListAttachmentsRequest, - callback: PaginationCallback< - protos.google.cloud.support.v2beta.IListAttachmentsRequest, - protos.google.cloud.support.v2beta.IListAttachmentsResponse|null|undefined, - protos.google.cloud.support.v2beta.IAttachment>): void; - listAttachments( - request?: protos.google.cloud.support.v2beta.IListAttachmentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.support.v2beta.IListAttachmentsRequest, - protos.google.cloud.support.v2beta.IListAttachmentsResponse|null|undefined, - protos.google.cloud.support.v2beta.IAttachment>, - callback?: PaginationCallback< - protos.google.cloud.support.v2beta.IListAttachmentsRequest, - protos.google.cloud.support.v2beta.IListAttachmentsResponse|null|undefined, - protos.google.cloud.support.v2beta.IAttachment>): - Promise<[ - protos.google.cloud.support.v2beta.IAttachment[], - protos.google.cloud.support.v2beta.IListAttachmentsRequest|null, - protos.google.cloud.support.v2beta.IListAttachmentsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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.support.v2beta.IListAttachmentsRequest, - protos.google.cloud.support.v2beta.IListAttachmentsResponse|null|undefined, - protos.google.cloud.support.v2beta.IAttachment>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listAttachments values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listAttachments request %j', request); - return this.innerApiCalls - .listAttachments(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.support.v2beta.IAttachment[], - protos.google.cloud.support.v2beta.IListAttachmentsRequest|null, - protos.google.cloud.support.v2beta.IListAttachmentsResponse - ]) => { - this._log.info('listAttachments values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listAttachments`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case for which attachments should be listed. - * @param {number} request.pageSize - * The maximum number of attachments fetched with each request. - * - * If not provided, the default is 10. The maximum page size that will be - * returned is 100. - * - * The size of each page can be smaller than the requested page size and can - * include zero. For example, you could request 100 attachments on one page, - * receive 0, and then on the next page, receive 90. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @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.support.v2beta.Attachment|Attachment} 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 `listAttachmentsAsync()` - * 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. - */ - listAttachmentsStream( - request?: protos.google.cloud.support.v2beta.IListAttachmentsRequest, - 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['listAttachments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAttachments stream %j', request); - return this.descriptors.page.listAttachments.createStream( - this.innerApiCalls.listAttachments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAttachments`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case for which attachments should be listed. - * @param {number} request.pageSize - * The maximum number of attachments fetched with each request. - * - * If not provided, the default is 10. The maximum page size that will be - * returned is 100. - * - * The size of each page can be smaller than the requested page size and can - * include zero. For example, you could request 100 attachments on one page, - * receive 0, and then on the next page, receive 90. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @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.support.v2beta.Attachment|Attachment}. 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/v2beta/case_attachment_service.list_attachments.js - * region_tag:cloudsupport_v2beta_generated_CaseAttachmentService_ListAttachments_async - */ - listAttachmentsAsync( - request?: protos.google.cloud.support.v2beta.IListAttachmentsRequest, - 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['listAttachments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAttachments iterate %j', request); - return this.descriptors.page.listAttachments.asyncIterate( - this.innerApiCalls['listAttachments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified organizationCase resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @returns {string} Resource name string. - */ - organizationCasePath(organization:string,caseParam:string) { - return this.pathTemplates.organizationCasePathTemplate.render({ - organization: organization, - case: caseParam, - }); - } - - /** - * Parse the organization from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; - } - - /** - * Parse the case from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; - } - - /** - * Return a fully-qualified organizationCaseAttachmentId resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ - organization: organization, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the organization from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; - } - - /** - * Parse the case from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified organizationCaseComment resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.render({ - organization: organization, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the organization from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; - } - - /** - * Parse the case from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; - } - - /** - * Parse the comment from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; - } - - /** - * Return a fully-qualified organizationCaseEmailMessages resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} email_message - * @returns {string} Resource name string. - */ - organizationCaseEmailMessagesPath(organization:string,caseParam:string,emailMessage:string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.render({ - organization: organization, - case: caseParam, - email_message: emailMessage, - }); - } - - /** - * Parse the organization from OrganizationCaseEmailMessages resource. - * - * @param {string} organizationCaseEmailMessagesName - * A fully-qualified path representing organization_case_emailMessages resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).organization; - } - - /** - * Parse the case from OrganizationCaseEmailMessages resource. - * - * @param {string} organizationCaseEmailMessagesName - * A fully-qualified path representing organization_case_emailMessages resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).case; - } - - /** - * Parse the email_message from OrganizationCaseEmailMessages resource. - * - * @param {string} organizationCaseEmailMessagesName - * A fully-qualified path representing organization_case_emailMessages resource. - * @returns {string} A string representing the email_message. - */ - matchEmailMessageFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).email_message; - } - - /** - * Return a fully-qualified projectCase resource name string. - * - * @param {string} project - * @param {string} caseParam - * @returns {string} Resource name string. - */ - projectCasePath(project:string,caseParam:string) { - return this.pathTemplates.projectCasePathTemplate.render({ - project: project, - case: caseParam, - }); - } - - /** - * Parse the project from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; - } - - /** - * Parse the case from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; - } - - /** - * Return a fully-qualified projectCaseAttachmentId resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ - project: project, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the project from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; - } - - /** - * Parse the case from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified projectCaseComment resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - projectCaseCommentPath(project:string,caseParam:string,comment:string) { - return this.pathTemplates.projectCaseCommentPathTemplate.render({ - project: project, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the project from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; - } - - /** - * Parse the case from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; - } - - /** - * Parse the comment from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; - } - - /** - * Return a fully-qualified projectCaseEmailMessages resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} email_message - * @returns {string} Resource name string. - */ - projectCaseEmailMessagesPath(project:string,caseParam:string,emailMessage:string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.render({ - project: project, - case: caseParam, - email_message: emailMessage, - }); - } - - /** - * Parse the project from ProjectCaseEmailMessages resource. - * - * @param {string} projectCaseEmailMessagesName - * A fully-qualified path representing project_case_emailMessages resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).project; - } - - /** - * Parse the case from ProjectCaseEmailMessages resource. - * - * @param {string} projectCaseEmailMessagesName - * A fully-qualified path representing project_case_emailMessages resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).case; - } - - /** - * Parse the email_message from ProjectCaseEmailMessages resource. - * - * @param {string} projectCaseEmailMessagesName - * A fully-qualified path representing project_case_emailMessages resource. - * @returns {string} A string representing the email_message. - */ - matchEmailMessageFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).email_message; - } - - /** - * 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.caseAttachmentServiceStub && !this._terminated) { - return this.caseAttachmentServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client_config.json deleted file mode 100644 index 5002130b100..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_client_config.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "interfaces": { - "google.cloud.support.v2beta.CaseAttachmentService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListAttachments": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetAttachment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_proto_list.json deleted file mode 100644 index a623d27a7fd..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/case_attachment_service_proto_list.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - "../../protos/google/cloud/support/v2beta/actor.proto", - "../../protos/google/cloud/support/v2beta/attachment.proto", - "../../protos/google/cloud/support/v2beta/attachment_service.proto", - "../../protos/google/cloud/support/v2beta/case.proto", - "../../protos/google/cloud/support/v2beta/case_service.proto", - "../../protos/google/cloud/support/v2beta/comment.proto", - "../../protos/google/cloud/support/v2beta/comment_service.proto", - "../../protos/google/cloud/support/v2beta/content.proto", - "../../protos/google/cloud/support/v2beta/email_message.proto", - "../../protos/google/cloud/support/v2beta/escalation.proto", - "../../protos/google/cloud/support/v2beta/feed_item.proto", - "../../protos/google/cloud/support/v2beta/feed_service.proto" -] diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/case_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2beta/case_service_client.ts deleted file mode 100644 index 7e0db96918e..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/case_service_client.ts +++ /dev/null @@ -1,2036 +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, PaginationCallback, GaxCall} 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/v2beta/case_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './case_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * A service to manage Google Cloud support cases. - * @class - * @memberof v2beta - */ -export class CaseServiceClient { - 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('support'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - caseServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of CaseServiceClient. - * - * @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 CaseServiceClient({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 CaseServiceClient; - 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 = 'cloudsupport.' + 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; - } - - // 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 = { - organizationPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}' - ), - organizationCasePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}' - ), - organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' - ), - organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/comments/{comment}' - ), - organizationCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/emailMessages/{email_message}' - ), - projectCasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}' - ), - projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/attachments/{attachment_id}' - ), - projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/comments/{comment}' - ), - projectCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/emailMessages/{email_message}' - ), - }; - - // 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 = { - listCases: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'cases'), - searchCases: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'cases'), - searchCaseClassifications: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'caseClassifications') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.support.v2beta.CaseService', 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.caseServiceStub) { - return this.caseServiceStub; - } - - // Put together the "service stub" for - // google.cloud.support.v2beta.CaseService. - this.caseServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.support.v2beta.CaseService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.support.v2beta.CaseService, - 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 caseServiceStubMethods = - ['getCase', 'listCases', 'searchCases', 'createCase', 'updateCase', 'escalateCase', 'closeCase', 'searchCaseClassifications']; - for (const methodName of caseServiceStubMethods) { - const callPromise = this.caseServiceStub.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] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.caseServiceStub; - } - - /** - * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Retrieve a case. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of a case to be retrieved. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2beta.Case|Case}. - * 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/v2beta/case_service.get_case.js - * region_tag:cloudsupport_v2beta_generated_CaseService_GetCase_async - */ - getCase( - request?: protos.google.cloud.support.v2beta.IGetCaseRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IGetCaseRequest|undefined, {}|undefined - ]>; - getCase( - request: protos.google.cloud.support.v2beta.IGetCaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IGetCaseRequest|null|undefined, - {}|null|undefined>): void; - getCase( - request: protos.google.cloud.support.v2beta.IGetCaseRequest, - callback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IGetCaseRequest|null|undefined, - {}|null|undefined>): void; - getCase( - request?: protos.google.cloud.support.v2beta.IGetCaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IGetCaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IGetCaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IGetCaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - 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('getCase request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IGetCaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getCase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IGetCaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('getCase 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; - }); - } -/** - * Create a new case and associate it with a parent. - * - * It must have the following fields set: `display_name`, `description`, - * `classification`, and `priority`. If you're just testing the API and don't - * want to route your case to an agent, set `testCase=true`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent under which the case should be created. - * @param {google.cloud.support.v2beta.Case} request.case - * Required. The case to be created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.support.v2beta.Case|Case}. - * 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/v2beta/case_service.create_case.js - * region_tag:cloudsupport_v2beta_generated_CaseService_CreateCase_async - */ - createCase( - request?: protos.google.cloud.support.v2beta.ICreateCaseRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICreateCaseRequest|undefined, {}|undefined - ]>; - createCase( - request: protos.google.cloud.support.v2beta.ICreateCaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICreateCaseRequest|null|undefined, - {}|null|undefined>): void; - createCase( - request: protos.google.cloud.support.v2beta.ICreateCaseRequest, - callback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICreateCaseRequest|null|undefined, - {}|null|undefined>): void; - createCase( - request?: protos.google.cloud.support.v2beta.ICreateCaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICreateCaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICreateCaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICreateCaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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('createCase request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICreateCaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createCase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createCase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICreateCaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('createCase 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; - }); - } -/** - * Update a case. Only some fields can be updated. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.support.v2beta.Case} request.case - * Required. The case to update. - * @param {google.protobuf.FieldMask} request.updateMask - * A list of attributes of the case that should be updated. Supported values - * are `priority`, `display_name`, and `subscriber_email_addresses`. If no - * fields are specified, all supported fields are updated. - * - * Be careful - if you do not provide a field mask, then you might - * accidentally clear some fields. For example, if you leave the field mask - * empty and do not provide a value for `subscriber_email_addresses`, then - * `subscriber_email_addresses` is updated to empty. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2beta.Case|Case}. - * 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/v2beta/case_service.update_case.js - * region_tag:cloudsupport_v2beta_generated_CaseService_UpdateCase_async - */ - updateCase( - request?: protos.google.cloud.support.v2beta.IUpdateCaseRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IUpdateCaseRequest|undefined, {}|undefined - ]>; - updateCase( - request: protos.google.cloud.support.v2beta.IUpdateCaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IUpdateCaseRequest|null|undefined, - {}|null|undefined>): void; - updateCase( - request: protos.google.cloud.support.v2beta.IUpdateCaseRequest, - callback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IUpdateCaseRequest|null|undefined, - {}|null|undefined>): void; - updateCase( - request?: protos.google.cloud.support.v2beta.IUpdateCaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IUpdateCaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IUpdateCaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IUpdateCaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'case.name': request.case!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateCase request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IUpdateCaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateCase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateCase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IUpdateCaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateCase 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; - }); - } -/** - * Escalate a case, starting the Google Cloud Support escalation management - * process. - * - * This operation is only available for some support services. Go to - * https://cloud.google.com/support and look for 'Technical support - * escalations' in the feature list to find out which ones let you - * do that. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the case to be escalated. - * @param {google.cloud.support.v2beta.Escalation} request.escalation - * The escalation information to be sent with the escalation request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.support.v2beta.Case|Case}. - * 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/v2beta/case_service.escalate_case.js - * region_tag:cloudsupport_v2beta_generated_CaseService_EscalateCase_async - */ - escalateCase( - request?: protos.google.cloud.support.v2beta.IEscalateCaseRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IEscalateCaseRequest|undefined, {}|undefined - ]>; - escalateCase( - request: protos.google.cloud.support.v2beta.IEscalateCaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IEscalateCaseRequest|null|undefined, - {}|null|undefined>): void; - escalateCase( - request: protos.google.cloud.support.v2beta.IEscalateCaseRequest, - callback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IEscalateCaseRequest|null|undefined, - {}|null|undefined>): void; - escalateCase( - request?: protos.google.cloud.support.v2beta.IEscalateCaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IEscalateCaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IEscalateCaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IEscalateCaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - 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('escalateCase request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IEscalateCaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('escalateCase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.escalateCase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.IEscalateCaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('escalateCase 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; - }); - } -/** - * Close a case. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the case to close. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2beta.Case|Case}. - * 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/v2beta/case_service.close_case.js - * region_tag:cloudsupport_v2beta_generated_CaseService_CloseCase_async - */ - closeCase( - request?: protos.google.cloud.support.v2beta.ICloseCaseRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICloseCaseRequest|undefined, {}|undefined - ]>; - closeCase( - request: protos.google.cloud.support.v2beta.ICloseCaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICloseCaseRequest|null|undefined, - {}|null|undefined>): void; - closeCase( - request: protos.google.cloud.support.v2beta.ICloseCaseRequest, - callback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICloseCaseRequest|null|undefined, - {}|null|undefined>): void; - closeCase( - request?: protos.google.cloud.support.v2beta.ICloseCaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICloseCaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICloseCaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICloseCaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - 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('closeCase request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICloseCaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('closeCase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.closeCase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2beta.ICase, - protos.google.cloud.support.v2beta.ICloseCaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('closeCase 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 all cases under a parent, but not its children. - * - * For example, listing cases under an organization only returns the cases - * that are directly parented by that organization. To retrieve cases - * under an organization and its projects, use `cases.search`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of a parent to list cases under. - * @param {string} request.filter - * An expression used to filter cases. - * - * If it's an empty string, then no filtering happens. Otherwise, the endpoint - * returns the cases that match the filter. - * - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * - * EXAMPLES: - * - * - `state=CLOSED` - * - `state=OPEN AND creator.email="tester@example.com"` - * - `state=OPEN AND (priority=P0 OR priority=P1)` - * @param {number} request.pageSize - * The maximum number of cases fetched with each request. Defaults to 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @param {google.cloud.support.v2beta.ProductLine} request.productLine - * The product line to request cases for. If unspecified, only - * Google Cloud cases 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 Array of {@link protos.google.cloud.support.v2beta.Case|Case}. - * 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 `listCasesAsync()` - * 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. - */ - listCases( - request?: protos.google.cloud.support.v2beta.IListCasesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.ICase[], - protos.google.cloud.support.v2beta.IListCasesRequest|null, - protos.google.cloud.support.v2beta.IListCasesResponse - ]>; - listCases( - request: protos.google.cloud.support.v2beta.IListCasesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.support.v2beta.IListCasesRequest, - protos.google.cloud.support.v2beta.IListCasesResponse|null|undefined, - protos.google.cloud.support.v2beta.ICase>): void; - listCases( - request: protos.google.cloud.support.v2beta.IListCasesRequest, - callback: PaginationCallback< - protos.google.cloud.support.v2beta.IListCasesRequest, - protos.google.cloud.support.v2beta.IListCasesResponse|null|undefined, - protos.google.cloud.support.v2beta.ICase>): void; - listCases( - request?: protos.google.cloud.support.v2beta.IListCasesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.support.v2beta.IListCasesRequest, - protos.google.cloud.support.v2beta.IListCasesResponse|null|undefined, - protos.google.cloud.support.v2beta.ICase>, - callback?: PaginationCallback< - protos.google.cloud.support.v2beta.IListCasesRequest, - protos.google.cloud.support.v2beta.IListCasesResponse|null|undefined, - protos.google.cloud.support.v2beta.ICase>): - Promise<[ - protos.google.cloud.support.v2beta.ICase[], - protos.google.cloud.support.v2beta.IListCasesRequest|null, - protos.google.cloud.support.v2beta.IListCasesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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.support.v2beta.IListCasesRequest, - protos.google.cloud.support.v2beta.IListCasesResponse|null|undefined, - protos.google.cloud.support.v2beta.ICase>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listCases values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listCases request %j', request); - return this.innerApiCalls - .listCases(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.support.v2beta.ICase[], - protos.google.cloud.support.v2beta.IListCasesRequest|null, - protos.google.cloud.support.v2beta.IListCasesResponse - ]) => { - this._log.info('listCases values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listCases`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of a parent to list cases under. - * @param {string} request.filter - * An expression used to filter cases. - * - * If it's an empty string, then no filtering happens. Otherwise, the endpoint - * returns the cases that match the filter. - * - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * - * EXAMPLES: - * - * - `state=CLOSED` - * - `state=OPEN AND creator.email="tester@example.com"` - * - `state=OPEN AND (priority=P0 OR priority=P1)` - * @param {number} request.pageSize - * The maximum number of cases fetched with each request. Defaults to 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @param {google.cloud.support.v2beta.ProductLine} request.productLine - * The product line to request cases for. If unspecified, only - * Google Cloud cases 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 {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.support.v2beta.Case|Case} 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 `listCasesAsync()` - * 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. - */ - listCasesStream( - request?: protos.google.cloud.support.v2beta.IListCasesRequest, - 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['listCases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listCases stream %j', request); - return this.descriptors.page.listCases.createStream( - this.innerApiCalls.listCases as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listCases`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of a parent to list cases under. - * @param {string} request.filter - * An expression used to filter cases. - * - * If it's an empty string, then no filtering happens. Otherwise, the endpoint - * returns the cases that match the filter. - * - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * - * EXAMPLES: - * - * - `state=CLOSED` - * - `state=OPEN AND creator.email="tester@example.com"` - * - `state=OPEN AND (priority=P0 OR priority=P1)` - * @param {number} request.pageSize - * The maximum number of cases fetched with each request. Defaults to 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @param {google.cloud.support.v2beta.ProductLine} request.productLine - * The product line to request cases for. If unspecified, only - * Google Cloud cases 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 {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.support.v2beta.Case|Case}. 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/v2beta/case_service.list_cases.js - * region_tag:cloudsupport_v2beta_generated_CaseService_ListCases_async - */ - listCasesAsync( - request?: protos.google.cloud.support.v2beta.IListCasesRequest, - 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['listCases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listCases iterate %j', request); - return this.descriptors.page.listCases.asyncIterate( - this.innerApiCalls['listCases'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Search for cases using a query. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the parent resource to search for cases under. - * @param {string} request.query - * An expression used to filter cases. - * - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - * - `organization`: An organization name in the form - * `organizations/`. - * - `project`: A project name in the form `projects/`. - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * - * You must specify either `organization` or `project`. - * - * To search across `displayName`, `description`, and comments, use a global - * restriction with no keyword or operator. For example, `"my search"`. - * - * To search only cases updated after a certain date, use `update_time` - * restricted with that particular date, time, and timezone in ISO datetime - * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - * `update_time` only supports the greater than operator (`>`). - * - * Examples: - * - * - `organization="organizations/123456789"` - * - `project="projects/my-project-id"` - * - `project="projects/123456789"` - * - `organization="organizations/123456789" AND state=CLOSED` - * - `project="projects/my-project-id" AND creator.email="tester@example.com"` - * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - * @param {number} request.pageSize - * The maximum number of cases fetched with each request. The default page - * size is 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2beta.Case|Case}. - * 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 `searchCasesAsync()` - * 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. - */ - searchCases( - request?: protos.google.cloud.support.v2beta.ISearchCasesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.ICase[], - protos.google.cloud.support.v2beta.ISearchCasesRequest|null, - protos.google.cloud.support.v2beta.ISearchCasesResponse - ]>; - searchCases( - request: protos.google.cloud.support.v2beta.ISearchCasesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.support.v2beta.ISearchCasesRequest, - protos.google.cloud.support.v2beta.ISearchCasesResponse|null|undefined, - protos.google.cloud.support.v2beta.ICase>): void; - searchCases( - request: protos.google.cloud.support.v2beta.ISearchCasesRequest, - callback: PaginationCallback< - protos.google.cloud.support.v2beta.ISearchCasesRequest, - protos.google.cloud.support.v2beta.ISearchCasesResponse|null|undefined, - protos.google.cloud.support.v2beta.ICase>): void; - searchCases( - request?: protos.google.cloud.support.v2beta.ISearchCasesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.support.v2beta.ISearchCasesRequest, - protos.google.cloud.support.v2beta.ISearchCasesResponse|null|undefined, - protos.google.cloud.support.v2beta.ICase>, - callback?: PaginationCallback< - protos.google.cloud.support.v2beta.ISearchCasesRequest, - protos.google.cloud.support.v2beta.ISearchCasesResponse|null|undefined, - protos.google.cloud.support.v2beta.ICase>): - Promise<[ - protos.google.cloud.support.v2beta.ICase[], - protos.google.cloud.support.v2beta.ISearchCasesRequest|null, - protos.google.cloud.support.v2beta.ISearchCasesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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.support.v2beta.ISearchCasesRequest, - protos.google.cloud.support.v2beta.ISearchCasesResponse|null|undefined, - protos.google.cloud.support.v2beta.ICase>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('searchCases values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('searchCases request %j', request); - return this.innerApiCalls - .searchCases(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.support.v2beta.ICase[], - protos.google.cloud.support.v2beta.ISearchCasesRequest|null, - protos.google.cloud.support.v2beta.ISearchCasesResponse - ]) => { - this._log.info('searchCases values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `searchCases`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the parent resource to search for cases under. - * @param {string} request.query - * An expression used to filter cases. - * - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - * - `organization`: An organization name in the form - * `organizations/`. - * - `project`: A project name in the form `projects/`. - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * - * You must specify either `organization` or `project`. - * - * To search across `displayName`, `description`, and comments, use a global - * restriction with no keyword or operator. For example, `"my search"`. - * - * To search only cases updated after a certain date, use `update_time` - * restricted with that particular date, time, and timezone in ISO datetime - * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - * `update_time` only supports the greater than operator (`>`). - * - * Examples: - * - * - `organization="organizations/123456789"` - * - `project="projects/my-project-id"` - * - `project="projects/123456789"` - * - `organization="organizations/123456789" AND state=CLOSED` - * - `project="projects/my-project-id" AND creator.email="tester@example.com"` - * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - * @param {number} request.pageSize - * The maximum number of cases fetched with each request. The default page - * size is 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @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.support.v2beta.Case|Case} 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 `searchCasesAsync()` - * 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. - */ - searchCasesStream( - request?: protos.google.cloud.support.v2beta.ISearchCasesRequest, - 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['searchCases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('searchCases stream %j', request); - return this.descriptors.page.searchCases.createStream( - this.innerApiCalls.searchCases as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchCases`, 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 - * The name of the parent resource to search for cases under. - * @param {string} request.query - * An expression used to filter cases. - * - * Expressions use the following fields separated by `AND` and specified with - * `=`: - * - * - `organization`: An organization name in the form - * `organizations/`. - * - `project`: A project name in the form `projects/`. - * - `state`: Can be `OPEN` or `CLOSED`. - * - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You - * can specify multiple values for priority using the `OR` operator. For - * example, `priority=P1 OR priority=P2`. - * - `creator.email`: The email address of the case creator. - * - * You must specify either `organization` or `project`. - * - * To search across `displayName`, `description`, and comments, use a global - * restriction with no keyword or operator. For example, `"my search"`. - * - * To search only cases updated after a certain date, use `update_time` - * restricted with that particular date, time, and timezone in ISO datetime - * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. - * `update_time` only supports the greater than operator (`>`). - * - * Examples: - * - * - `organization="organizations/123456789"` - * - `project="projects/my-project-id"` - * - `project="projects/123456789"` - * - `organization="organizations/123456789" AND state=CLOSED` - * - `project="projects/my-project-id" AND creator.email="tester@example.com"` - * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` - * @param {number} request.pageSize - * The maximum number of cases fetched with each request. The default page - * size is 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @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.support.v2beta.Case|Case}. 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/v2beta/case_service.search_cases.js - * region_tag:cloudsupport_v2beta_generated_CaseService_SearchCases_async - */ - searchCasesAsync( - request?: protos.google.cloud.support.v2beta.ISearchCasesRequest, - 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['searchCases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('searchCases iterate %j', request); - return this.descriptors.page.searchCases.asyncIterate( - this.innerApiCalls['searchCases'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Retrieve valid classifications to use when creating a support case. - * - * Classifications are hierarchical. Each classification is a string - * containing all levels of the hierarchy separated by `" > "`. For example, - * `"Technical Issue > Compute > Compute Engine"`. - * - * Classification IDs returned by this endpoint are valid for at least six - * months. When a classification is deactivated, this endpoint immediately - * stops returning it. After six months, `case.create` requests using the - * classification will fail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.query - * An expression used to filter case classifications. - * - * If it's an empty string, then no filtering happens. Otherwise, case - * classifications will be returned that match the filter. - * @param {number} request.pageSize - * The maximum number of classifications fetched with each request. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @param {google.cloud.support.v2beta.Product} [request.product] - * Optional. The product to return case classifications 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 Array of {@link protos.google.cloud.support.v2beta.CaseClassification|CaseClassification}. - * 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 `searchCaseClassificationsAsync()` - * 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. - */ - searchCaseClassifications( - request?: protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.ICaseClassification[], - protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest|null, - protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse - ]>; - searchCaseClassifications( - request: protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, - protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse|null|undefined, - protos.google.cloud.support.v2beta.ICaseClassification>): void; - searchCaseClassifications( - request: protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, - callback: PaginationCallback< - protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, - protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse|null|undefined, - protos.google.cloud.support.v2beta.ICaseClassification>): void; - searchCaseClassifications( - request?: protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, - protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse|null|undefined, - protos.google.cloud.support.v2beta.ICaseClassification>, - callback?: PaginationCallback< - protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, - protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse|null|undefined, - protos.google.cloud.support.v2beta.ICaseClassification>): - Promise<[ - protos.google.cloud.support.v2beta.ICaseClassification[], - protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest|null, - protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, - protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse|null|undefined, - protos.google.cloud.support.v2beta.ICaseClassification>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('searchCaseClassifications values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('searchCaseClassifications request %j', request); - return this.innerApiCalls - .searchCaseClassifications(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.support.v2beta.ICaseClassification[], - protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest|null, - protos.google.cloud.support.v2beta.ISearchCaseClassificationsResponse - ]) => { - this._log.info('searchCaseClassifications values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `searchCaseClassifications`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.query - * An expression used to filter case classifications. - * - * If it's an empty string, then no filtering happens. Otherwise, case - * classifications will be returned that match the filter. - * @param {number} request.pageSize - * The maximum number of classifications fetched with each request. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @param {google.cloud.support.v2beta.Product} [request.product] - * Optional. The product to return case classifications for. - * @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.support.v2beta.CaseClassification|CaseClassification} 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 `searchCaseClassificationsAsync()` - * 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. - */ - searchCaseClassificationsStream( - request?: protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['searchCaseClassifications']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('searchCaseClassifications stream %j', request); - return this.descriptors.page.searchCaseClassifications.createStream( - this.innerApiCalls.searchCaseClassifications as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchCaseClassifications`, 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.query - * An expression used to filter case classifications. - * - * If it's an empty string, then no filtering happens. Otherwise, case - * classifications will be returned that match the filter. - * @param {number} request.pageSize - * The maximum number of classifications fetched with each request. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is retrieved. - * @param {google.cloud.support.v2beta.Product} [request.product] - * Optional. The product to return case classifications for. - * @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.support.v2beta.CaseClassification|CaseClassification}. 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/v2beta/case_service.search_case_classifications.js - * region_tag:cloudsupport_v2beta_generated_CaseService_SearchCaseClassifications_async - */ - searchCaseClassificationsAsync( - request?: protos.google.cloud.support.v2beta.ISearchCaseClassificationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['searchCaseClassifications']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('searchCaseClassifications iterate %j', request); - return this.descriptors.page.searchCaseClassifications.asyncIterate( - this.innerApiCalls['searchCaseClassifications'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified organization resource name string. - * - * @param {string} organization - * @returns {string} Resource name string. - */ - organizationPath(organization:string) { - return this.pathTemplates.organizationPathTemplate.render({ - organization: organization, - }); - } - - /** - * Parse the organization from Organization resource. - * - * @param {string} organizationName - * A fully-qualified path representing Organization resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationName(organizationName: string) { - return this.pathTemplates.organizationPathTemplate.match(organizationName).organization; - } - - /** - * Return a fully-qualified organizationCase resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @returns {string} Resource name string. - */ - organizationCasePath(organization:string,caseParam:string) { - return this.pathTemplates.organizationCasePathTemplate.render({ - organization: organization, - case: caseParam, - }); - } - - /** - * Parse the organization from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; - } - - /** - * Parse the case from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; - } - - /** - * Return a fully-qualified organizationCaseAttachmentId resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ - organization: organization, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the organization from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; - } - - /** - * Parse the case from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified organizationCaseComment resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.render({ - organization: organization, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the organization from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; - } - - /** - * Parse the case from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; - } - - /** - * Parse the comment from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; - } - - /** - * Return a fully-qualified organizationCaseEmailMessages resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} email_message - * @returns {string} Resource name string. - */ - organizationCaseEmailMessagesPath(organization:string,caseParam:string,emailMessage:string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.render({ - organization: organization, - case: caseParam, - email_message: emailMessage, - }); - } - - /** - * Parse the organization from OrganizationCaseEmailMessages resource. - * - * @param {string} organizationCaseEmailMessagesName - * A fully-qualified path representing organization_case_emailMessages resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).organization; - } - - /** - * Parse the case from OrganizationCaseEmailMessages resource. - * - * @param {string} organizationCaseEmailMessagesName - * A fully-qualified path representing organization_case_emailMessages resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).case; - } - - /** - * Parse the email_message from OrganizationCaseEmailMessages resource. - * - * @param {string} organizationCaseEmailMessagesName - * A fully-qualified path representing organization_case_emailMessages resource. - * @returns {string} A string representing the email_message. - */ - matchEmailMessageFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).email_message; - } - - /** - * Return a fully-qualified projectCase resource name string. - * - * @param {string} project - * @param {string} caseParam - * @returns {string} Resource name string. - */ - projectCasePath(project:string,caseParam:string) { - return this.pathTemplates.projectCasePathTemplate.render({ - project: project, - case: caseParam, - }); - } - - /** - * Parse the project from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; - } - - /** - * Parse the case from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; - } - - /** - * Return a fully-qualified projectCaseAttachmentId resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ - project: project, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the project from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; - } - - /** - * Parse the case from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified projectCaseComment resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - projectCaseCommentPath(project:string,caseParam:string,comment:string) { - return this.pathTemplates.projectCaseCommentPathTemplate.render({ - project: project, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the project from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; - } - - /** - * Parse the case from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; - } - - /** - * Parse the comment from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; - } - - /** - * Return a fully-qualified projectCaseEmailMessages resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} email_message - * @returns {string} Resource name string. - */ - projectCaseEmailMessagesPath(project:string,caseParam:string,emailMessage:string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.render({ - project: project, - case: caseParam, - email_message: emailMessage, - }); - } - - /** - * Parse the project from ProjectCaseEmailMessages resource. - * - * @param {string} projectCaseEmailMessagesName - * A fully-qualified path representing project_case_emailMessages resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).project; - } - - /** - * Parse the case from ProjectCaseEmailMessages resource. - * - * @param {string} projectCaseEmailMessagesName - * A fully-qualified path representing project_case_emailMessages resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).case; - } - - /** - * Parse the email_message from ProjectCaseEmailMessages resource. - * - * @param {string} projectCaseEmailMessagesName - * A fully-qualified path representing project_case_emailMessages resource. - * @returns {string} A string representing the email_message. - */ - matchEmailMessageFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).email_message; - } - - /** - * 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.caseServiceStub && !this._terminated) { - return this.caseServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/case_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2beta/case_service_client_config.json deleted file mode 100644 index bede0d8c3e2..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/case_service_client_config.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "interfaces": { - "google.cloud.support.v2beta.CaseService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "GetCase": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListCases": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "SearchCases": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateCase": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateCase": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "EscalateCase": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CloseCase": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SearchCaseClassifications": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/case_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2beta/case_service_proto_list.json deleted file mode 100644 index a623d27a7fd..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/case_service_proto_list.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - "../../protos/google/cloud/support/v2beta/actor.proto", - "../../protos/google/cloud/support/v2beta/attachment.proto", - "../../protos/google/cloud/support/v2beta/attachment_service.proto", - "../../protos/google/cloud/support/v2beta/case.proto", - "../../protos/google/cloud/support/v2beta/case_service.proto", - "../../protos/google/cloud/support/v2beta/comment.proto", - "../../protos/google/cloud/support/v2beta/comment_service.proto", - "../../protos/google/cloud/support/v2beta/content.proto", - "../../protos/google/cloud/support/v2beta/email_message.proto", - "../../protos/google/cloud/support/v2beta/escalation.proto", - "../../protos/google/cloud/support/v2beta/feed_item.proto", - "../../protos/google/cloud/support/v2beta/feed_service.proto" -] diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client.ts deleted file mode 100644 index f7c02630c2c..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client.ts +++ /dev/null @@ -1,1133 +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, PaginationCallback, GaxCall} 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/v2beta/comment_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './comment_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * A service to manage comments on cases. - * @class - * @memberof v2beta - */ -export class CommentServiceClient { - 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('support'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - commentServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of CommentServiceClient. - * - * @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 CommentServiceClient({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 CommentServiceClient; - 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 = 'cloudsupport.' + 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; - } - - // 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 = { - organizationCasePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}' - ), - organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' - ), - organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/comments/{comment}' - ), - organizationCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/emailMessages/{email_message}' - ), - projectCasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}' - ), - projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/attachments/{attachment_id}' - ), - projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/comments/{comment}' - ), - projectCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/emailMessages/{email_message}' - ), - }; - - // 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 = { - listComments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'comments') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.support.v2beta.CommentService', 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.commentServiceStub) { - return this.commentServiceStub; - } - - // Put together the "service stub" for - // google.cloud.support.v2beta.CommentService. - this.commentServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.support.v2beta.CommentService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.support.v2beta.CommentService, - 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 commentServiceStubMethods = - ['listComments', 'createComment', 'getComment']; - for (const methodName of commentServiceStubMethods) { - const callPromise = this.commentServiceStub.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] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.commentServiceStub; - } - - /** - * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Add a new comment to a case. - * - * The comment must have the following fields set: `body`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case to which the comment should be added. - * @param {google.cloud.support.v2beta.Comment} request.comment - * Required. The comment to be added. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2beta.Comment|Comment}. - * 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/v2beta/comment_service.create_comment.js - * region_tag:cloudsupport_v2beta_generated_CommentService_CreateComment_async - */ - createComment( - request?: protos.google.cloud.support.v2beta.ICreateCommentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.ICreateCommentRequest|undefined, {}|undefined - ]>; - createComment( - request: protos.google.cloud.support.v2beta.ICreateCommentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.ICreateCommentRequest|null|undefined, - {}|null|undefined>): void; - createComment( - request: protos.google.cloud.support.v2beta.ICreateCommentRequest, - callback: Callback< - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.ICreateCommentRequest|null|undefined, - {}|null|undefined>): void; - createComment( - request?: protos.google.cloud.support.v2beta.ICreateCommentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.ICreateCommentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.ICreateCommentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.ICreateCommentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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('createComment request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.ICreateCommentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createComment response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createComment(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.ICreateCommentRequest|undefined, - {}|undefined - ]) => { - this._log.info('createComment 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 a comment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the comment 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.support.v2beta.Comment|Comment}. - * 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/v2beta/comment_service.get_comment.js - * region_tag:cloudsupport_v2beta_generated_CommentService_GetComment_async - */ - getComment( - request?: protos.google.cloud.support.v2beta.IGetCommentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.IGetCommentRequest|undefined, {}|undefined - ]>; - getComment( - request: protos.google.cloud.support.v2beta.IGetCommentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.IGetCommentRequest|null|undefined, - {}|null|undefined>): void; - getComment( - request: protos.google.cloud.support.v2beta.IGetCommentRequest, - callback: Callback< - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.IGetCommentRequest|null|undefined, - {}|null|undefined>): void; - getComment( - request?: protos.google.cloud.support.v2beta.IGetCommentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.IGetCommentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.IGetCommentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.IGetCommentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - 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('getComment request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.IGetCommentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getComment response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getComment(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.support.v2beta.IComment, - protos.google.cloud.support.v2beta.IGetCommentRequest|undefined, - {}|undefined - ]) => { - this._log.info('getComment 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; - }); - } - - /** - * List all the comments associated with a case. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case for which to list comments. - * @param {number} request.pageSize - * The maximum number of comments to fetch. Defaults to 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is 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 Array of {@link protos.google.cloud.support.v2beta.Comment|Comment}. - * 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 `listCommentsAsync()` - * 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. - */ - listComments( - request?: protos.google.cloud.support.v2beta.IListCommentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.IComment[], - protos.google.cloud.support.v2beta.IListCommentsRequest|null, - protos.google.cloud.support.v2beta.IListCommentsResponse - ]>; - listComments( - request: protos.google.cloud.support.v2beta.IListCommentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.support.v2beta.IListCommentsRequest, - protos.google.cloud.support.v2beta.IListCommentsResponse|null|undefined, - protos.google.cloud.support.v2beta.IComment>): void; - listComments( - request: protos.google.cloud.support.v2beta.IListCommentsRequest, - callback: PaginationCallback< - protos.google.cloud.support.v2beta.IListCommentsRequest, - protos.google.cloud.support.v2beta.IListCommentsResponse|null|undefined, - protos.google.cloud.support.v2beta.IComment>): void; - listComments( - request?: protos.google.cloud.support.v2beta.IListCommentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.support.v2beta.IListCommentsRequest, - protos.google.cloud.support.v2beta.IListCommentsResponse|null|undefined, - protos.google.cloud.support.v2beta.IComment>, - callback?: PaginationCallback< - protos.google.cloud.support.v2beta.IListCommentsRequest, - protos.google.cloud.support.v2beta.IListCommentsResponse|null|undefined, - protos.google.cloud.support.v2beta.IComment>): - Promise<[ - protos.google.cloud.support.v2beta.IComment[], - protos.google.cloud.support.v2beta.IListCommentsRequest|null, - protos.google.cloud.support.v2beta.IListCommentsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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.support.v2beta.IListCommentsRequest, - protos.google.cloud.support.v2beta.IListCommentsResponse|null|undefined, - protos.google.cloud.support.v2beta.IComment>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listComments values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listComments request %j', request); - return this.innerApiCalls - .listComments(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.support.v2beta.IComment[], - protos.google.cloud.support.v2beta.IListCommentsRequest|null, - protos.google.cloud.support.v2beta.IListCommentsResponse - ]) => { - this._log.info('listComments values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listComments`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case for which to list comments. - * @param {number} request.pageSize - * The maximum number of comments to fetch. Defaults to 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is returned. - * @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.support.v2beta.Comment|Comment} 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 `listCommentsAsync()` - * 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. - */ - listCommentsStream( - request?: protos.google.cloud.support.v2beta.IListCommentsRequest, - 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['listComments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listComments stream %j', request); - return this.descriptors.page.listComments.createStream( - this.innerApiCalls.listComments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listComments`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the case for which to list comments. - * @param {number} request.pageSize - * The maximum number of comments to fetch. Defaults to 10. - * @param {string} request.pageToken - * A token identifying the page of results to return. If unspecified, the - * first page is returned. - * @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.support.v2beta.Comment|Comment}. 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/v2beta/comment_service.list_comments.js - * region_tag:cloudsupport_v2beta_generated_CommentService_ListComments_async - */ - listCommentsAsync( - request?: protos.google.cloud.support.v2beta.IListCommentsRequest, - 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['listComments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listComments iterate %j', request); - return this.descriptors.page.listComments.asyncIterate( - this.innerApiCalls['listComments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified organizationCase resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @returns {string} Resource name string. - */ - organizationCasePath(organization:string,caseParam:string) { - return this.pathTemplates.organizationCasePathTemplate.render({ - organization: organization, - case: caseParam, - }); - } - - /** - * Parse the organization from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; - } - - /** - * Parse the case from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; - } - - /** - * Return a fully-qualified organizationCaseAttachmentId resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ - organization: organization, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the organization from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; - } - - /** - * Parse the case from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified organizationCaseComment resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.render({ - organization: organization, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the organization from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; - } - - /** - * Parse the case from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; - } - - /** - * Parse the comment from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; - } - - /** - * Return a fully-qualified organizationCaseEmailMessages resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} email_message - * @returns {string} Resource name string. - */ - organizationCaseEmailMessagesPath(organization:string,caseParam:string,emailMessage:string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.render({ - organization: organization, - case: caseParam, - email_message: emailMessage, - }); - } - - /** - * Parse the organization from OrganizationCaseEmailMessages resource. - * - * @param {string} organizationCaseEmailMessagesName - * A fully-qualified path representing organization_case_emailMessages resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).organization; - } - - /** - * Parse the case from OrganizationCaseEmailMessages resource. - * - * @param {string} organizationCaseEmailMessagesName - * A fully-qualified path representing organization_case_emailMessages resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).case; - } - - /** - * Parse the email_message from OrganizationCaseEmailMessages resource. - * - * @param {string} organizationCaseEmailMessagesName - * A fully-qualified path representing organization_case_emailMessages resource. - * @returns {string} A string representing the email_message. - */ - matchEmailMessageFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).email_message; - } - - /** - * Return a fully-qualified projectCase resource name string. - * - * @param {string} project - * @param {string} caseParam - * @returns {string} Resource name string. - */ - projectCasePath(project:string,caseParam:string) { - return this.pathTemplates.projectCasePathTemplate.render({ - project: project, - case: caseParam, - }); - } - - /** - * Parse the project from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; - } - - /** - * Parse the case from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; - } - - /** - * Return a fully-qualified projectCaseAttachmentId resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ - project: project, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the project from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; - } - - /** - * Parse the case from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified projectCaseComment resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - projectCaseCommentPath(project:string,caseParam:string,comment:string) { - return this.pathTemplates.projectCaseCommentPathTemplate.render({ - project: project, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the project from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; - } - - /** - * Parse the case from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; - } - - /** - * Parse the comment from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; - } - - /** - * Return a fully-qualified projectCaseEmailMessages resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} email_message - * @returns {string} Resource name string. - */ - projectCaseEmailMessagesPath(project:string,caseParam:string,emailMessage:string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.render({ - project: project, - case: caseParam, - email_message: emailMessage, - }); - } - - /** - * Parse the project from ProjectCaseEmailMessages resource. - * - * @param {string} projectCaseEmailMessagesName - * A fully-qualified path representing project_case_emailMessages resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).project; - } - - /** - * Parse the case from ProjectCaseEmailMessages resource. - * - * @param {string} projectCaseEmailMessagesName - * A fully-qualified path representing project_case_emailMessages resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).case; - } - - /** - * Parse the email_message from ProjectCaseEmailMessages resource. - * - * @param {string} projectCaseEmailMessagesName - * A fully-qualified path representing project_case_emailMessages resource. - * @returns {string} A string representing the email_message. - */ - matchEmailMessageFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).email_message; - } - - /** - * 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.commentServiceStub && !this._terminated) { - return this.commentServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client_config.json deleted file mode 100644 index 3d574dddc65..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_client_config.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "interfaces": { - "google.cloud.support.v2beta.CommentService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListComments": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateComment": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetComment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_proto_list.json deleted file mode 100644 index a623d27a7fd..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/comment_service_proto_list.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - "../../protos/google/cloud/support/v2beta/actor.proto", - "../../protos/google/cloud/support/v2beta/attachment.proto", - "../../protos/google/cloud/support/v2beta/attachment_service.proto", - "../../protos/google/cloud/support/v2beta/case.proto", - "../../protos/google/cloud/support/v2beta/case_service.proto", - "../../protos/google/cloud/support/v2beta/comment.proto", - "../../protos/google/cloud/support/v2beta/comment_service.proto", - "../../protos/google/cloud/support/v2beta/content.proto", - "../../protos/google/cloud/support/v2beta/email_message.proto", - "../../protos/google/cloud/support/v2beta/escalation.proto", - "../../protos/google/cloud/support/v2beta/feed_item.proto", - "../../protos/google/cloud/support/v2beta/feed_service.proto" -] diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client.ts b/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client.ts deleted file mode 100644 index 94bcb6de26d..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client.ts +++ /dev/null @@ -1,966 +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, PaginationCallback, GaxCall} 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/v2beta/feed_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './feed_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * A service to view case feed items. - * @class - * @memberof v2beta - */ -export class FeedServiceClient { - 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('support'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - feedServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of FeedServiceClient. - * - * @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 FeedServiceClient({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 FeedServiceClient; - 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 = 'cloudsupport.' + 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; - } - - // 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 = { - organizationCasePathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}' - ), - organizationCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' - ), - organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/comments/{comment}' - ), - organizationCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/cases/{case}/emailMessages/{email_message}' - ), - projectCasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}' - ), - projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/attachments/{attachment_id}' - ), - projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/comments/{comment}' - ), - projectCaseEmailMessagesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/cases/{case}/emailMessages/{email_message}' - ), - }; - - // 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 = { - showFeed: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'feedItems') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.support.v2beta.FeedService', 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.feedServiceStub) { - return this.feedServiceStub; - } - - // Put together the "service stub" for - // google.cloud.support.v2beta.FeedService. - this.feedServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.support.v2beta.FeedService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.support.v2beta.FeedService, - 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 feedServiceStubMethods = - ['showFeed']; - for (const methodName of feedServiceStubMethods) { - const callPromise = this.feedServiceStub.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] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.feedServiceStub; - } - - /** - * 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 'cloudsupport.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 'cloudsupport.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Show items in the feed of this case, including case emails, - * attachments, and comments. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the case for which feed items should be - * listed. - * @param {string} [request.orderBy] - * Optional. Field to order feed items by, followed by `asc` or `desc` - * postfix. The only valid field is - * `creation_time`. This list is case-insensitive, default sorting order is - * ascending, and the redundant space characters are insignificant. - * - * Example: `creation_time desc` - * @param {number} [request.pageSize] - * Optional. The maximum number of feed items fetched with each request. - * @param {string} [request.pageToken] - * Optional. A token identifying the page of results to return. If - * unspecified, it retrieves the first page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.support.v2beta.FeedItem|FeedItem}. - * 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 `showFeedAsync()` - * 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. - */ - showFeed( - request?: protos.google.cloud.support.v2beta.IShowFeedRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.support.v2beta.IFeedItem[], - protos.google.cloud.support.v2beta.IShowFeedRequest|null, - protos.google.cloud.support.v2beta.IShowFeedResponse - ]>; - showFeed( - request: protos.google.cloud.support.v2beta.IShowFeedRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.support.v2beta.IShowFeedRequest, - protos.google.cloud.support.v2beta.IShowFeedResponse|null|undefined, - protos.google.cloud.support.v2beta.IFeedItem>): void; - showFeed( - request: protos.google.cloud.support.v2beta.IShowFeedRequest, - callback: PaginationCallback< - protos.google.cloud.support.v2beta.IShowFeedRequest, - protos.google.cloud.support.v2beta.IShowFeedResponse|null|undefined, - protos.google.cloud.support.v2beta.IFeedItem>): void; - showFeed( - request?: protos.google.cloud.support.v2beta.IShowFeedRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.support.v2beta.IShowFeedRequest, - protos.google.cloud.support.v2beta.IShowFeedResponse|null|undefined, - protos.google.cloud.support.v2beta.IFeedItem>, - callback?: PaginationCallback< - protos.google.cloud.support.v2beta.IShowFeedRequest, - protos.google.cloud.support.v2beta.IShowFeedResponse|null|undefined, - protos.google.cloud.support.v2beta.IFeedItem>): - Promise<[ - protos.google.cloud.support.v2beta.IFeedItem[], - protos.google.cloud.support.v2beta.IShowFeedRequest|null, - protos.google.cloud.support.v2beta.IShowFeedResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = 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.support.v2beta.IShowFeedRequest, - protos.google.cloud.support.v2beta.IShowFeedResponse|null|undefined, - protos.google.cloud.support.v2beta.IFeedItem>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('showFeed values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('showFeed request %j', request); - return this.innerApiCalls - .showFeed(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.support.v2beta.IFeedItem[], - protos.google.cloud.support.v2beta.IShowFeedRequest|null, - protos.google.cloud.support.v2beta.IShowFeedResponse - ]) => { - this._log.info('showFeed values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `showFeed`, 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 case for which feed items should be - * listed. - * @param {string} [request.orderBy] - * Optional. Field to order feed items by, followed by `asc` or `desc` - * postfix. The only valid field is - * `creation_time`. This list is case-insensitive, default sorting order is - * ascending, and the redundant space characters are insignificant. - * - * Example: `creation_time desc` - * @param {number} [request.pageSize] - * Optional. The maximum number of feed items fetched with each request. - * @param {string} [request.pageToken] - * Optional. A token identifying the page of results to return. If - * unspecified, it retrieves the first page. - * @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.support.v2beta.FeedItem|FeedItem} 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 `showFeedAsync()` - * 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. - */ - showFeedStream( - request?: protos.google.cloud.support.v2beta.IShowFeedRequest, - 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['showFeed']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('showFeed stream %j', request); - return this.descriptors.page.showFeed.createStream( - this.innerApiCalls.showFeed as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `showFeed`, 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 case for which feed items should be - * listed. - * @param {string} [request.orderBy] - * Optional. Field to order feed items by, followed by `asc` or `desc` - * postfix. The only valid field is - * `creation_time`. This list is case-insensitive, default sorting order is - * ascending, and the redundant space characters are insignificant. - * - * Example: `creation_time desc` - * @param {number} [request.pageSize] - * Optional. The maximum number of feed items fetched with each request. - * @param {string} [request.pageToken] - * Optional. A token identifying the page of results to return. If - * unspecified, it retrieves the first page. - * @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.support.v2beta.FeedItem|FeedItem}. 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/v2beta/feed_service.show_feed.js - * region_tag:cloudsupport_v2beta_generated_FeedService_ShowFeed_async - */ - showFeedAsync( - request?: protos.google.cloud.support.v2beta.IShowFeedRequest, - 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['showFeed']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('showFeed iterate %j', request); - return this.descriptors.page.showFeed.asyncIterate( - this.innerApiCalls['showFeed'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified organizationCase resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @returns {string} Resource name string. - */ - organizationCasePath(organization:string,caseParam:string) { - return this.pathTemplates.organizationCasePathTemplate.render({ - organization: organization, - case: caseParam, - }); - } - - /** - * Parse the organization from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).organization; - } - - /** - * Parse the case from OrganizationCase resource. - * - * @param {string} organizationCaseName - * A fully-qualified path representing organization_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseName(organizationCaseName: string) { - return this.pathTemplates.organizationCasePathTemplate.match(organizationCaseName).case; - } - - /** - * Return a fully-qualified organizationCaseAttachmentId resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - organizationCaseAttachmentIdPath(organization:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ - organization: organization, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the organization from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).organization; - } - - /** - * Parse the case from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from OrganizationCaseAttachmentId resource. - * - * @param {string} organizationCaseAttachmentIdName - * A fully-qualified path representing organization_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromOrganizationCaseAttachmentIdName(organizationCaseAttachmentIdName: string) { - return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match(organizationCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified organizationCaseComment resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - organizationCaseCommentPath(organization:string,caseParam:string,comment:string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.render({ - organization: organization, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the organization from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).organization; - } - - /** - * Parse the case from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).case; - } - - /** - * Parse the comment from OrganizationCaseComment resource. - * - * @param {string} organizationCaseCommentName - * A fully-qualified path representing organization_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromOrganizationCaseCommentName(organizationCaseCommentName: string) { - return this.pathTemplates.organizationCaseCommentPathTemplate.match(organizationCaseCommentName).comment; - } - - /** - * Return a fully-qualified organizationCaseEmailMessages resource name string. - * - * @param {string} organization - * @param {string} caseParam - * @param {string} email_message - * @returns {string} Resource name string. - */ - organizationCaseEmailMessagesPath(organization:string,caseParam:string,emailMessage:string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.render({ - organization: organization, - case: caseParam, - email_message: emailMessage, - }); - } - - /** - * Parse the organization from OrganizationCaseEmailMessages resource. - * - * @param {string} organizationCaseEmailMessagesName - * A fully-qualified path representing organization_case_emailMessages resource. - * @returns {string} A string representing the organization. - */ - matchOrganizationFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).organization; - } - - /** - * Parse the case from OrganizationCaseEmailMessages resource. - * - * @param {string} organizationCaseEmailMessagesName - * A fully-qualified path representing organization_case_emailMessages resource. - * @returns {string} A string representing the case. - */ - matchCaseFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).case; - } - - /** - * Parse the email_message from OrganizationCaseEmailMessages resource. - * - * @param {string} organizationCaseEmailMessagesName - * A fully-qualified path representing organization_case_emailMessages resource. - * @returns {string} A string representing the email_message. - */ - matchEmailMessageFromOrganizationCaseEmailMessagesName(organizationCaseEmailMessagesName: string) { - return this.pathTemplates.organizationCaseEmailMessagesPathTemplate.match(organizationCaseEmailMessagesName).email_message; - } - - /** - * Return a fully-qualified projectCase resource name string. - * - * @param {string} project - * @param {string} caseParam - * @returns {string} Resource name string. - */ - projectCasePath(project:string,caseParam:string) { - return this.pathTemplates.projectCasePathTemplate.render({ - project: project, - case: caseParam, - }); - } - - /** - * Parse the project from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).project; - } - - /** - * Parse the case from ProjectCase resource. - * - * @param {string} projectCaseName - * A fully-qualified path representing project_case resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseName(projectCaseName: string) { - return this.pathTemplates.projectCasePathTemplate.match(projectCaseName).case; - } - - /** - * Return a fully-qualified projectCaseAttachmentId resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} attachment_id - * @returns {string} Resource name string. - */ - projectCaseAttachmentIdPath(project:string,caseParam:string,attachmentId:string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ - project: project, - case: caseParam, - attachment_id: attachmentId, - }); - } - - /** - * Parse the project from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).project; - } - - /** - * Parse the case from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).case; - } - - /** - * Parse the attachment_id from ProjectCaseAttachmentId resource. - * - * @param {string} projectCaseAttachmentIdName - * A fully-qualified path representing project_case_attachment_id resource. - * @returns {string} A string representing the attachment_id. - */ - matchAttachmentIdFromProjectCaseAttachmentIdName(projectCaseAttachmentIdName: string) { - return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match(projectCaseAttachmentIdName).attachment_id; - } - - /** - * Return a fully-qualified projectCaseComment resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} comment - * @returns {string} Resource name string. - */ - projectCaseCommentPath(project:string,caseParam:string,comment:string) { - return this.pathTemplates.projectCaseCommentPathTemplate.render({ - project: project, - case: caseParam, - comment: comment, - }); - } - - /** - * Parse the project from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).project; - } - - /** - * Parse the case from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).case; - } - - /** - * Parse the comment from ProjectCaseComment resource. - * - * @param {string} projectCaseCommentName - * A fully-qualified path representing project_case_comment resource. - * @returns {string} A string representing the comment. - */ - matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { - return this.pathTemplates.projectCaseCommentPathTemplate.match(projectCaseCommentName).comment; - } - - /** - * Return a fully-qualified projectCaseEmailMessages resource name string. - * - * @param {string} project - * @param {string} caseParam - * @param {string} email_message - * @returns {string} Resource name string. - */ - projectCaseEmailMessagesPath(project:string,caseParam:string,emailMessage:string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.render({ - project: project, - case: caseParam, - email_message: emailMessage, - }); - } - - /** - * Parse the project from ProjectCaseEmailMessages resource. - * - * @param {string} projectCaseEmailMessagesName - * A fully-qualified path representing project_case_emailMessages resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).project; - } - - /** - * Parse the case from ProjectCaseEmailMessages resource. - * - * @param {string} projectCaseEmailMessagesName - * A fully-qualified path representing project_case_emailMessages resource. - * @returns {string} A string representing the case. - */ - matchCaseFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).case; - } - - /** - * Parse the email_message from ProjectCaseEmailMessages resource. - * - * @param {string} projectCaseEmailMessagesName - * A fully-qualified path representing project_case_emailMessages resource. - * @returns {string} A string representing the email_message. - */ - matchEmailMessageFromProjectCaseEmailMessagesName(projectCaseEmailMessagesName: string) { - return this.pathTemplates.projectCaseEmailMessagesPathTemplate.match(projectCaseEmailMessagesName).email_message; - } - - /** - * 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.feedServiceStub && !this._terminated) { - return this.feedServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client_config.json b/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client_config.json deleted file mode 100644 index 469b9ebc14f..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_client_config.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "interfaces": { - "google.cloud.support.v2beta.FeedService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ShowFeed": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_proto_list.json b/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_proto_list.json deleted file mode 100644 index a623d27a7fd..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/feed_service_proto_list.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - "../../protos/google/cloud/support/v2beta/actor.proto", - "../../protos/google/cloud/support/v2beta/attachment.proto", - "../../protos/google/cloud/support/v2beta/attachment_service.proto", - "../../protos/google/cloud/support/v2beta/case.proto", - "../../protos/google/cloud/support/v2beta/case_service.proto", - "../../protos/google/cloud/support/v2beta/comment.proto", - "../../protos/google/cloud/support/v2beta/comment_service.proto", - "../../protos/google/cloud/support/v2beta/content.proto", - "../../protos/google/cloud/support/v2beta/email_message.proto", - "../../protos/google/cloud/support/v2beta/escalation.proto", - "../../protos/google/cloud/support/v2beta/feed_item.proto", - "../../protos/google/cloud/support/v2beta/feed_service.proto" -] diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/gapic_metadata.json b/owl-bot-staging/google-cloud-support/src/v2beta/gapic_metadata.json deleted file mode 100644 index 94afc596001..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/gapic_metadata.json +++ /dev/null @@ -1,229 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.support.v2beta", - "libraryPackage": "@google-cloud/support", - "services": { - "CaseAttachmentService": { - "clients": { - "grpc": { - "libraryClient": "CaseAttachmentServiceClient", - "rpcs": { - "GetAttachment": { - "methods": [ - "getAttachment" - ] - }, - "ListAttachments": { - "methods": [ - "listAttachments", - "listAttachmentsStream", - "listAttachmentsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "CaseAttachmentServiceClient", - "rpcs": { - "GetAttachment": { - "methods": [ - "getAttachment" - ] - }, - "ListAttachments": { - "methods": [ - "listAttachments", - "listAttachmentsStream", - "listAttachmentsAsync" - ] - } - } - } - } - }, - "CaseService": { - "clients": { - "grpc": { - "libraryClient": "CaseServiceClient", - "rpcs": { - "GetCase": { - "methods": [ - "getCase" - ] - }, - "CreateCase": { - "methods": [ - "createCase" - ] - }, - "UpdateCase": { - "methods": [ - "updateCase" - ] - }, - "EscalateCase": { - "methods": [ - "escalateCase" - ] - }, - "CloseCase": { - "methods": [ - "closeCase" - ] - }, - "ListCases": { - "methods": [ - "listCases", - "listCasesStream", - "listCasesAsync" - ] - }, - "SearchCases": { - "methods": [ - "searchCases", - "searchCasesStream", - "searchCasesAsync" - ] - }, - "SearchCaseClassifications": { - "methods": [ - "searchCaseClassifications", - "searchCaseClassificationsStream", - "searchCaseClassificationsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "CaseServiceClient", - "rpcs": { - "GetCase": { - "methods": [ - "getCase" - ] - }, - "CreateCase": { - "methods": [ - "createCase" - ] - }, - "UpdateCase": { - "methods": [ - "updateCase" - ] - }, - "EscalateCase": { - "methods": [ - "escalateCase" - ] - }, - "CloseCase": { - "methods": [ - "closeCase" - ] - }, - "ListCases": { - "methods": [ - "listCases", - "listCasesStream", - "listCasesAsync" - ] - }, - "SearchCases": { - "methods": [ - "searchCases", - "searchCasesStream", - "searchCasesAsync" - ] - }, - "SearchCaseClassifications": { - "methods": [ - "searchCaseClassifications", - "searchCaseClassificationsStream", - "searchCaseClassificationsAsync" - ] - } - } - } - } - }, - "CommentService": { - "clients": { - "grpc": { - "libraryClient": "CommentServiceClient", - "rpcs": { - "CreateComment": { - "methods": [ - "createComment" - ] - }, - "GetComment": { - "methods": [ - "getComment" - ] - }, - "ListComments": { - "methods": [ - "listComments", - "listCommentsStream", - "listCommentsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "CommentServiceClient", - "rpcs": { - "CreateComment": { - "methods": [ - "createComment" - ] - }, - "GetComment": { - "methods": [ - "getComment" - ] - }, - "ListComments": { - "methods": [ - "listComments", - "listCommentsStream", - "listCommentsAsync" - ] - } - } - } - } - }, - "FeedService": { - "clients": { - "grpc": { - "libraryClient": "FeedServiceClient", - "rpcs": { - "ShowFeed": { - "methods": [ - "showFeed", - "showFeedStream", - "showFeedAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "FeedServiceClient", - "rpcs": { - "ShowFeed": { - "methods": [ - "showFeed", - "showFeedStream", - "showFeedAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-support/src/v2beta/index.ts b/owl-bot-staging/google-cloud-support/src/v2beta/index.ts deleted file mode 100644 index 987b0997e1a..00000000000 --- a/owl-bot-staging/google-cloud-support/src/v2beta/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 {CaseAttachmentServiceClient} from './case_attachment_service_client'; -export {CaseServiceClient} from './case_service_client'; -export {CommentServiceClient} from './comment_service_client'; -export {FeedServiceClient} from './feed_service_client'; diff --git a/owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.js deleted file mode 100644 index de71d5c9768..00000000000 --- a/owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,29 +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 support = require('@google-cloud/support'); - -function main() { - const caseAttachmentServiceClient = new support.CaseAttachmentServiceClient(); - const caseServiceClient = new support.CaseServiceClient(); - const commentServiceClient = new support.CommentServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index f3b5a06d0b3..00000000000 --- a/owl-bot-staging/google-cloud-support/system-test/fixtures/sample/src/index.ts +++ /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 -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 {CaseAttachmentServiceClient, CaseServiceClient, CommentServiceClient} from '@google-cloud/support'; - -// check that the client class type name can be used -function doStuffWithCaseAttachmentServiceClient(client: CaseAttachmentServiceClient) { - client.close(); -} -function doStuffWithCaseServiceClient(client: CaseServiceClient) { - client.close(); -} -function doStuffWithCommentServiceClient(client: CommentServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const caseAttachmentServiceClient = new CaseAttachmentServiceClient(); - doStuffWithCaseAttachmentServiceClient(caseAttachmentServiceClient); - // check that the client instance can be created - const caseServiceClient = new CaseServiceClient(); - doStuffWithCaseServiceClient(caseServiceClient); - // check that the client instance can be created - const commentServiceClient = new CommentServiceClient(); - doStuffWithCommentServiceClient(commentServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-support/system-test/install.ts b/owl-bot-staging/google-cloud-support/system-test/install.ts deleted file mode 100644 index 394f3362d20..00000000000 --- a/owl-bot-staging/google-cloud-support/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-support/test/gapic_case_attachment_service_v2.ts b/owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2.ts deleted file mode 100644 index 8950d03df9e..00000000000 --- a/owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2.ts +++ /dev/null @@ -1,769 +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 caseattachmentserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} 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 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('v2.CaseAttachmentServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient(); - 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 = caseattachmentserviceModule.v2.CaseAttachmentServiceClient.servicePath; - assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = caseattachmentserviceModule.v2.CaseAttachmentServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 caseattachmentserviceModule.v2.CaseAttachmentServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 caseattachmentserviceModule.v2.CaseAttachmentServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 caseattachmentserviceModule.v2.CaseAttachmentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = caseattachmentserviceModule.v2.CaseAttachmentServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.caseAttachmentServiceStub, undefined); - await client.initialize(); - assert(client.caseAttachmentServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.caseAttachmentServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.caseAttachmentServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - 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 caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - 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('listAttachments', () => { - it('invokes listAttachments without error', async () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), - ]; - client.innerApiCalls.listAttachments = stubSimpleCall(expectedResponse); - const [response] = await client.listAttachments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAttachments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttachments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttachments without error using callback', async () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), - ]; - client.innerApiCalls.listAttachments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAttachments( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2.IAttachment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAttachments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttachments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttachments with error', async () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAttachments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAttachments(request), expectedError); - const actualRequest = (client.innerApiCalls.listAttachments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttachments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttachmentsStream without error', async () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), - ]; - client.descriptors.page.listAttachments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAttachmentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2.Attachment[] = []; - stream.on('data', (response: protos.google.cloud.support.v2.Attachment) => { - 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.listAttachments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAttachments, request)); - assert( - (client.descriptors.page.listAttachments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAttachmentsStream with error', async () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAttachments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAttachmentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2.Attachment[] = []; - stream.on('data', (response: protos.google.cloud.support.v2.Attachment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAttachments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAttachments, request)); - assert( - (client.descriptors.page.listAttachments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAttachments without error', async () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), - ]; - client.descriptors.page.listAttachments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.support.v2.IAttachment[] = []; - const iterable = client.listAttachmentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAttachments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAttachments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAttachments with error', async () => { - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAttachments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAttachmentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.support.v2.IAttachment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAttachments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAttachments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('organizationCase', async () => { - const fakePath = "/rendered/path/organizationCase"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - }; - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCasePath', () => { - const result = client.organizationCasePath("organizationValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseName', () => { - const result = client.matchOrganizationFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseName', () => { - const result = client.matchCaseFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseAttachmentId', async () => { - const fakePath = "/rendered/path/organizationCaseAttachmentId"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseAttachmentIdPath', () => { - const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseComment', async () => { - const fakePath = "/rendered/path/organizationCaseComment"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseCommentPath', () => { - const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseCommentName', () => { - const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseCommentName', () => { - const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromOrganizationCaseCommentName', () => { - const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCase', async () => { - const fakePath = "/rendered/path/projectCase"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - }; - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCasePath', () => { - const result = client.projectCasePath("projectValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseName', () => { - const result = client.matchProjectFromProjectCaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseName', () => { - const result = client.matchCaseFromProjectCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseAttachmentId', async () => { - const fakePath = "/rendered/path/projectCaseAttachmentId"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseAttachmentIdPath', () => { - const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseAttachmentIdName', () => { - const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseAttachmentIdName', () => { - const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseComment', async () => { - const fakePath = "/rendered/path/projectCaseComment"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseCommentPath', () => { - const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseCommentName', () => { - const result = client.matchProjectFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseCommentName', () => { - const result = client.matchCaseFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromProjectCaseCommentName', () => { - const result = client.matchCommentFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2beta.ts b/owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2beta.ts deleted file mode 100644 index cdb95eee4b2..00000000000 --- a/owl-bot-staging/google-cloud-support/test/gapic_case_attachment_service_v2beta.ts +++ /dev/null @@ -1,969 +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 caseattachmentserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} 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 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('v2beta.CaseAttachmentServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient(); - 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 = caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient.servicePath; - assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.caseAttachmentServiceStub, undefined); - await client.initialize(); - assert(client.caseAttachmentServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.caseAttachmentServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.caseAttachmentServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - 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 caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - 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('getAttachment', () => { - it('invokes getAttachment without error', async () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.GetAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.GetAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Attachment() - ); - client.innerApiCalls.getAttachment = stubSimpleCall(expectedResponse); - const [response] = await client.getAttachment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAttachment without error using callback', async () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.GetAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.GetAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Attachment() - ); - client.innerApiCalls.getAttachment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAttachment( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.IAttachment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAttachment with error', async () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.GetAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.GetAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAttachment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAttachment(request), expectedError); - const actualRequest = (client.innerApiCalls.getAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAttachment with closed client', async () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.GetAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.GetAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getAttachment(request), expectedError); - }); - }); - - describe('listAttachments', () => { - it('invokes listAttachments without error', async () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), - ]; - client.innerApiCalls.listAttachments = stubSimpleCall(expectedResponse); - const [response] = await client.listAttachments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAttachments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttachments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttachments without error using callback', async () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), - ]; - client.innerApiCalls.listAttachments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAttachments( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.IAttachment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAttachments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttachments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttachments with error', async () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAttachments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAttachments(request), expectedError); - const actualRequest = (client.innerApiCalls.listAttachments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttachments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttachmentsStream without error', async () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), - ]; - client.descriptors.page.listAttachments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAttachmentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2beta.Attachment[] = []; - stream.on('data', (response: protos.google.cloud.support.v2beta.Attachment) => { - 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.listAttachments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAttachments, request)); - assert( - (client.descriptors.page.listAttachments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAttachmentsStream with error', async () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAttachments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAttachmentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2beta.Attachment[] = []; - stream.on('data', (response: protos.google.cloud.support.v2beta.Attachment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAttachments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAttachments, request)); - assert( - (client.descriptors.page.listAttachments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAttachments without error', async () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Attachment()), - ]; - client.descriptors.page.listAttachments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.support.v2beta.IAttachment[] = []; - const iterable = client.listAttachmentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAttachments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAttachments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAttachments with error', async () => { - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAttachments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAttachmentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.support.v2beta.IAttachment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAttachments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAttachments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('organizationCase', async () => { - const fakePath = "/rendered/path/organizationCase"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - }; - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCasePath', () => { - const result = client.organizationCasePath("organizationValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseName', () => { - const result = client.matchOrganizationFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseName', () => { - const result = client.matchCaseFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseAttachmentId', async () => { - const fakePath = "/rendered/path/organizationCaseAttachmentId"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseAttachmentIdPath', () => { - const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseComment', async () => { - const fakePath = "/rendered/path/organizationCaseComment"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseCommentPath', () => { - const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseCommentName', () => { - const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseCommentName', () => { - const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromOrganizationCaseCommentName', () => { - const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseEmailMessages', async () => { - const fakePath = "/rendered/path/organizationCaseEmailMessages"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - email_message: "emailMessageValue", - }; - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseEmailMessagesPath', () => { - const result = client.organizationCaseEmailMessagesPath("organizationValue", "caseValue", "emailMessageValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseEmailMessagesName', () => { - const result = client.matchOrganizationFromOrganizationCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseEmailMessagesName', () => { - const result = client.matchCaseFromOrganizationCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEmailMessageFromOrganizationCaseEmailMessagesName', () => { - const result = client.matchEmailMessageFromOrganizationCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "emailMessageValue"); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCase', async () => { - const fakePath = "/rendered/path/projectCase"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - }; - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCasePath', () => { - const result = client.projectCasePath("projectValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseName', () => { - const result = client.matchProjectFromProjectCaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseName', () => { - const result = client.matchCaseFromProjectCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseAttachmentId', async () => { - const fakePath = "/rendered/path/projectCaseAttachmentId"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseAttachmentIdPath', () => { - const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseAttachmentIdName', () => { - const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseAttachmentIdName', () => { - const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseComment', async () => { - const fakePath = "/rendered/path/projectCaseComment"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseCommentPath', () => { - const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseCommentName', () => { - const result = client.matchProjectFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseCommentName', () => { - const result = client.matchCaseFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromProjectCaseCommentName', () => { - const result = client.matchCommentFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseEmailMessages', async () => { - const fakePath = "/rendered/path/projectCaseEmailMessages"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - email_message: "emailMessageValue", - }; - const client = new caseattachmentserviceModule.v2beta.CaseAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseEmailMessagesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseEmailMessagesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseEmailMessagesPath', () => { - const result = client.projectCaseEmailMessagesPath("projectValue", "caseValue", "emailMessageValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseEmailMessagesName', () => { - const result = client.matchProjectFromProjectCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseEmailMessagesName', () => { - const result = client.matchCaseFromProjectCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEmailMessageFromProjectCaseEmailMessagesName', () => { - const result = client.matchEmailMessageFromProjectCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "emailMessageValue"); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-support/test/gapic_case_service_v2.ts b/owl-bot-staging/google-cloud-support/test/gapic_case_service_v2.ts deleted file mode 100644 index 791bd38a392..00000000000 --- a/owl-bot-staging/google-cloud-support/test/gapic_case_service_v2.ts +++ /dev/null @@ -1,1763 +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 caseserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} 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 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('v2.CaseServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new caseserviceModule.v2.CaseServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new caseserviceModule.v2.CaseServiceClient(); - 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 = caseserviceModule.v2.CaseServiceClient.servicePath; - assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = caseserviceModule.v2.CaseServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new caseserviceModule.v2.CaseServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new caseserviceModule.v2.CaseServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 caseserviceModule.v2.CaseServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 caseserviceModule.v2.CaseServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 caseserviceModule.v2.CaseServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = caseserviceModule.v2.CaseServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new caseserviceModule.v2.CaseServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.caseServiceStub, undefined); - await client.initialize(); - assert(client.caseServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.caseServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.caseServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new caseserviceModule.v2.CaseServiceClient({ - 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 caseserviceModule.v2.CaseServiceClient({ - 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('getCase', () => { - it('invokes getCase without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.GetCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.GetCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2.Case() - ); - client.innerApiCalls.getCase = stubSimpleCall(expectedResponse); - const [response] = await client.getCase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCase without error using callback', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.GetCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.GetCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2.Case() - ); - client.innerApiCalls.getCase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCase( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2.ICase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCase with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.GetCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.GetCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCase(request), expectedError); - const actualRequest = (client.innerApiCalls.getCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCase with closed client', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.GetCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.GetCaseRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getCase(request), expectedError); - }); - }); - - describe('createCase', () => { - it('invokes createCase without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.CreateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.CreateCaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2.Case() - ); - client.innerApiCalls.createCase = stubSimpleCall(expectedResponse); - const [response] = await client.createCase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCase without error using callback', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.CreateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.CreateCaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2.Case() - ); - client.innerApiCalls.createCase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCase( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2.ICase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCase with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.CreateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.CreateCaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCase(request), expectedError); - const actualRequest = (client.innerApiCalls.createCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCase with closed client', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.CreateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.CreateCaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createCase(request), expectedError); - }); - }); - - describe('updateCase', () => { - it('invokes updateCase without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.UpdateCaseRequest() - ); - request.case ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.UpdateCaseRequest', ['case', 'name']); - request.case.name = defaultValue1; - const expectedHeaderRequestParams = `case.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2.Case() - ); - client.innerApiCalls.updateCase = stubSimpleCall(expectedResponse); - const [response] = await client.updateCase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCase without error using callback', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.UpdateCaseRequest() - ); - request.case ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.UpdateCaseRequest', ['case', 'name']); - request.case.name = defaultValue1; - const expectedHeaderRequestParams = `case.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2.Case() - ); - client.innerApiCalls.updateCase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCase( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2.ICase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCase with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.UpdateCaseRequest() - ); - request.case ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.UpdateCaseRequest', ['case', 'name']); - request.case.name = defaultValue1; - const expectedHeaderRequestParams = `case.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateCase(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCase with closed client', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.UpdateCaseRequest() - ); - request.case ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.UpdateCaseRequest', ['case', 'name']); - request.case.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateCase(request), expectedError); - }); - }); - - describe('escalateCase', () => { - it('invokes escalateCase without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.EscalateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.EscalateCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2.Case() - ); - client.innerApiCalls.escalateCase = stubSimpleCall(expectedResponse); - const [response] = await client.escalateCase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.escalateCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.escalateCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes escalateCase without error using callback', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.EscalateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.EscalateCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2.Case() - ); - client.innerApiCalls.escalateCase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.escalateCase( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2.ICase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.escalateCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.escalateCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes escalateCase with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.EscalateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.EscalateCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.escalateCase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.escalateCase(request), expectedError); - const actualRequest = (client.innerApiCalls.escalateCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.escalateCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes escalateCase with closed client', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.EscalateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.EscalateCaseRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.escalateCase(request), expectedError); - }); - }); - - describe('closeCase', () => { - it('invokes closeCase without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.CloseCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.CloseCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2.Case() - ); - client.innerApiCalls.closeCase = stubSimpleCall(expectedResponse); - const [response] = await client.closeCase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.closeCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.closeCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes closeCase without error using callback', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.CloseCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.CloseCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2.Case() - ); - client.innerApiCalls.closeCase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.closeCase( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2.ICase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.closeCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.closeCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes closeCase with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.CloseCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.CloseCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.closeCase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.closeCase(request), expectedError); - const actualRequest = (client.innerApiCalls.closeCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.closeCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes closeCase with closed client', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.CloseCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.CloseCaseRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.closeCase(request), expectedError); - }); - }); - - describe('listCases', () => { - it('invokes listCases without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - ]; - client.innerApiCalls.listCases = stubSimpleCall(expectedResponse); - const [response] = await client.listCases(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listCases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCases without error using callback', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - ]; - client.innerApiCalls.listCases = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCases( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2.ICase[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listCases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCases with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCases = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCases(request), expectedError); - const actualRequest = (client.innerApiCalls.listCases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCasesStream without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - ]; - client.descriptors.page.listCases.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listCasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2.Case[] = []; - stream.on('data', (response: protos.google.cloud.support.v2.Case) => { - 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.listCases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCases, request)); - assert( - (client.descriptors.page.listCases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listCasesStream with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listCases.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listCasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2.Case[] = []; - stream.on('data', (response: protos.google.cloud.support.v2.Case) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listCases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCases, request)); - assert( - (client.descriptors.page.listCases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listCases without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - ]; - client.descriptors.page.listCases.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.support.v2.ICase[] = []; - const iterable = client.listCasesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listCases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listCases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listCases with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listCases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCasesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.support.v2.ICase[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listCases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listCases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('searchCases', () => { - it('invokes searchCases without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - ]; - client.innerApiCalls.searchCases = stubSimpleCall(expectedResponse); - const [response] = await client.searchCases(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchCases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchCases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchCases without error using callback', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - ]; - client.innerApiCalls.searchCases = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchCases( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2.ICase[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchCases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchCases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchCases with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchCases = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchCases(request), expectedError); - const actualRequest = (client.innerApiCalls.searchCases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchCases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchCasesStream without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - ]; - client.descriptors.page.searchCases.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchCasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2.Case[] = []; - stream.on('data', (response: protos.google.cloud.support.v2.Case) => { - 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.searchCases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchCases, request)); - assert( - (client.descriptors.page.searchCases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes searchCasesStream with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.searchCases.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchCasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2.Case[] = []; - stream.on('data', (response: protos.google.cloud.support.v2.Case) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchCases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchCases, request)); - assert( - (client.descriptors.page.searchCases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchCases without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - generateSampleMessage(new protos.google.cloud.support.v2.Case()), - ]; - client.descriptors.page.searchCases.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.support.v2.ICase[] = []; - const iterable = client.searchCasesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchCases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchCases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchCases with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.searchCases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchCasesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.support.v2.ICase[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchCases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchCases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('searchCaseClassifications', () => { - it('invokes searchCaseClassifications without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() - );const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), - ]; - client.innerApiCalls.searchCaseClassifications = stubSimpleCall(expectedResponse); - const [response] = await client.searchCaseClassifications(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes searchCaseClassifications without error using callback', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() - );const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), - ]; - client.innerApiCalls.searchCaseClassifications = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchCaseClassifications( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2.ICaseClassification[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes searchCaseClassifications with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.searchCaseClassifications = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchCaseClassifications(request), expectedError); - }); - - it('invokes searchCaseClassificationsStream without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() - ); - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), - ]; - client.descriptors.page.searchCaseClassifications.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchCaseClassificationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2.CaseClassification[] = []; - stream.on('data', (response: protos.google.cloud.support.v2.CaseClassification) => { - 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.searchCaseClassifications.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchCaseClassifications, request)); - }); - - it('invokes searchCaseClassificationsStream with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() - ); - const expectedError = new Error('expected'); - client.descriptors.page.searchCaseClassifications.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchCaseClassificationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2.CaseClassification[] = []; - stream.on('data', (response: protos.google.cloud.support.v2.CaseClassification) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchCaseClassifications.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchCaseClassifications, request)); - }); - - it('uses async iteration with searchCaseClassifications without error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() - ); - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2.CaseClassification()), - ]; - client.descriptors.page.searchCaseClassifications.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.support.v2.ICaseClassification[] = []; - const iterable = client.searchCaseClassificationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchCaseClassifications.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - - it('uses async iteration with searchCaseClassifications with error', async () => { - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() - ); - const expectedError = new Error('expected'); - client.descriptors.page.searchCaseClassifications.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchCaseClassificationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.support.v2.ICaseClassification[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchCaseClassifications.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('organization', async () => { - const fakePath = "/rendered/path/organization"; - const expectedParameters = { - organization: "organizationValue", - }; - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationPath', () => { - const result = client.organizationPath("organizationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationName', () => { - const result = client.matchOrganizationFromOrganizationName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCase', async () => { - const fakePath = "/rendered/path/organizationCase"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - }; - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCasePath', () => { - const result = client.organizationCasePath("organizationValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseName', () => { - const result = client.matchOrganizationFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseName', () => { - const result = client.matchCaseFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseAttachmentId', async () => { - const fakePath = "/rendered/path/organizationCaseAttachmentId"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseAttachmentIdPath', () => { - const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseComment', async () => { - const fakePath = "/rendered/path/organizationCaseComment"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseCommentPath', () => { - const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseCommentName', () => { - const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseCommentName', () => { - const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromOrganizationCaseCommentName', () => { - const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCase', async () => { - const fakePath = "/rendered/path/projectCase"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - }; - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCasePath', () => { - const result = client.projectCasePath("projectValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseName', () => { - const result = client.matchProjectFromProjectCaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseName', () => { - const result = client.matchCaseFromProjectCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseAttachmentId', async () => { - const fakePath = "/rendered/path/projectCaseAttachmentId"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseAttachmentIdPath', () => { - const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseAttachmentIdName', () => { - const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseAttachmentIdName', () => { - const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseComment', async () => { - const fakePath = "/rendered/path/projectCaseComment"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new caseserviceModule.v2.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseCommentPath', () => { - const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseCommentName', () => { - const result = client.matchProjectFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseCommentName', () => { - const result = client.matchCaseFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromProjectCaseCommentName', () => { - const result = client.matchCommentFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-support/test/gapic_case_service_v2beta.ts b/owl-bot-staging/google-cloud-support/test/gapic_case_service_v2beta.ts deleted file mode 100644 index 3ebffb51fb8..00000000000 --- a/owl-bot-staging/google-cloud-support/test/gapic_case_service_v2beta.ts +++ /dev/null @@ -1,1855 +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 caseserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} 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 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('v2beta.CaseServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new caseserviceModule.v2beta.CaseServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new caseserviceModule.v2beta.CaseServiceClient(); - 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 = caseserviceModule.v2beta.CaseServiceClient.servicePath; - assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = caseserviceModule.v2beta.CaseServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 caseserviceModule.v2beta.CaseServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 caseserviceModule.v2beta.CaseServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 caseserviceModule.v2beta.CaseServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = caseserviceModule.v2beta.CaseServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new caseserviceModule.v2beta.CaseServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.caseServiceStub, undefined); - await client.initialize(); - assert(client.caseServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.caseServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.caseServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new caseserviceModule.v2beta.CaseServiceClient({ - 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 caseserviceModule.v2beta.CaseServiceClient({ - 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('getCase', () => { - it('invokes getCase without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.GetCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.GetCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Case() - ); - client.innerApiCalls.getCase = stubSimpleCall(expectedResponse); - const [response] = await client.getCase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCase without error using callback', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.GetCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.GetCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Case() - ); - client.innerApiCalls.getCase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCase( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCase with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.GetCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.GetCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCase(request), expectedError); - const actualRequest = (client.innerApiCalls.getCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCase with closed client', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.GetCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.GetCaseRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getCase(request), expectedError); - }); - }); - - describe('createCase', () => { - it('invokes createCase without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.CreateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.CreateCaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Case() - ); - client.innerApiCalls.createCase = stubSimpleCall(expectedResponse); - const [response] = await client.createCase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCase without error using callback', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.CreateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.CreateCaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Case() - ); - client.innerApiCalls.createCase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCase( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCase with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.CreateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.CreateCaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCase(request), expectedError); - const actualRequest = (client.innerApiCalls.createCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCase with closed client', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.CreateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.CreateCaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createCase(request), expectedError); - }); - }); - - describe('updateCase', () => { - it('invokes updateCase without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.UpdateCaseRequest() - ); - request.case ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.UpdateCaseRequest', ['case', 'name']); - request.case.name = defaultValue1; - const expectedHeaderRequestParams = `case.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Case() - ); - client.innerApiCalls.updateCase = stubSimpleCall(expectedResponse); - const [response] = await client.updateCase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCase without error using callback', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.UpdateCaseRequest() - ); - request.case ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.UpdateCaseRequest', ['case', 'name']); - request.case.name = defaultValue1; - const expectedHeaderRequestParams = `case.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Case() - ); - client.innerApiCalls.updateCase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCase( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCase with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.UpdateCaseRequest() - ); - request.case ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.UpdateCaseRequest', ['case', 'name']); - request.case.name = defaultValue1; - const expectedHeaderRequestParams = `case.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateCase(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCase with closed client', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.UpdateCaseRequest() - ); - request.case ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.UpdateCaseRequest', ['case', 'name']); - request.case.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateCase(request), expectedError); - }); - }); - - describe('escalateCase', () => { - it('invokes escalateCase without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.EscalateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.EscalateCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Case() - ); - client.innerApiCalls.escalateCase = stubSimpleCall(expectedResponse); - const [response] = await client.escalateCase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.escalateCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.escalateCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes escalateCase without error using callback', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.EscalateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.EscalateCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Case() - ); - client.innerApiCalls.escalateCase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.escalateCase( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.escalateCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.escalateCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes escalateCase with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.EscalateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.EscalateCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.escalateCase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.escalateCase(request), expectedError); - const actualRequest = (client.innerApiCalls.escalateCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.escalateCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes escalateCase with closed client', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.EscalateCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.EscalateCaseRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.escalateCase(request), expectedError); - }); - }); - - describe('closeCase', () => { - it('invokes closeCase without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.CloseCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.CloseCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Case() - ); - client.innerApiCalls.closeCase = stubSimpleCall(expectedResponse); - const [response] = await client.closeCase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.closeCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.closeCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes closeCase without error using callback', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.CloseCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.CloseCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Case() - ); - client.innerApiCalls.closeCase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.closeCase( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.closeCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.closeCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes closeCase with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.CloseCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.CloseCaseRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.closeCase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.closeCase(request), expectedError); - const actualRequest = (client.innerApiCalls.closeCase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.closeCase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes closeCase with closed client', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.CloseCaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.CloseCaseRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.closeCase(request), expectedError); - }); - }); - - describe('listCases', () => { - it('invokes listCases without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - ]; - client.innerApiCalls.listCases = stubSimpleCall(expectedResponse); - const [response] = await client.listCases(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listCases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCases without error using callback', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - ]; - client.innerApiCalls.listCases = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCases( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listCases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCases with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCases = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCases(request), expectedError); - const actualRequest = (client.innerApiCalls.listCases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCasesStream without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - ]; - client.descriptors.page.listCases.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listCasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2beta.Case[] = []; - stream.on('data', (response: protos.google.cloud.support.v2beta.Case) => { - 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.listCases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCases, request)); - assert( - (client.descriptors.page.listCases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listCasesStream with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listCases.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listCasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2beta.Case[] = []; - stream.on('data', (response: protos.google.cloud.support.v2beta.Case) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listCases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCases, request)); - assert( - (client.descriptors.page.listCases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listCases without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - ]; - client.descriptors.page.listCases.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.support.v2beta.ICase[] = []; - const iterable = client.listCasesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listCases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listCases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listCases with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listCases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCasesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.support.v2beta.ICase[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listCases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listCases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('searchCases', () => { - it('invokes searchCases without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - ]; - client.innerApiCalls.searchCases = stubSimpleCall(expectedResponse); - const [response] = await client.searchCases(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchCases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchCases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchCases without error using callback', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - ]; - client.innerApiCalls.searchCases = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchCases( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICase[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchCases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchCases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchCases with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchCases = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchCases(request), expectedError); - const actualRequest = (client.innerApiCalls.searchCases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchCases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchCasesStream without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - ]; - client.descriptors.page.searchCases.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchCasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2beta.Case[] = []; - stream.on('data', (response: protos.google.cloud.support.v2beta.Case) => { - 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.searchCases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchCases, request)); - assert( - (client.descriptors.page.searchCases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes searchCasesStream with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.searchCases.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchCasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2beta.Case[] = []; - stream.on('data', (response: protos.google.cloud.support.v2beta.Case) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchCases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchCases, request)); - assert( - (client.descriptors.page.searchCases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchCases without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Case()), - ]; - client.descriptors.page.searchCases.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.support.v2beta.ICase[] = []; - const iterable = client.searchCasesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchCases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchCases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchCases with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.SearchCasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.searchCases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchCasesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.support.v2beta.ICase[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchCases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchCases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('searchCaseClassifications', () => { - it('invokes searchCaseClassifications without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() - );const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), - ]; - client.innerApiCalls.searchCaseClassifications = stubSimpleCall(expectedResponse); - const [response] = await client.searchCaseClassifications(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes searchCaseClassifications without error using callback', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() - );const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), - ]; - client.innerApiCalls.searchCaseClassifications = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchCaseClassifications( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.ICaseClassification[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes searchCaseClassifications with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.searchCaseClassifications = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchCaseClassifications(request), expectedError); - }); - - it('invokes searchCaseClassificationsStream without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() - ); - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), - ]; - client.descriptors.page.searchCaseClassifications.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchCaseClassificationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2beta.CaseClassification[] = []; - stream.on('data', (response: protos.google.cloud.support.v2beta.CaseClassification) => { - 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.searchCaseClassifications.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchCaseClassifications, request)); - }); - - it('invokes searchCaseClassificationsStream with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() - ); - const expectedError = new Error('expected'); - client.descriptors.page.searchCaseClassifications.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchCaseClassificationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2beta.CaseClassification[] = []; - stream.on('data', (response: protos.google.cloud.support.v2beta.CaseClassification) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchCaseClassifications.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchCaseClassifications, request)); - }); - - it('uses async iteration with searchCaseClassifications without error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() - ); - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), - generateSampleMessage(new protos.google.cloud.support.v2beta.CaseClassification()), - ]; - client.descriptors.page.searchCaseClassifications.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.support.v2beta.ICaseClassification[] = []; - const iterable = client.searchCaseClassificationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchCaseClassifications.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - - it('uses async iteration with searchCaseClassifications with error', async () => { - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.SearchCaseClassificationsRequest() - ); - const expectedError = new Error('expected'); - client.descriptors.page.searchCaseClassifications.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchCaseClassificationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.support.v2beta.ICaseClassification[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchCaseClassifications.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('organization', async () => { - const fakePath = "/rendered/path/organization"; - const expectedParameters = { - organization: "organizationValue", - }; - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationPath', () => { - const result = client.organizationPath("organizationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationName', () => { - const result = client.matchOrganizationFromOrganizationName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCase', async () => { - const fakePath = "/rendered/path/organizationCase"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - }; - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCasePath', () => { - const result = client.organizationCasePath("organizationValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseName', () => { - const result = client.matchOrganizationFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseName', () => { - const result = client.matchCaseFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseAttachmentId', async () => { - const fakePath = "/rendered/path/organizationCaseAttachmentId"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseAttachmentIdPath', () => { - const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseComment', async () => { - const fakePath = "/rendered/path/organizationCaseComment"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseCommentPath', () => { - const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseCommentName', () => { - const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseCommentName', () => { - const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromOrganizationCaseCommentName', () => { - const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseEmailMessages', async () => { - const fakePath = "/rendered/path/organizationCaseEmailMessages"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - email_message: "emailMessageValue", - }; - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseEmailMessagesPath', () => { - const result = client.organizationCaseEmailMessagesPath("organizationValue", "caseValue", "emailMessageValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseEmailMessagesName', () => { - const result = client.matchOrganizationFromOrganizationCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseEmailMessagesName', () => { - const result = client.matchCaseFromOrganizationCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEmailMessageFromOrganizationCaseEmailMessagesName', () => { - const result = client.matchEmailMessageFromOrganizationCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "emailMessageValue"); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCase', async () => { - const fakePath = "/rendered/path/projectCase"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - }; - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCasePath', () => { - const result = client.projectCasePath("projectValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseName', () => { - const result = client.matchProjectFromProjectCaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseName', () => { - const result = client.matchCaseFromProjectCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseAttachmentId', async () => { - const fakePath = "/rendered/path/projectCaseAttachmentId"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseAttachmentIdPath', () => { - const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseAttachmentIdName', () => { - const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseAttachmentIdName', () => { - const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseComment', async () => { - const fakePath = "/rendered/path/projectCaseComment"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseCommentPath', () => { - const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseCommentName', () => { - const result = client.matchProjectFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseCommentName', () => { - const result = client.matchCaseFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromProjectCaseCommentName', () => { - const result = client.matchCommentFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseEmailMessages', async () => { - const fakePath = "/rendered/path/projectCaseEmailMessages"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - email_message: "emailMessageValue", - }; - const client = new caseserviceModule.v2beta.CaseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseEmailMessagesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseEmailMessagesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseEmailMessagesPath', () => { - const result = client.projectCaseEmailMessagesPath("projectValue", "caseValue", "emailMessageValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseEmailMessagesName', () => { - const result = client.matchProjectFromProjectCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseEmailMessagesName', () => { - const result = client.matchCaseFromProjectCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEmailMessageFromProjectCaseEmailMessagesName', () => { - const result = client.matchEmailMessageFromProjectCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "emailMessageValue"); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2.ts b/owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2.ts deleted file mode 100644 index b686f324981..00000000000 --- a/owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2.ts +++ /dev/null @@ -1,877 +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 commentserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} 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 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('v2.CommentServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new commentserviceModule.v2.CommentServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new commentserviceModule.v2.CommentServiceClient(); - 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 = commentserviceModule.v2.CommentServiceClient.servicePath; - assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = commentserviceModule.v2.CommentServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new commentserviceModule.v2.CommentServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new commentserviceModule.v2.CommentServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 commentserviceModule.v2.CommentServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 commentserviceModule.v2.CommentServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 commentserviceModule.v2.CommentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = commentserviceModule.v2.CommentServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new commentserviceModule.v2.CommentServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.commentServiceStub, undefined); - await client.initialize(); - assert(client.commentServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.commentServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.commentServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new commentserviceModule.v2.CommentServiceClient({ - 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 commentserviceModule.v2.CommentServiceClient({ - 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('createComment', () => { - it('invokes createComment without error', async () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.CreateCommentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.CreateCommentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2.Comment() - ); - client.innerApiCalls.createComment = stubSimpleCall(expectedResponse); - const [response] = await client.createComment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createComment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createComment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createComment without error using callback', async () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.CreateCommentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.CreateCommentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2.Comment() - ); - client.innerApiCalls.createComment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createComment( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2.IComment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createComment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createComment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createComment with error', async () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.CreateCommentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.CreateCommentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createComment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createComment(request), expectedError); - const actualRequest = (client.innerApiCalls.createComment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createComment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createComment with closed client', async () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.CreateCommentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.CreateCommentRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createComment(request), expectedError); - }); - }); - - describe('listComments', () => { - it('invokes listComments without error', async () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2.Comment()), - ]; - client.innerApiCalls.listComments = stubSimpleCall(expectedResponse); - const [response] = await client.listComments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listComments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listComments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listComments without error using callback', async () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2.Comment()), - ]; - client.innerApiCalls.listComments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listComments( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2.IComment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listComments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listComments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listComments with error', async () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listComments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listComments(request), expectedError); - const actualRequest = (client.innerApiCalls.listComments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listComments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCommentsStream without error', async () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2.Comment()), - ]; - client.descriptors.page.listComments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listCommentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2.Comment[] = []; - stream.on('data', (response: protos.google.cloud.support.v2.Comment) => { - 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.listComments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listComments, request)); - assert( - (client.descriptors.page.listComments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listCommentsStream with error', async () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listComments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listCommentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2.Comment[] = []; - stream.on('data', (response: protos.google.cloud.support.v2.Comment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listComments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listComments, request)); - assert( - (client.descriptors.page.listComments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listComments without error', async () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2.Comment()), - ]; - client.descriptors.page.listComments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.support.v2.IComment[] = []; - const iterable = client.listCommentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listComments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listComments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listComments with error', async () => { - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listComments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCommentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.support.v2.IComment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listComments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listComments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('organizationCase', async () => { - const fakePath = "/rendered/path/organizationCase"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - }; - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCasePath', () => { - const result = client.organizationCasePath("organizationValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseName', () => { - const result = client.matchOrganizationFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseName', () => { - const result = client.matchCaseFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseAttachmentId', async () => { - const fakePath = "/rendered/path/organizationCaseAttachmentId"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseAttachmentIdPath', () => { - const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseComment', async () => { - const fakePath = "/rendered/path/organizationCaseComment"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseCommentPath', () => { - const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseCommentName', () => { - const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseCommentName', () => { - const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromOrganizationCaseCommentName', () => { - const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCase', async () => { - const fakePath = "/rendered/path/projectCase"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - }; - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCasePath', () => { - const result = client.projectCasePath("projectValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseName', () => { - const result = client.matchProjectFromProjectCaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseName', () => { - const result = client.matchCaseFromProjectCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseAttachmentId', async () => { - const fakePath = "/rendered/path/projectCaseAttachmentId"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseAttachmentIdPath', () => { - const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseAttachmentIdName', () => { - const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseAttachmentIdName', () => { - const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseComment', async () => { - const fakePath = "/rendered/path/projectCaseComment"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new commentserviceModule.v2.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseCommentPath', () => { - const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseCommentName', () => { - const result = client.matchProjectFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseCommentName', () => { - const result = client.matchCaseFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromProjectCaseCommentName', () => { - const result = client.matchCommentFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2beta.ts b/owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2beta.ts deleted file mode 100644 index 448533a0f6e..00000000000 --- a/owl-bot-staging/google-cloud-support/test/gapic_comment_service_v2beta.ts +++ /dev/null @@ -1,1077 +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 commentserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} 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 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('v2beta.CommentServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new commentserviceModule.v2beta.CommentServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new commentserviceModule.v2beta.CommentServiceClient(); - 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 = commentserviceModule.v2beta.CommentServiceClient.servicePath; - assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = commentserviceModule.v2beta.CommentServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 commentserviceModule.v2beta.CommentServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 commentserviceModule.v2beta.CommentServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 commentserviceModule.v2beta.CommentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = commentserviceModule.v2beta.CommentServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new commentserviceModule.v2beta.CommentServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.commentServiceStub, undefined); - await client.initialize(); - assert(client.commentServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.commentServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.commentServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new commentserviceModule.v2beta.CommentServiceClient({ - 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 commentserviceModule.v2beta.CommentServiceClient({ - 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('createComment', () => { - it('invokes createComment without error', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.CreateCommentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.CreateCommentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Comment() - ); - client.innerApiCalls.createComment = stubSimpleCall(expectedResponse); - const [response] = await client.createComment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createComment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createComment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createComment without error using callback', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.CreateCommentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.CreateCommentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Comment() - ); - client.innerApiCalls.createComment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createComment( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.IComment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createComment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createComment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createComment with error', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.CreateCommentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.CreateCommentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createComment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createComment(request), expectedError); - const actualRequest = (client.innerApiCalls.createComment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createComment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createComment with closed client', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.CreateCommentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.CreateCommentRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createComment(request), expectedError); - }); - }); - - describe('getComment', () => { - it('invokes getComment without error', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.GetCommentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.GetCommentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Comment() - ); - client.innerApiCalls.getComment = stubSimpleCall(expectedResponse); - const [response] = await client.getComment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getComment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getComment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getComment without error using callback', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.GetCommentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.GetCommentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.support.v2beta.Comment() - ); - client.innerApiCalls.getComment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getComment( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.IComment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getComment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getComment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getComment with error', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.GetCommentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.GetCommentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getComment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getComment(request), expectedError); - const actualRequest = (client.innerApiCalls.getComment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getComment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getComment with closed client', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.GetCommentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.GetCommentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getComment(request), expectedError); - }); - }); - - describe('listComments', () => { - it('invokes listComments without error', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), - ]; - client.innerApiCalls.listComments = stubSimpleCall(expectedResponse); - const [response] = await client.listComments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listComments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listComments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listComments without error using callback', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), - ]; - client.innerApiCalls.listComments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listComments( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.IComment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listComments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listComments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listComments with error', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listComments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listComments(request), expectedError); - const actualRequest = (client.innerApiCalls.listComments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listComments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listCommentsStream without error', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), - ]; - client.descriptors.page.listComments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listCommentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2beta.Comment[] = []; - stream.on('data', (response: protos.google.cloud.support.v2beta.Comment) => { - 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.listComments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listComments, request)); - assert( - (client.descriptors.page.listComments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listCommentsStream with error', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listComments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listCommentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2beta.Comment[] = []; - stream.on('data', (response: protos.google.cloud.support.v2beta.Comment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listComments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listComments, request)); - assert( - (client.descriptors.page.listComments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listComments without error', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), - generateSampleMessage(new protos.google.cloud.support.v2beta.Comment()), - ]; - client.descriptors.page.listComments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.support.v2beta.IComment[] = []; - const iterable = client.listCommentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listComments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listComments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listComments with error', async () => { - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ListCommentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ListCommentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listComments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCommentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.support.v2beta.IComment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listComments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listComments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('organizationCase', async () => { - const fakePath = "/rendered/path/organizationCase"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - }; - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCasePath', () => { - const result = client.organizationCasePath("organizationValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseName', () => { - const result = client.matchOrganizationFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseName', () => { - const result = client.matchCaseFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseAttachmentId', async () => { - const fakePath = "/rendered/path/organizationCaseAttachmentId"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseAttachmentIdPath', () => { - const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseComment', async () => { - const fakePath = "/rendered/path/organizationCaseComment"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseCommentPath', () => { - const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseCommentName', () => { - const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseCommentName', () => { - const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromOrganizationCaseCommentName', () => { - const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseEmailMessages', async () => { - const fakePath = "/rendered/path/organizationCaseEmailMessages"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - email_message: "emailMessageValue", - }; - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseEmailMessagesPath', () => { - const result = client.organizationCaseEmailMessagesPath("organizationValue", "caseValue", "emailMessageValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseEmailMessagesName', () => { - const result = client.matchOrganizationFromOrganizationCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseEmailMessagesName', () => { - const result = client.matchCaseFromOrganizationCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEmailMessageFromOrganizationCaseEmailMessagesName', () => { - const result = client.matchEmailMessageFromOrganizationCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "emailMessageValue"); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCase', async () => { - const fakePath = "/rendered/path/projectCase"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - }; - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCasePath', () => { - const result = client.projectCasePath("projectValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseName', () => { - const result = client.matchProjectFromProjectCaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseName', () => { - const result = client.matchCaseFromProjectCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseAttachmentId', async () => { - const fakePath = "/rendered/path/projectCaseAttachmentId"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseAttachmentIdPath', () => { - const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseAttachmentIdName', () => { - const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseAttachmentIdName', () => { - const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseComment', async () => { - const fakePath = "/rendered/path/projectCaseComment"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseCommentPath', () => { - const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseCommentName', () => { - const result = client.matchProjectFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseCommentName', () => { - const result = client.matchCaseFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromProjectCaseCommentName', () => { - const result = client.matchCommentFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseEmailMessages', async () => { - const fakePath = "/rendered/path/projectCaseEmailMessages"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - email_message: "emailMessageValue", - }; - const client = new commentserviceModule.v2beta.CommentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseEmailMessagesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseEmailMessagesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseEmailMessagesPath', () => { - const result = client.projectCaseEmailMessagesPath("projectValue", "caseValue", "emailMessageValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseEmailMessagesName', () => { - const result = client.matchProjectFromProjectCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseEmailMessagesName', () => { - const result = client.matchCaseFromProjectCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEmailMessageFromProjectCaseEmailMessagesName', () => { - const result = client.matchEmailMessageFromProjectCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "emailMessageValue"); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-support/test/gapic_feed_service_v2beta.ts b/owl-bot-staging/google-cloud-support/test/gapic_feed_service_v2beta.ts deleted file mode 100644 index dbb55ffde01..00000000000 --- a/owl-bot-staging/google-cloud-support/test/gapic_feed_service_v2beta.ts +++ /dev/null @@ -1,861 +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 feedserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} 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 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('v2beta.FeedServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new feedserviceModule.v2beta.FeedServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new feedserviceModule.v2beta.FeedServiceClient(); - 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 = feedserviceModule.v2beta.FeedServiceClient.servicePath; - assert.strictEqual(servicePath, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = feedserviceModule.v2beta.FeedServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'cloudsupport.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new feedserviceModule.v2beta.FeedServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new feedserviceModule.v2beta.FeedServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 feedserviceModule.v2beta.FeedServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 feedserviceModule.v2beta.FeedServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'cloudsupport.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 feedserviceModule.v2beta.FeedServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = feedserviceModule.v2beta.FeedServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new feedserviceModule.v2beta.FeedServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new feedserviceModule.v2beta.FeedServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.feedServiceStub, undefined); - await client.initialize(); - assert(client.feedServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.feedServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.feedServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new feedserviceModule.v2beta.FeedServiceClient({ - 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 feedserviceModule.v2beta.FeedServiceClient({ - 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('showFeed', () => { - it('invokes showFeed without error', async () => { - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ShowFeedRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), - generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), - generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), - ]; - client.innerApiCalls.showFeed = stubSimpleCall(expectedResponse); - const [response] = await client.showFeed(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.showFeed as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.showFeed as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes showFeed without error using callback', async () => { - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ShowFeedRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), - generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), - generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), - ]; - client.innerApiCalls.showFeed = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.showFeed( - request, - (err?: Error|null, result?: protos.google.cloud.support.v2beta.IFeedItem[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.showFeed as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.showFeed as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes showFeed with error', async () => { - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ShowFeedRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.showFeed = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.showFeed(request), expectedError); - const actualRequest = (client.innerApiCalls.showFeed as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.showFeed as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes showFeedStream without error', async () => { - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ShowFeedRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), - generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), - generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), - ]; - client.descriptors.page.showFeed.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.showFeedStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2beta.FeedItem[] = []; - stream.on('data', (response: protos.google.cloud.support.v2beta.FeedItem) => { - 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.showFeed.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.showFeed, request)); - assert( - (client.descriptors.page.showFeed.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes showFeedStream with error', async () => { - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ShowFeedRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.showFeed.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.showFeedStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.support.v2beta.FeedItem[] = []; - stream.on('data', (response: protos.google.cloud.support.v2beta.FeedItem) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.showFeed.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.showFeed, request)); - assert( - (client.descriptors.page.showFeed.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with showFeed without error', async () => { - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ShowFeedRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), - generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), - generateSampleMessage(new protos.google.cloud.support.v2beta.FeedItem()), - ]; - client.descriptors.page.showFeed.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.support.v2beta.IFeedItem[] = []; - const iterable = client.showFeedAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.showFeed.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.showFeed.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with showFeed with error', async () => { - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.support.v2beta.ShowFeedRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.support.v2beta.ShowFeedRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.showFeed.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.showFeedAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.support.v2beta.IFeedItem[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.showFeed.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.showFeed.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('organizationCase', async () => { - const fakePath = "/rendered/path/organizationCase"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - }; - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCasePath', () => { - const result = client.organizationCasePath("organizationValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseName', () => { - const result = client.matchOrganizationFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseName', () => { - const result = client.matchCaseFromOrganizationCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseAttachmentId', async () => { - const fakePath = "/rendered/path/organizationCaseAttachmentId"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseAttachmentIdPath', () => { - const result = client.organizationCaseAttachmentIdPath("organizationValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchOrganizationFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromOrganizationCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseComment', async () => { - const fakePath = "/rendered/path/organizationCaseComment"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseCommentPath', () => { - const result = client.organizationCaseCommentPath("organizationValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseCommentName', () => { - const result = client.matchOrganizationFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseCommentName', () => { - const result = client.matchCaseFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromOrganizationCaseCommentName', () => { - const result = client.matchCommentFromOrganizationCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.organizationCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('organizationCaseEmailMessages', async () => { - const fakePath = "/rendered/path/organizationCaseEmailMessages"; - const expectedParameters = { - organization: "organizationValue", - case: "caseValue", - email_message: "emailMessageValue", - }; - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('organizationCaseEmailMessagesPath', () => { - const result = client.organizationCaseEmailMessagesPath("organizationValue", "caseValue", "emailMessageValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchOrganizationFromOrganizationCaseEmailMessagesName', () => { - const result = client.matchOrganizationFromOrganizationCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "organizationValue"); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromOrganizationCaseEmailMessagesName', () => { - const result = client.matchCaseFromOrganizationCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEmailMessageFromOrganizationCaseEmailMessagesName', () => { - const result = client.matchEmailMessageFromOrganizationCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "emailMessageValue"); - assert((client.pathTemplates.organizationCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCase', async () => { - const fakePath = "/rendered/path/projectCase"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - }; - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCasePath', () => { - const result = client.projectCasePath("projectValue", "caseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseName', () => { - const result = client.matchProjectFromProjectCaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseName', () => { - const result = client.matchCaseFromProjectCaseName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseAttachmentId', async () => { - const fakePath = "/rendered/path/projectCaseAttachmentId"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - attachment_id: "attachmentIdValue", - }; - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseAttachmentIdPath', () => { - const result = client.projectCaseAttachmentIdPath("projectValue", "caseValue", "attachmentIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseAttachmentIdName', () => { - const result = client.matchProjectFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseAttachmentIdName', () => { - const result = client.matchCaseFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { - const result = client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); - assert.strictEqual(result, "attachmentIdValue"); - assert((client.pathTemplates.projectCaseAttachmentIdPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseComment', async () => { - const fakePath = "/rendered/path/projectCaseComment"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - comment: "commentValue", - }; - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseCommentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseCommentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseCommentPath', () => { - const result = client.projectCaseCommentPath("projectValue", "caseValue", "commentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseCommentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseCommentName', () => { - const result = client.matchProjectFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseCommentName', () => { - const result = client.matchCaseFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCommentFromProjectCaseCommentName', () => { - const result = client.matchCommentFromProjectCaseCommentName(fakePath); - assert.strictEqual(result, "commentValue"); - assert((client.pathTemplates.projectCaseCommentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectCaseEmailMessages', async () => { - const fakePath = "/rendered/path/projectCaseEmailMessages"; - const expectedParameters = { - project: "projectValue", - case: "caseValue", - email_message: "emailMessageValue", - }; - const client = new feedserviceModule.v2beta.FeedServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectCaseEmailMessagesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectCaseEmailMessagesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectCaseEmailMessagesPath', () => { - const result = client.projectCaseEmailMessagesPath("projectValue", "caseValue", "emailMessageValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectCaseEmailMessagesName', () => { - const result = client.matchProjectFromProjectCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCaseFromProjectCaseEmailMessagesName', () => { - const result = client.matchCaseFromProjectCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "caseValue"); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEmailMessageFromProjectCaseEmailMessagesName', () => { - const result = client.matchEmailMessageFromProjectCaseEmailMessagesName(fakePath); - assert.strictEqual(result, "emailMessageValue"); - assert((client.pathTemplates.projectCaseEmailMessagesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-support/tsconfig.json b/owl-bot-staging/google-cloud-support/tsconfig.json deleted file mode 100644 index ca73e7bfc82..00000000000 --- a/owl-bot-staging/google-cloud-support/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-support/webpack.config.js b/owl-bot-staging/google-cloud-support/webpack.config.js deleted file mode 100644 index 1fab5f9e237..00000000000 --- a/owl-bot-staging/google-cloud-support/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: 'CaseAttachmentService', - filename: './case-attachment-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-support/protos/google/cloud/support/v2/actor.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/actor.proto index b214e08a2c1..3dfb5de103e 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2/actor.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/actor.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/attachment.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/attachment.proto index 02725e3730b..9039620b314 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2/attachment.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/attachment.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto index d7ee6559ecc..5c63b8dc101 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/case.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/case.proto index 63e65a4cd8a..b14160b4c90 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2/case.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/case.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/case_service.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/case_service.proto index abd77bf62bf..4030bc1cafe 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2/case_service.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/case_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/comment.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/comment.proto index 2729176a3f6..85c6f6076c8 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2/comment.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/comment.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto index d05d2ae763a..6321b52b620 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/escalation.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/escalation.proto index 5f5d68ca197..ffc79d9e11f 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2/escalation.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/escalation.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto b/packages/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto index 908b94ad5fb..6effd8a3acf 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2beta/actor.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto b/packages/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto index 1ea39feaa84..918d006edbd 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2beta/attachment.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto b/packages/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto index e488712eec1..acf53096443 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2beta/attachment_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2beta/case.proto b/packages/google-cloud-support/protos/google/cloud/support/v2beta/case.proto index b042e9d95e4..10a2cb6c8c9 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2beta/case.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2beta/case.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto b/packages/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto index cd9894d2b97..8863f275036 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2beta/case_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto b/packages/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto index 0bc668d095f..dd6b1ee2e0f 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2beta/comment.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto b/packages/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto index f0cd726cfb3..dff46126955 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2beta/comment_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2beta/content.proto b/packages/google-cloud-support/protos/google/cloud/support/v2beta/content.proto index bd7c184bcd9..29750d7c24f 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2beta/content.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2beta/content.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto b/packages/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto index f20350358d4..6321cf00645 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2beta/email_message.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto b/packages/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto index e3cd802232f..abec570edec 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2beta/escalation.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto b/packages/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto index 0540170772e..c275dbcc341 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2beta/feed_item.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto b/packages/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto index bcf447d31d4..02d36c19808 100644 --- a/packages/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto +++ b/packages/google-cloud-support/protos/google/cloud/support/v2beta/feed_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.