From e3cba0befec4b4599e1114983ddadb954a132bbd Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 12 Sep 2024 21:06:12 +0000 Subject: [PATCH] feat: If you're a domain administrator or a delegated administrator, you can now include the `useAdminAccess` parameter when you call the Chat API with your administrator privileges with the following methods to manage Chat spaces and memberships in your Workspace organization: - SearchSpaces - DeleteSpace - UpdateSpace - GetSpace - ListMemberships - DeleteMembership - CreateMembership - UpdateMembership - GetMembership Additionally, `last_active_time` and `membership_count` parameters are added to the `Space` resource. docs: A comment for field `filter` in message `.google.chat.v1.ListMembershipsRequest` is updated to support `!=` operator PiperOrigin-RevId: 673895888 Source-Link: https://github.com/googleapis/googleapis/commit/c5bc296a6d5e0b9344e2a2aef90cefb017ae29ad Source-Link: https://github.com/googleapis/googleapis-gen/commit/1ed1ebf58a6d432da9a23de6d9d9d058c21d9a44 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNoYXQvLk93bEJvdC55YW1sIiwiaCI6IjFlZDFlYmY1OGE2ZDQzMmRhOWEyM2RlNmQ5ZDlkMDU4YzIxZDlhNDQifQ== --- owl-bot-staging/google-chat/v1/.eslintignore | 7 + owl-bot-staging/google-chat/v1/.eslintrc.json | 3 + owl-bot-staging/google-chat/v1/.gitignore | 14 + owl-bot-staging/google-chat/v1/.jsdoc.js | 55 + owl-bot-staging/google-chat/v1/.mocharc.js | 33 + owl-bot-staging/google-chat/v1/.prettierrc.js | 22 + owl-bot-staging/google-chat/v1/README.md | 1 + owl-bot-staging/google-chat/v1/package.json | 58 + .../v1/protos/google/apps/card/v1/card.proto | 2000 + .../protos/google/chat/v1/action_status.proto | 39 + .../v1/protos/google/chat/v1/annotation.proto | 210 + .../v1/protos/google/chat/v1/attachment.proto | 132 + .../protos/google/chat/v1/chat_service.proto | 643 + .../google/chat/v1/contextual_addon.proto | 107 + .../google/chat/v1/deletion_metadata.proto | 57 + .../protos/google/chat/v1/event_payload.proto | 177 + .../v1/protos/google/chat/v1/group.proto | 38 + .../protos/google/chat/v1/history_state.proto | 42 + .../protos/google/chat/v1/matched_url.proto | 36 + .../v1/protos/google/chat/v1/membership.proto | 387 + .../v1/protos/google/chat/v1/message.proto | 677 + .../v1/protos/google/chat/v1/reaction.proto | 186 + .../protos/google/chat/v1/slash_command.proto | 34 + .../v1/protos/google/chat/v1/space.proto | 629 + .../protos/google/chat/v1/space_event.proto | 292 + .../google/chat/v1/space_read_state.proto | 113 + .../protos/google/chat/v1/space_setup.proto | 97 + .../google/chat/v1/thread_read_state.proto | 75 + .../v1/protos/google/chat/v1/user.proto | 84 + .../v1/protos/google/chat/v1/widgets.proto | 278 + .../google-chat/v1/protos/protos.d.ts | 24474 ++++++ .../google-chat/v1/protos/protos.js | 62444 ++++++++++++++++ .../google-chat/v1/protos/protos.json | 5961 ++ .../v1/chat_service.complete_import_space.js | 62 + .../v1/chat_service.create_membership.js | 96 + .../v1/chat_service.create_message.js | 93 + .../v1/chat_service.create_reaction.js | 67 + .../generated/v1/chat_service.create_space.js | 76 + .../v1/chat_service.delete_membership.js | 82 + .../v1/chat_service.delete_message.js | 75 + .../v1/chat_service.delete_reaction.js | 62 + .../generated/v1/chat_service.delete_space.js | 72 + .../v1/chat_service.find_direct_message.js | 72 + .../v1/chat_service.get_attachment.js | 62 + .../v1/chat_service.get_membership.js | 82 + .../generated/v1/chat_service.get_message.js | 66 + .../generated/v1/chat_service.get_space.js | 72 + .../v1/chat_service.get_space_event.js | 62 + .../v1/chat_service.get_space_read_state.js | 69 + .../v1/chat_service.get_thread_read_state.js | 70 + .../v1/chat_service.list_memberships.js | 143 + .../v1/chat_service.list_messages.js | 125 + .../v1/chat_service.list_reactions.js | 116 + .../v1/chat_service.list_space_events.js | 127 + .../generated/v1/chat_service.list_spaces.js | 91 + .../v1/chat_service.search_spaces.js | 163 + .../generated/v1/chat_service.set_up_space.js | 112 + .../v1/chat_service.update_membership.js | 80 + .../v1/chat_service.update_message.js | 82 + .../generated/v1/chat_service.update_space.js | 122 + .../chat_service.update_space_read_state.js | 83 + .../v1/chat_service.upload_attachment.js | 67 + .../v1/snippet_metadata_google.chat.v1.json | 1363 + owl-bot-staging/google-chat/v1/src/index.ts | 25 + .../v1/src/v1/chat_service_client.ts | 5416 ++ .../v1/src/v1/chat_service_client_config.json | 183 + .../v1/src/v1/chat_service_proto_list.json | 24 + .../google-chat/v1/src/v1/gapic_metadata.json | 337 + .../google-chat/v1/src/v1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../google-chat/v1/system-test/install.ts | 49 + .../v1/test/gapic_chat_service_v1.ts | 4399 ++ owl-bot-staging/google-chat/v1/tsconfig.json | 19 + .../google-chat/v1/webpack.config.js | 64 + 75 files changed, 113913 insertions(+) create mode 100644 owl-bot-staging/google-chat/v1/.eslintignore create mode 100644 owl-bot-staging/google-chat/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-chat/v1/.gitignore create mode 100644 owl-bot-staging/google-chat/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-chat/v1/.mocharc.js create mode 100644 owl-bot-staging/google-chat/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-chat/v1/README.md create mode 100644 owl-bot-staging/google-chat/v1/package.json create mode 100644 owl-bot-staging/google-chat/v1/protos/google/apps/card/v1/card.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/action_status.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/annotation.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/attachment.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/chat_service.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/contextual_addon.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/deletion_metadata.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/event_payload.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/group.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/history_state.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/matched_url.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/membership.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/message.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/reaction.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/slash_command.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/space.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/space_event.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/space_read_state.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/space_setup.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/thread_read_state.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/user.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/google/chat/v1/widgets.proto create mode 100644 owl-bot-staging/google-chat/v1/protos/protos.d.ts create mode 100644 owl-bot-staging/google-chat/v1/protos/protos.js create mode 100644 owl-bot-staging/google-chat/v1/protos/protos.json create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.complete_import_space.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_membership.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_message.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_reaction.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_space.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_membership.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_message.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_reaction.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_space.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.find_direct_message.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_attachment.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_membership.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_message.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_space.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_space_event.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_space_read_state.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_thread_read_state.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_memberships.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_messages.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_reactions.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_space_events.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_spaces.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.search_spaces.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.set_up_space.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_membership.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_message.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_space.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_space_read_state.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.upload_attachment.js create mode 100644 owl-bot-staging/google-chat/v1/samples/generated/v1/snippet_metadata_google.chat.v1.json create mode 100644 owl-bot-staging/google-chat/v1/src/index.ts create mode 100644 owl-bot-staging/google-chat/v1/src/v1/chat_service_client.ts create mode 100644 owl-bot-staging/google-chat/v1/src/v1/chat_service_client_config.json create mode 100644 owl-bot-staging/google-chat/v1/src/v1/chat_service_proto_list.json create mode 100644 owl-bot-staging/google-chat/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-chat/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-chat/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-chat/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-chat/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-chat/v1/test/gapic_chat_service_v1.ts create mode 100644 owl-bot-staging/google-chat/v1/tsconfig.json create mode 100644 owl-bot-staging/google-chat/v1/webpack.config.js diff --git a/owl-bot-staging/google-chat/v1/.eslintignore b/owl-bot-staging/google-chat/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-chat/v1/.eslintrc.json b/owl-bot-staging/google-chat/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-chat/v1/.gitignore b/owl-bot-staging/google-chat/v1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-chat/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-chat/v1/.jsdoc.js b/owl-bot-staging/google-chat/v1/.jsdoc.js new file mode 100644 index 00000000000..384a81ee7c2 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-apps/chat', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-chat/v1/.mocharc.js b/owl-bot-staging/google-chat/v1/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-chat/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-chat/v1/.prettierrc.js b/owl-bot-staging/google-chat/v1/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-chat/v1/README.md b/owl-bot-staging/google-chat/v1/README.md new file mode 100644 index 00000000000..a9e24528e51 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/README.md @@ -0,0 +1 @@ +Chat: Nodejs Client diff --git a/owl-bot-staging/google-chat/v1/package.json b/owl-bot-staging/google-chat/v1/package.json new file mode 100644 index 00000000000..a8334f57b91 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-apps/chat", + "version": "0.1.0", + "description": "Chat client for Node.js", + "repository": "googleapis/nodejs-chat", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google chat", + "chat", + "chat service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/apps/card/v1/card.proto b/owl-bot-staging/google-chat/v1/protos/google/apps/card/v1/card.proto new file mode 100644 index 00000000000..fbc5b3c49ba --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/apps/card/v1/card.proto @@ -0,0 +1,2000 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.apps.card.v1; + +import "google/type/color.proto"; + +option csharp_namespace = "Google.Apps.Card.V1"; +option go_package = "google.golang.org/genproto/googleapis/apps/card/v1;card"; +option java_multiple_files = true; +option java_outer_classname = "CardProto"; +option java_package = "com.google.apps.card.v1"; +option php_namespace = "Google\\Apps\\Card\\V1"; +option ruby_package = "Google::Apps::Card::V1"; + +// A card interface displayed in a Google Chat message or Google Workspace +// Add-on. +// +// Cards support a defined layout, interactive UI elements like buttons, and +// rich media like images. Use cards to present detailed information, +// gather information from users, and guide users to take a next step. +// +// [Card builder](https://addons.gsuite.google.com/uikit/builder) +// +// To learn how +// to build cards, see the following documentation: +// +// * For Google Chat apps, see [Design the components of a card or +// dialog](https://developers.google.com/workspace/chat/design-components-card-dialog). +// * For Google Workspace Add-ons, see [Card-based +// interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards). +// +// **Example: Card message for a Google Chat app** +// +// ![Example contact +// card](https://developers.google.com/workspace/chat/images/card_api_reference.png) +// +// To create the sample card message in Google Chat, use the following JSON: +// +// ``` +// { +// "cardsV2": [ +// { +// "cardId": "unique-card-id", +// "card": { +// "header": { +// "title": "Sasha", +// "subtitle": "Software Engineer", +// "imageUrl": +// "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", +// "imageType": "CIRCLE", +// "imageAltText": "Avatar for Sasha" +// }, +// "sections": [ +// { +// "header": "Contact Info", +// "collapsible": true, +// "uncollapsibleWidgetsCount": 1, +// "widgets": [ +// { +// "decoratedText": { +// "startIcon": { +// "knownIcon": "EMAIL" +// }, +// "text": "sasha@example.com" +// } +// }, +// { +// "decoratedText": { +// "startIcon": { +// "knownIcon": "PERSON" +// }, +// "text": "Online" +// } +// }, +// { +// "decoratedText": { +// "startIcon": { +// "knownIcon": "PHONE" +// }, +// "text": "+1 (555) 555-1234" +// } +// }, +// { +// "buttonList": { +// "buttons": [ +// { +// "text": "Share", +// "onClick": { +// "openLink": { +// "url": "https://example.com/share" +// } +// } +// }, +// { +// "text": "Edit", +// "onClick": { +// "action": { +// "function": "goToView", +// "parameters": [ +// { +// "key": "viewType", +// "value": "EDIT" +// } +// ] +// } +// } +// } +// ] +// } +// } +// ] +// } +// ] +// } +// } +// ] +// } +// ``` +message Card { + // Represents a card header. For an example in Google Chat apps, see [Add a + // header](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header). + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + message CardHeader { + // Required. The title of the card header. + // The header has a fixed height: if both a + // title and subtitle are specified, each takes up one line. If only the + // title is specified, it takes up both lines. + string title = 1; + + // The subtitle of the card header. If specified, appears on its own line + // below the `title`. + string subtitle = 2; + + // The shape used to crop the image. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + Widget.ImageType image_type = 3; + + // The HTTPS URL of the image in the card header. + string image_url = 4; + + // The alternative text of this image that's used for accessibility. + string image_alt_text = 5; + } + + // A section contains a collection of widgets that are rendered + // vertically in the order that they're specified. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + message Section { + // Text that appears at the top of a section. + // Supports simple HTML formatted text. For more information + // about formatting text, see + // [Formatting text in Google Chat + // apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) + // and + // [Formatting + // text in Google Workspace + // Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + string header = 1; + + // All the widgets in the section. + // Must contain at least one widget. + repeated Widget widgets = 2; + + // Indicates whether this section is collapsible. + // + // Collapsible sections hide some or all widgets, but users can expand the + // section to reveal the hidden widgets by clicking **Show more**. Users + // can hide the widgets again by clicking **Show less**. + // + // To determine which widgets are hidden, specify + // `uncollapsibleWidgetsCount`. + bool collapsible = 5; + + // The number of uncollapsible widgets which remain visible even when a + // section is collapsed. + // + // For example, when a section + // contains five widgets and the `uncollapsibleWidgetsCount` is set to `2`, + // the first two widgets are always shown and the last three are collapsed + // by default. The `uncollapsibleWidgetsCount` is taken into account only + // when `collapsible` is `true`. + int32 uncollapsible_widgets_count = 6; + } + + // The divider style of a card. Currently only used for dividers betweens card + // sections. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + enum DividerStyle { + // Don't use. Unspecified. + DIVIDER_STYLE_UNSPECIFIED = 0; + + // Default option. Render a solid divider between sections. + SOLID_DIVIDER = 1; + + // If set, no divider is rendered between sections. + NO_DIVIDER = 2; + } + + // A card action is the action associated with the card. For example, + // an invoice card might include actions such as delete invoice, email + // invoice, or open the invoice in a browser. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + message CardAction { + // The label that displays as the action menu item. + string action_label = 1; + + // The `onClick` action for this action item. + OnClick on_click = 2; + } + + // A persistent (sticky) footer that that appears at the bottom of the card. + // + // Setting `fixedFooter` without specifying a `primaryButton` or a + // `secondaryButton` causes an error. + // + // For Chat apps, you can use fixed footers in + // [dialogs](https://developers.google.com/workspace/chat/dialogs), but not + // [card + // messages](https://developers.google.com/workspace/chat/create-messages#create). + // For an example in Google Chat apps, see [Add a persistent + // footer](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_persistent_footer). + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + message CardFixedFooter { + // The primary button of the fixed footer. The button must be a text button + // with text and color set. + Button primary_button = 1; + + // The secondary button of the fixed footer. The button must be a text + // button with text and color set. + // If `secondaryButton` is set, you must also set `primaryButton`. + Button secondary_button = 2; + } + + // In Google Workspace Add-ons, + // determines how a card is displayed. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + enum DisplayStyle { + // Don't use. Unspecified. + DISPLAY_STYLE_UNSPECIFIED = 0; + + // The header of the card appears at the bottom of the + // sidebar, partially covering the current top card of the stack. Clicking + // the header pops the card into the card stack. If the card has no header, + // a generated header is used instead. + PEEK = 1; + + // Default value. The card is shown by replacing the view of the top card in + // the card stack. + REPLACE = 2; + } + + // The header of the card. A header usually contains a leading image and a + // title. Headers always appear at the top of a card. + CardHeader header = 1; + + // Contains a collection of widgets. Each section has its own, optional + // header. Sections are visually separated by a line divider. For an example + // in Google Chat apps, see [Define a section of a + // card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card). + repeated Section sections = 2; + + // The divider style between sections. + DividerStyle section_divider_style = 9; + + // The card's actions. Actions are added to the card's toolbar menu. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + // + // For example, the following JSON constructs a card action menu with + // `Settings` and `Send Feedback` options: + // + // ``` + // "card_actions": [ + // { + // "actionLabel": "Settings", + // "onClick": { + // "action": { + // "functionName": "goToView", + // "parameters": [ + // { + // "key": "viewType", + // "value": "SETTING" + // } + // ], + // "loadIndicator": "LoadIndicator.SPINNER" + // } + // } + // }, + // { + // "actionLabel": "Send Feedback", + // "onClick": { + // "openLink": { + // "url": "https://example.com/feedback" + // } + // } + // } + // ] + // ``` + repeated CardAction card_actions = 3; + + // Name of the card. Used as a card identifier in card navigation. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + string name = 4; + + // The fixed footer shown at the bottom of this card. + // + // Setting `fixedFooter` without specifying a `primaryButton` or a + // `secondaryButton` causes an error. For Chat apps, you can use fixed footers + // in + // [dialogs](https://developers.google.com/workspace/chat/dialogs), but not + // [card + // messages](https://developers.google.com/workspace/chat/create-messages#create). + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + CardFixedFooter fixed_footer = 5; + + // In Google Workspace Add-ons, sets the display properties of the + // `peekCardHeader`. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + DisplayStyle display_style = 6; + + // When displaying contextual content, the peek card header acts as a + // placeholder so that the user can navigate forward between the homepage + // cards and the contextual cards. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + CardHeader peek_card_header = 7; +} + +// Each card is made up of widgets. +// +// A widget is a composite object that can represent one of text, images, +// buttons, and other object types. +message Widget { + // The shape used to crop the image. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + enum ImageType { + // Default value. Applies a square mask to the image. For example, a 4x3 + // image becomes 3x3. + SQUARE = 0; + + // Applies a circular mask to the image. For example, a 4x3 image becomes a + // circle with a diameter of 3. + CIRCLE = 1; + } + + // Specifies whether widgets align to the left, right, or center of a column. + // + // [Google Chat apps](https://developers.google.com/workspace/chat): + enum HorizontalAlignment { + // Don't use. Unspecified. + HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0; + + // Default value. Aligns widgets to the start position of the column. For + // left-to-right layouts, aligns to the left. For right-to-left layouts, + // aligns to the right. + START = 1; + + // Aligns widgets to the center of the column. + CENTER = 2; + + // Aligns widgets to the end position of the column. For left-to-right + // layouts, aligns widgets to the right. For right-to-left layouts, aligns + // widgets to the left. + END = 3; + } + + // A widget can only have one of the following items. You can use multiple + // widget fields to display more items. + oneof data { + // Displays a text paragraph. Supports simple HTML formatted text. For more + // information about formatting text, see + // [Formatting text in Google Chat + // apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) + // and + // [Formatting + // text in Google Workspace + // Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + // + // For example, the following JSON creates a bolded text: + // ``` + // "textParagraph": { + // "text": " bold text" + // } + // ``` + TextParagraph text_paragraph = 1; + + // Displays an image. + // + // For example, the following JSON creates an image with alternative text: + // ``` + // "image": { + // "imageUrl": + // "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", + // "altText": "Chat app avatar" + // } + // ``` + Image image = 2; + + // Displays a decorated text item. + // + // For example, the following JSON creates a decorated text widget showing + // email address: + // + // ``` + // "decoratedText": { + // "icon": { + // "knownIcon": "EMAIL" + // }, + // "topLabel": "Email Address", + // "text": "sasha@example.com", + // "bottomLabel": "This is a new Email address!", + // "switchControl": { + // "name": "has_send_welcome_email_to_sasha", + // "selected": false, + // "controlType": "CHECKBOX" + // } + // } + // ``` + DecoratedText decorated_text = 3; + + // A list of buttons. + // + // For example, the following JSON creates two buttons. The first + // is a blue text button and the second is an image button that opens a + // link: + // ``` + // "buttonList": { + // "buttons": [ + // { + // "text": "Edit", + // "color": { + // "red": 0, + // "green": 0, + // "blue": 1, + // "alpha": 1 + // }, + // "disabled": true, + // }, + // { + // "icon": { + // "knownIcon": "INVITE", + // "altText": "check calendar" + // }, + // "onClick": { + // "openLink": { + // "url": "https://example.com/calendar" + // } + // } + // } + // ] + // } + // ``` + ButtonList button_list = 4; + + // Displays a text box that users can type into. + // + // For example, the following JSON creates a text input for an email + // address: + // + // ``` + // "textInput": { + // "name": "mailing_address", + // "label": "Mailing Address" + // } + // ``` + // + // As another example, the following JSON creates a text input for a + // programming language with static suggestions: + // ``` + // "textInput": { + // "name": "preferred_programing_language", + // "label": "Preferred Language", + // "initialSuggestions": { + // "items": [ + // { + // "text": "C++" + // }, + // { + // "text": "Java" + // }, + // { + // "text": "JavaScript" + // }, + // { + // "text": "Python" + // } + // ] + // } + // } + // ``` + TextInput text_input = 5; + + // Displays a selection control that lets users select items. Selection + // controls can be checkboxes, radio buttons, switches, or dropdown menus. + // + // For example, the following JSON creates a dropdown menu that lets users + // choose a size: + // + // ``` + // "selectionInput": { + // "name": "size", + // "label": "Size" + // "type": "DROPDOWN", + // "items": [ + // { + // "text": "S", + // "value": "small", + // "selected": false + // }, + // { + // "text": "M", + // "value": "medium", + // "selected": true + // }, + // { + // "text": "L", + // "value": "large", + // "selected": false + // }, + // { + // "text": "XL", + // "value": "extra_large", + // "selected": false + // } + // ] + // } + // ``` + SelectionInput selection_input = 6; + + // Displays a widget that lets users input a date, time, or date and time. + // + // For example, the following JSON creates a date time picker to schedule an + // appointment: + // + // + // ``` + // "dateTimePicker": { + // "name": "appointment_time", + // "label": "Book your appointment at:", + // "type": "DATE_AND_TIME", + // "valueMsEpoch": "796435200000" + // } + // ``` + DateTimePicker date_time_picker = 7; + + // Displays a horizontal line divider between widgets. + // + // For example, the following JSON creates a divider: + // ``` + // "divider": { + // } + // ``` + Divider divider = 9; + + // Displays a grid with a collection of items. + // + // A grid supports any number of columns and items. The number of rows is + // determined by the upper bounds of the number items divided by the number + // of columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 + // items and 2 columns has 6 rows. + // + // [Google Workspace Add-ons and + // Chat apps](https://developers.google.com/workspace/extend): + // + // For example, the following JSON creates a 2 column grid with a single + // item: + // + // ``` + // "grid": { + // "title": "A fine collection of items", + // "columnCount": 2, + // "borderStyle": { + // "type": "STROKE", + // "cornerRadius": 4 + // }, + // "items": [ + // { + // "image": { + // "imageUri": "https://www.example.com/image.png", + // "cropStyle": { + // "type": "SQUARE" + // }, + // "borderStyle": { + // "type": "STROKE" + // } + // }, + // "title": "An item", + // "textAlignment": "CENTER" + // } + // ], + // "onClick": { + // "openLink": { + // "url": "https://www.example.com" + // } + // } + // } + // ``` + Grid grid = 10; + + // Displays up to 2 columns. + // + // To include more than 2 columns, or to use rows, use the `Grid` widget. + // + // For example, the following JSON creates 2 columns that each contain + // text paragraphs: + // + // ``` + // "columns": { + // "columnItems": [ + // { + // "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", + // "horizontalAlignment": "CENTER", + // "verticalAlignment": "CENTER", + // "widgets": [ + // { + // "textParagraph": { + // "text": "First column text paragraph" + // } + // } + // ] + // }, + // { + // "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", + // "horizontalAlignment": "CENTER", + // "verticalAlignment": "CENTER", + // "widgets": [ + // { + // "textParagraph": { + // "text": "Second column text paragraph" + // } + // } + // ] + // } + // ] + // } + // ``` + Columns columns = 11; + } + + // Specifies whether widgets align to the left, right, or center of a column. + HorizontalAlignment horizontal_alignment = 8; +} + +// A paragraph of text that supports formatting. For an example in +// Google Chat apps, see [Add a paragraph of formatted +// text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_a_paragraph_of_formatted_text). +// For more information +// about formatting text, see +// [Formatting text in Google Chat +// apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) +// and +// [Formatting +// text in Google Workspace +// Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). +// +// [Google Workspace Add-ons and +// Chat apps](https://developers.google.com/workspace/extend): +message TextParagraph { + // The text that's shown in the widget. + string text = 1; +} + +// An image that is specified by a URL and can have an `onClick` action. For an +// example, see [Add an +// image](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_image). +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +message Image { + // The HTTPS URL that hosts the image. + // + // For example: + // + // ``` + // https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png + // ``` + string image_url = 1; + + // When a user clicks the image, the click triggers this action. + OnClick on_click = 2; + + // The alternative text of this image that's used for accessibility. + string alt_text = 3; +} + +// Displays a divider between widgets as a horizontal line. For an example in +// Google Chat apps, see +// [Add a horizontal divider between +// widgets](https://developers.google.com/workspace/chat/format-structure-card-dialog#add_a_horizontal_divider_between_widgets). +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +// +// For example, the following JSON creates a divider: +// +// ``` +// "divider": {} +// ``` +message Divider {} + +// A widget that displays text with optional decorations such as a label above +// or below the text, an icon in front of the text, a selection widget, or a +// button after the text. For an example in +// Google Chat apps, see [Display text with decorative +// text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#display_text_with_decorative_elements). +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +message DecoratedText { + // Either a toggle-style switch or a checkbox inside a `decoratedText` widget. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + // + // Only supported in the `decoratedText` widget. + message SwitchControl { + // How the switch appears in the user interface. + // + // [Google Workspace Add-ons + // and Chat apps](https://developers.google.com/workspace/extend): + enum ControlType { + // A toggle-style switch. + SWITCH = 0; + + // Deprecated in favor of `CHECK_BOX`. + CHECKBOX = 1; + + // A checkbox. + CHECK_BOX = 2; + } + + // The name by which the switch widget is identified in a form input event. + // + // For details about working with form inputs, see [Receive form + // data](https://developers.google.com/workspace/chat/read-form-data). + string name = 1; + + // The value entered by a user, returned as part of a form input event. + // + // For details about working with form inputs, see [Receive form + // data](https://developers.google.com/workspace/chat/read-form-data). + string value = 2; + + // When `true`, the switch is selected. + bool selected = 3; + + // The action to perform when the switch state is changed, such as what + // function to run. + Action on_change_action = 4; + + // How the switch appears in the user interface. + // + // [Google Workspace Add-ons + // and Chat apps](https://developers.google.com/workspace/extend): + ControlType control_type = 5; + } + + // Deprecated in favor of `startIcon`. + Icon icon = 1 [deprecated = true]; + + // The icon displayed in front of the text. + Icon start_icon = 12; + + // The text that appears above `text`. Always truncates. + string top_label = 3; + + // Required. The primary text. + // + // Supports simple formatting. For more information + // about formatting text, see + // [Formatting text in Google Chat + // apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) + // and + // [Formatting + // text in Google Workspace + // Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + string text = 4; + + // The wrap text setting. If `true`, the text wraps and displays on + // multiple lines. Otherwise, the text is truncated. + // + // Only applies to `text`, not `topLabel` and `bottomLabel`. + bool wrap_text = 5; + + // The text that appears below `text`. Always wraps. + string bottom_label = 6; + + // This action is triggered when users click `topLabel` or `bottomLabel`. + OnClick on_click = 7; + + // A button, switch, checkbox, or image that appears to the right-hand side + // of text in the `decoratedText` widget. + oneof control { + // A button that a user can click to trigger an action. + Button button = 8; + + // A switch widget that a user can click to change its state and trigger an + // action. + SwitchControl switch_control = 9; + + // An icon displayed after the text. + // + // Supports + // [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) + // and + // [custom](https://developers.google.com/workspace/chat/format-messages#customicons) + // icons. + Icon end_icon = 11; + } +} + +// A field in which users can enter text. Supports suggestions and on-change +// actions. For an example in Google Chat apps, see [Add a field in which a user +// can enter +// text](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_field_in_which_a_user_can_enter_text). +// +// Chat apps receive and can process the value of entered text during form input +// events. For details about working with form inputs, see [Receive form +// data](https://developers.google.com/workspace/chat/read-form-data). +// +// When you need to collect undefined or abstract data from users, +// use a text input. To collect defined or enumerated data from users, use the +// [SelectionInput][google.apps.card.v1.SelectionInput] widget. +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +message TextInput { + // How a text input field appears in the user interface. For example, + // whether it's a single line input field, or a multi-line input. If + // `initialSuggestions` is specified, `type` is always `SINGLE_LINE`, + // even if it's set to `MULTIPLE_LINE`. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + enum Type { + // The text input field has a fixed height of one line. + SINGLE_LINE = 0; + + // The text input field has a fixed height of multiple lines. + MULTIPLE_LINE = 1; + } + + // The name by which the text input is identified in a form input event. + // + // For details about working with form inputs, see [Receive form + // data](https://developers.google.com/workspace/chat/read-form-data). + string name = 1; + + // The text that appears above the text input field in the user interface. + // + // Specify text that helps the user enter the information your app needs. + // For example, if you are asking someone's name, but specifically need their + // surname, write `surname` instead of `name`. + // + // Required if `hintText` is unspecified. Otherwise, optional. + string label = 2; + + // Text that appears below the text input field meant to assist users by + // prompting them to enter a certain value. This text is always visible. + // + // Required if `label` is unspecified. Otherwise, optional. + string hint_text = 3; + + // The value entered by a user, returned as part of a form input event. + // + // For details about working with form inputs, see [Receive form + // data](https://developers.google.com/workspace/chat/read-form-data). + string value = 4; + + // How a text input field appears in the user interface. + // For example, whether the field is single or multi-line. + Type type = 5; + + // What to do when a change occurs in the text input field. For example, a + // user adding to the field or deleting text. + // + // Examples of actions to take include running a custom function or opening + // a [dialog](https://developers.google.com/workspace/chat/dialogs) + // in Google Chat. + Action on_change_action = 6; + + // Suggested values that users can enter. These values appear when users click + // inside the text input field. As users type, the suggested values + // dynamically filter to match what the users have typed. + // + // For example, a text input field for programming language might suggest + // Java, JavaScript, Python, and C++. When users start typing `Jav`, the list + // of suggestions filters to show just `Java` and `JavaScript`. + // + // Suggested values help guide users to enter values that your app can make + // sense of. When referring to JavaScript, some users might enter `javascript` + // and others `java script`. Suggesting `JavaScript` can standardize how users + // interact with your app. + // + // When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set + // to `MULTIPLE_LINE`. + // + // [Google Workspace + // Add-ons and Chat apps](https://developers.google.com/workspace/extend): + Suggestions initial_suggestions = 7; + + // Optional. Specify what action to take when the text input field provides + // suggestions to users who interact with it. + // + // If unspecified, the suggestions are set by `initialSuggestions` and + // are processed by the client. + // + // If specified, the app takes the action specified here, such as running + // a custom function. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + Action auto_complete_action = 8; + + // Text that appears in the text input field when the field is empty. + // Use this text to prompt users to enter a value. For example, `Enter a + // number from 0 to 100`. + // + // [Google Chat apps](https://developers.google.com/workspace/chat): + string placeholder_text = 12; +} + +// Suggested values that users can enter. These values appear when users click +// inside the text input field. As users type, the suggested values +// dynamically filter to match what the users have typed. +// +// For example, a text input field for programming language might suggest +// Java, JavaScript, Python, and C++. When users start typing `Jav`, the list +// of suggestions filters to show `Java` and `JavaScript`. +// +// Suggested values help guide users to enter values that your app can make +// sense of. When referring to JavaScript, some users might enter `javascript` +// and others `java script`. Suggesting `JavaScript` can standardize how users +// interact with your app. +// +// When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set +// to `MULTIPLE_LINE`. +// +// [Google Workspace +// Add-ons and Chat apps](https://developers.google.com/workspace/extend): +message Suggestions { + // One suggested value that users can enter in a text input field. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + message SuggestionItem { + oneof content { + // The value of a suggested input to a text input field. This is + // equivalent to what users enter themselves. + string text = 1; + } + } + + // A list of suggestions used for autocomplete recommendations in text input + // fields. + repeated SuggestionItem items = 1; +} + +// A list of buttons layed out horizontally. For an example in +// Google Chat apps, see +// [Add a +// button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +message ButtonList { + // An array of buttons. + repeated Button buttons = 1; +} + +// A widget that creates one or more UI items that users can select. +// For example, a dropdown menu or checkboxes. You can use this widget to +// collect data that can be predicted or enumerated. For an example in Google +// Chat apps, see [Add selectable UI +// elements](/workspace/chat/design-interactive-card-dialog#add_selectable_ui_elements). +// +// Chat apps can process the value of items that users select or input. For +// details about working with form inputs, see [Receive form +// data](https://developers.google.com/workspace/chat/read-form-data). +// +// To collect undefined or abstract data from users, use +// the [TextInput][google.apps.card.v1.TextInput] widget. +// +// [Google Workspace Add-ons +// and Chat apps](https://developers.google.com/workspace/extend): +message SelectionInput { + // The format for the items that users can select. Different options support + // different types of interactions. For example, users can select multiple + // checkboxes, but can only select one item from a dropdown menu. + // + // Each selection input supports one type of selection. Mixing checkboxes + // and switches, for example, isn't supported. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + enum SelectionType { + // A set of checkboxes. Users can select one or more checkboxes. + CHECK_BOX = 0; + + // A set of radio buttons. Users can select one radio button. + RADIO_BUTTON = 1; + + // A set of switches. Users can turn on one or more switches. + SWITCH = 2; + + // A dropdown menu. Users can select one item from the menu. + DROPDOWN = 3; + + // A multiselect menu for static or dynamic data. From the menu bar, + // users select one or more items. Users can also input values to populate + // dynamic data. For example, users can start typing the name of a Google + // Chat space and the widget autosuggests the space. + // + // To populate items for a multiselect menu, you can use one of the + // following types of data sources: + // + // * Static data: Items are specified as `SelectionItem` objects in the + // widget. Up to 100 items. + // * Google Workspace data: Items are populated using data from Google + // Workspace, such as Google Workspace users or Google Chat spaces. + // * External data: Items are populated from an external data + // source outside of Google Workspace. + // + // For examples of how to implement multiselect menus, see + // [Add a multiselect + // menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu). + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + // Multiselect for Google Workspace Add-ons are in + // Developer Preview. + MULTI_SELECT = 4; + } + + // An item that users can select in a selection input, such as a checkbox + // or switch. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + message SelectionItem { + // The text that identifies or describes the item to users. + string text = 1; + + // The value associated with this item. The client should use this as a form + // input value. + // + // For details about working with form inputs, see [Receive form + // data](https://developers.google.com/workspace/chat/read-form-data). + string value = 2; + + // Whether the item is selected by default. If the selection input only + // accepts one value (such as for radio buttons or a dropdown menu), only + // set this field for one item. + bool selected = 3; + + // For multiselect menus, the URL for the icon displayed next to + // the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS` + // URL. For example, + // `https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png`. + string start_icon_uri = 4; + + // For multiselect menus, a text description or label that's + // displayed below the item's `text` field. + string bottom_text = 5; + } + + // For a + // [`SelectionInput`][google.apps.card.v1.SelectionInput] widget that uses a + // multiselect menu, a data source from Google Workspace. Used to populate + // items in a multiselect menu. + // + // [Google Chat apps](https://developers.google.com/workspace/chat): + message PlatformDataSource { + // A data source shared by all [Google Workspace + // applications] + // (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp). + // + // [Google Chat apps](https://developers.google.com/workspace/chat): + enum CommonDataSource { + // Default value. Don't use. + UNKNOWN = 0; + + // Google Workspace users. The user can only view and select users from + // their Google Workspace organization. + USER = 1; + } + + // The data source. + oneof data_source { + // A data source shared by all Google Workspace applications, such as + // users in a Google Workspace organization. + CommonDataSource common_data_source = 1; + } + } + + // The name that identifies the selection input in a form input event. + // + // For details about working with form inputs, see [Receive form + // data](https://developers.google.com/workspace/chat/read-form-data). + string name = 1; + + // The text that appears above the selection input field in the user + // interface. + // + // Specify text that helps the user enter the information your app needs. + // For example, if users are selecting the urgency of a work ticket from a + // drop-down menu, the label might be "Urgency" or "Select urgency". + string label = 2; + + // The type of items that are displayed to users in a `SelectionInput` widget. + // Selection types support different types of interactions. For example, users + // can select one or more checkboxes, but they can only select one value from + // a dropdown menu. + SelectionType type = 3; + + // An array of selectable items. For example, an array of radio buttons or + // checkboxes. Supports up to 100 items. + repeated SelectionItem items = 4; + + // If specified, the form is submitted when the selection changes. If not + // specified, you must specify a separate button that submits the form. + // + // For details about working with form inputs, see [Receive form + // data](https://developers.google.com/workspace/chat/read-form-data). + Action on_change_action = 5; + + // For multiselect menus, the maximum number of items that a user can select. + // Minimum value is 1 item. If unspecified, defaults to 3 items. + int32 multi_select_max_selected_items = 6; + + // For multiselect menus, the number of text characters that a user inputs + // before the app queries autocomplete and displays suggested items + // in the menu. + // + // If unspecified, defaults to 0 characters for static data sources and 3 + // characters for external data sources. + int32 multi_select_min_query_length = 7; + + // For a multiselect menu, the data source that populates + // selection items. + // + // [Google Chat apps](https://developers.google.com/workspace/chat): + oneof multi_select_data_source { + // An external data source, such as a relational data base. + Action external_data_source = 8; + + // A data source from Google Workspace. + PlatformDataSource platform_data_source = 9; + } +} + +// Lets users input a date, a time, or both a date and a time. For an example in +// Google Chat apps, see [Let a user pick a date and +// time](https://developers.google.com/workspace/chat/design-interactive-card-dialog#let_a_user_pick_a_date_and_time). +// +// Users can input text or use the picker to select dates and times. If users +// input an invalid date or time, the picker shows an error that prompts users +// to input the information correctly. +// +// [Google Workspace +// Add-ons and Chat apps](https://developers.google.com/workspace/extend): +message DateTimePicker { + // The format for the date and time in the `DateTimePicker` widget. + // Determines whether users can input a date, a time, or both a date and time. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + enum DateTimePickerType { + // Users input a date and time. + DATE_AND_TIME = 0; + + // Users input a date. + DATE_ONLY = 1; + + // Users input a time. + TIME_ONLY = 2; + } + + // The name by which the `DateTimePicker` is identified in a form input event. + // + // For details about working with form inputs, see [Receive form + // data](https://developers.google.com/workspace/chat/read-form-data). + string name = 1; + + // The text that prompts users to input a date, a time, or a date and time. + // For example, if users are scheduling an appointment, use a label such as + // `Appointment date` or `Appointment date and time`. + string label = 2; + + // Whether the widget supports inputting a date, a time, or the date and time. + DateTimePickerType type = 3; + + // The default value displayed in the widget, in milliseconds since [Unix + // epoch time](https://en.wikipedia.org/wiki/Unix_time). + // + // Specify the value based on the type of picker (`DateTimePickerType`): + // + // * `DATE_AND_TIME`: a calendar date and time in UTC. For example, to + // represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`. + // * `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent + // January 1, 2023, use `1672531200000`. + // * `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use + // `43200000` (or `12 * 60 * 60 * 1000`). + int64 value_ms_epoch = 4; + + // The number representing the time zone offset from UTC, in minutes. + // If set, the `value_ms_epoch` is displayed in the specified time zone. + // If unset, the value defaults to the user's time zone setting. + int32 timezone_offset_date = 5; + + // Triggered when the user clicks **Save** or **Clear** from the + // `DateTimePicker` interface. + Action on_change_action = 6; +} + +// A text, icon, or text and icon button that users can click. For an example in +// Google Chat apps, see +// [Add a +// button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). +// +// To make an image a clickable button, specify an +// [`Image`][google.apps.card.v1.Image] (not an +// [`ImageComponent`][google.apps.card.v1.ImageComponent]) and set an +// `onClick` action. +// +// [Google Workspace +// Add-ons and Chat apps](https://developers.google.com/workspace/extend): +message Button { + // The text displayed inside the button. + string text = 1; + + // The icon image. If both `icon` and `text` are set, then the icon appears + // before the text. + Icon icon = 2; + + // If set, the button is filled with a solid background color and the font + // color changes to maintain contrast with the background color. For example, + // setting a blue background likely results in white text. + // + // If unset, the image background is white and the font color is blue. + // + // For red, green, and blue, the value of each field is a `float` number that + // you can express in either of two ways: as a number between 0 and 255 + // divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents + // the absence of a color and 1 or 255/255 represent the full presence of that + // color on the RGB scale. + // + // Optionally set `alpha`, which sets a level of transparency using this + // equation: + // + // ``` + // pixel color = alpha * (this color) + (1.0 - alpha) * (background color) + // ``` + // + // For `alpha`, a value of `1` corresponds with a solid color, and a value of + // `0` corresponds with a completely transparent color. + // + // For example, the following color represents a half transparent red: + // + // ``` + // "color": { + // "red": 1, + // "green": 0, + // "blue": 0, + // "alpha": 0.5 + // } + // ``` + google.type.Color color = 3; + + // Required. The action to perform when a user clicks the button, such as + // opening a hyperlink or running a custom function. + OnClick on_click = 4; + + // If `true`, the button is displayed in an inactive state and doesn't respond + // to user actions. + bool disabled = 5; + + // The alternative text that's used for accessibility. + // + // Set descriptive text that lets users know what the button does. For + // example, if a button opens a hyperlink, you might write: "Opens a new + // browser tab and navigates to the Google Chat developer documentation at + // https://developers.google.com/workspace/chat". + string alt_text = 6; +} + +// An icon displayed in a widget on a card. For an example in Google Chat apps, +// see [Add an +// icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon). +// +// Supports +// [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) +// and +// [custom](https://developers.google.com/workspace/chat/format-messages#customicons) +// icons. +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +message Icon { + // The icon displayed in the widget on the card. + oneof icons { + // Display one of the built-in icons provided by Google Workspace. + // + // For example, to display an airplane icon, specify `AIRPLANE`. + // For a bus, specify `BUS`. + // + // For a full list of supported icons, see [built-in + // icons](https://developers.google.com/workspace/chat/format-messages#builtinicons). + string known_icon = 1; + + // Display a custom icon hosted at an HTTPS URL. + // + // For example: + // + // ``` + // "iconUrl": + // "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png" + // ``` + // + // Supported file types include `.png` and `.jpg`. + string icon_url = 2; + + // Display one of the [Google Material + // Icons](https://fonts.google.com/icons). + // + // For example, to display a [checkbox + // icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048), + // use + // ``` + // "material_icon": { + // "name": "check_box" + // } + // ``` + // + // [Google Chat apps](https://developers.google.com/workspace/chat): + MaterialIcon material_icon = 5; + } + + // Optional. A description of the icon used for accessibility. + // If unspecified, the default value `Button` is provided. As a best practice, + // you should set a helpful description for what the icon displays, and if + // applicable, what it does. For example, `A user's account portrait`, or + // `Opens a new browser tab and navigates to the Google Chat developer + // documentation at https://developers.google.com/workspace/chat`. + // + // If the icon is set in a [`Button`][google.apps.card.v1.Button], the + // `altText` appears as helper text when the user hovers over the button. + // However, if the button also sets `text`, the icon's `altText` is ignored. + string alt_text = 3; + + // The crop style applied to the image. In some cases, applying a + // `CIRCLE` crop causes the image to be drawn larger than a built-in + // icon. + Widget.ImageType image_type = 4; +} + +// A [Google Material Icon](https://fonts.google.com/icons), which includes over +// 2500+ options. +// +// For example, to display a [checkbox +// icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048) +// with customized weight and grade, write the following: +// +// ``` +// { +// "name": "check_box", +// "fill": true, +// "weight": 300, +// "grade": -25 +// } +// ``` +// +// [Google Chat apps](https://developers.google.com/workspace/chat): +message MaterialIcon { + // The icon name defined in the [Google Material + // Icon](https://fonts.google.com/icons), for example, `check_box`. Any + // invalid names are abandoned and replaced with empty string and + // results in the icon failing to render. + string name = 1; + + // Whether the icon renders as filled. Default value is false. + // + // To preview different icon settings, go to + // [Google Font Icons](https://fonts.google.com/icons) and adjust the + // settings under **Customize**. + bool fill = 2; + + // The stroke weight of the icon. Choose from {100, 200, 300, 400, + // 500, 600, 700}. If absent, default value is 400. If any other value is + // specified, the default value is used. + // + // To preview different icon settings, go to + // [Google Font Icons](https://fonts.google.com/icons) and adjust the + // settings under **Customize**. + int32 weight = 3; + + // Weight and grade affect a symbol’s thickness. Adjustments to grade are more + // granular than adjustments to weight and have a small impact on the size of + // the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If + // any other value is specified, the default value is used. + // + // To preview different icon settings, go to + // [Google Font Icons](https://fonts.google.com/icons) and adjust the + // settings under **Customize**. + int32 grade = 4; +} + +// Represents the crop style applied to an image. +// +// [Google Workspace Add-ons and +// Chat apps](https://developers.google.com/workspace/extend): +// +// For example, here's how to apply a 16:9 aspect ratio: +// +// ``` +// cropStyle { +// "type": "RECTANGLE_CUSTOM", +// "aspectRatio": 16/9 +// } +// ``` +message ImageCropStyle { + // Represents the crop style applied to an image. + // + // [Google Workspace Add-ons + // and Chat apps](https://developers.google.com/workspace/extend): + enum ImageCropType { + // Don't use. Unspecified. + IMAGE_CROP_TYPE_UNSPECIFIED = 0; + + // Default value. Applies a square crop. + SQUARE = 1; + + // Applies a circular crop. + CIRCLE = 2; + + // Applies a rectangular crop with a custom aspect ratio. Set the custom + // aspect ratio with `aspectRatio`. + RECTANGLE_CUSTOM = 3; + + // Applies a rectangular crop with a 4:3 aspect ratio. + RECTANGLE_4_3 = 4; + } + + // The crop type. + ImageCropType type = 1; + + // The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`. + // + // For example, here's how to apply a 16:9 aspect ratio: + // + // ``` + // cropStyle { + // "type": "RECTANGLE_CUSTOM", + // "aspectRatio": 16/9 + // } + // ``` + double aspect_ratio = 2; +} + +// The style options for the border of a card or widget, including the border +// type and color. +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +message BorderStyle { + // Represents the border types applied to widgets. + // + // [Google Workspace Add-ons + // and Chat apps](https://developers.google.com/workspace/extend): + enum BorderType { + // Don't use. Unspecified. + BORDER_TYPE_UNSPECIFIED = 0; + + // Default value. No border. + NO_BORDER = 1; + + // Outline. + STROKE = 2; + } + + // The border type. + BorderType type = 1; + + // The colors to use when the type is `BORDER_TYPE_STROKE`. + google.type.Color stroke_color = 2; + + // The corner radius for the border. + int32 corner_radius = 3; +} + +// Represents an image. +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +message ImageComponent { + // The image URL. + string image_uri = 1; + + // The accessibility label for the image. + string alt_text = 2; + + // The crop style to apply to the image. + ImageCropStyle crop_style = 3; + + // The border style to apply to the image. + BorderStyle border_style = 4; +} + +// Displays a grid with a collection of items. Items can only include text or +// images. For responsive columns, or to include more than text or images, use +// [`Columns`][google.apps.card.v1.Columns]. For an example in Google Chat apps, +// see [Display a Grid with a collection of +// items](https://developers.google.com/workspace/chat/format-structure-card-dialog#display_a_grid_with_a_collection_of_items). +// +// A grid supports any number of columns and items. The number of rows is +// determined by items divided by columns. A grid with +// 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns +// has 6 rows. +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +// +// For example, the following JSON creates a 2 column grid with a single +// item: +// +// ``` +// "grid": { +// "title": "A fine collection of items", +// "columnCount": 2, +// "borderStyle": { +// "type": "STROKE", +// "cornerRadius": 4 +// }, +// "items": [ +// { +// "image": { +// "imageUri": "https://www.example.com/image.png", +// "cropStyle": { +// "type": "SQUARE" +// }, +// "borderStyle": { +// "type": "STROKE" +// } +// }, +// "title": "An item", +// "textAlignment": "CENTER" +// } +// ], +// "onClick": { +// "openLink": { +// "url": "https://www.example.com" +// } +// } +// } +// ``` +message Grid { + // Represents an item in a grid layout. Items can contain text, an image, or + // both text and an image. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + message GridItem { + // Represents the various layout options available for a grid item. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + enum GridItemLayout { + // Don't use. Unspecified. + GRID_ITEM_LAYOUT_UNSPECIFIED = 0; + + // The title and subtitle are shown below the grid item's image. + TEXT_BELOW = 1; + + // The title and subtitle are shown above the grid item's image. + TEXT_ABOVE = 2; + } + + // A user-specified identifier for this grid item. This identifier is + // returned in the parent grid's `onClick` callback parameters. + string id = 1; + + // The image that displays in the grid item. + ImageComponent image = 2; + + // The grid item's title. + string title = 3; + + // The grid item's subtitle. + string subtitle = 4; + + // The layout to use for the grid item. + GridItemLayout layout = 9; + } + + // The text that displays in the grid header. + string title = 1; + + // The items to display in the grid. + repeated GridItem items = 2; + + // The border style to apply to each grid item. + BorderStyle border_style = 3; + + // The number of columns to display in the grid. A default value + // is used if this field isn't specified, and that default value is + // different depending on where the grid is shown (dialog versus companion). + int32 column_count = 4; + + // This callback is reused by each individual grid item, but with the + // item's identifier and index in the items list added to the callback's + // parameters. + OnClick on_click = 5; +} + +// The `Columns` widget displays up to 2 columns in a card or dialog. You can +// add widgets to each column; the widgets appear in the order that they are +// specified. For an example in Google Chat apps, see +// [Display cards and dialogs in +// columns](https://developers.google.com/workspace/chat/format-structure-card-dialog#display_cards_and_dialogs_in_columns). +// +// The height of each column is determined by the taller column. For example, if +// the first column is taller than the second column, both columns have the +// height of the first column. Because each column can contain a different +// number of widgets, you can't define rows or align widgets between the +// columns. +// +// Columns are displayed side-by-side. You can customize the width of each +// column using the `HorizontalSizeStyle` field. If the user's +// screen width is too narrow, the second column wraps below the first: +// +// * On web, the second column wraps if the screen width is less than or equal +// to 480 pixels. +// * On iOS devices, the second column wraps if the screen width is +// less than or equal to 300 pt. +// * On Android devices, the second column wraps if the screen width is +// less than or equal to 320 dp. +// +// To include more than 2 columns, or to use rows, use the +// [`Grid`][google.apps.card.v1.Grid] widget. +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +// Columns for Google Workspace Add-ons are in +// Developer Preview. +message Columns { + // A column. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + // Columns for Google Workspace Add-ons are in + // Developer Preview. + message Column { + // Specifies how a column fills the width of the card. The width of each + // column depends on both the `HorizontalSizeStyle` and the width of the + // widgets within the column. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + // Columns for Google Workspace Add-ons are in + // Developer Preview. + enum HorizontalSizeStyle { + // Don't use. Unspecified. + HORIZONTAL_SIZE_STYLE_UNSPECIFIED = 0; + + // Default value. Column fills the available space, up to 70% of the + // card's width. If both columns are set to `FILL_AVAILABLE_SPACE`, each + // column fills 50% of the space. + FILL_AVAILABLE_SPACE = 1; + + // Column fills the least amount of space possible and no more than 30% of + // the card's width. + FILL_MINIMUM_SPACE = 2; + } + + // Specifies whether widgets align to the top, bottom, or center of a + // column. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + // Columns for Google Workspace Add-ons are in + // Developer Preview. + enum VerticalAlignment { + // Don't use. Unspecified. + VERTICAL_ALIGNMENT_UNSPECIFIED = 0; + + // Default value. Aligns widgets to the center of a column. + CENTER = 1; + + // Aligns widgets to the top of a column. + TOP = 2; + + // Aligns widgets to the bottom of a column. + BOTTOM = 3; + } + + // The supported widgets that you can include in a column. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + // Columns for Google Workspace Add-ons are in + // Developer Preview. + message Widgets { + oneof data { + // [TextParagraph][google.apps.card.v1.TextParagraph] widget. + TextParagraph text_paragraph = 1; + + // [Image][google.apps.card.v1.Image] widget. + Image image = 2; + + // [DecoratedText][google.apps.card.v1.DecoratedText] widget. + DecoratedText decorated_text = 3; + + // [ButtonList][google.apps.card.v1.ButtonList] widget. + ButtonList button_list = 4; + + // [TextInput][google.apps.card.v1.TextInput] widget. + TextInput text_input = 5; + + // [SelectionInput][google.apps.card.v1.SelectionInput] widget. + SelectionInput selection_input = 6; + + // [DateTimePicker][google.apps.card.v1.DateTimePicker] widget. + DateTimePicker date_time_picker = 7; + } + } + + // Specifies how a column fills the width of the card. + HorizontalSizeStyle horizontal_size_style = 1; + + // Specifies whether widgets align to the left, right, or center of a + // column. + Widget.HorizontalAlignment horizontal_alignment = 2; + + // Specifies whether widgets align to the top, bottom, or center of a + // column. + VerticalAlignment vertical_alignment = 3; + + // An array of widgets included in a column. Widgets appear in the order + // that they are specified. + repeated Widgets widgets = 4; + } + + // An array of columns. You can include up to 2 columns in a card or dialog. + repeated Column column_items = 2; +} + +// Represents how to respond when users click an interactive element on +// a card, such as a button. +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +message OnClick { + oneof data { + // If specified, an action is triggered by this `onClick`. + Action action = 1; + + // If specified, this `onClick` triggers an open link action. + OpenLink open_link = 2; + + // An add-on triggers this action when the action needs to open a + // link. This differs from the `open_link` above in that this needs to talk + // to server to get the link. Thus some preparation work is required for + // web client to do before the open link action response comes back. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + Action open_dynamic_link_action = 3; + + // A new card is pushed to the card stack after clicking if specified. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + Card card = 4; + } +} + +// Represents an `onClick` event that opens a hyperlink. +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +message OpenLink { + // When an `OnClick` action opens a link, then the client can either open it + // as a full-size window (if that's the frame used by the client), or an + // overlay (such as a pop-up). The implementation depends on the client + // platform capabilities, and the value selected might be ignored if the + // client doesn't support it. `FULL_SIZE` is supported by all clients. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + enum OpenAs { + // The link opens as a full-size window (if that's the frame used by the + // client). + FULL_SIZE = 0; + + // The link opens as an overlay, such as a pop-up. + OVERLAY = 1; + } + + // What the client does when a link opened by an `OnClick` action is closed. + // + // Implementation depends on client platform capabilities. For example, a web + // browser might open a link in a pop-up window with an `OnClose` handler. + // + // If both `OnOpen` and `OnClose` handlers are set, and the client platform + // can't support both values, `OnClose` takes precedence. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + enum OnClose { + // Default value. The card doesn't reload; nothing happens. + NOTHING = 0; + + // Reloads the card after the child window closes. + // + // If used in conjunction with + // [`OpenAs.OVERLAY`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#openas), + // the child window acts as a modal dialog and the parent card is blocked + // until the child window closes. + RELOAD = 1; + } + + // The URL to open. + string url = 1; + + // How to open a link. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + OpenAs open_as = 2; + + // Whether the client forgets about a link after opening it, or observes it + // until the window closes. + // + // [Google Workspace + // Add-ons](https://developers.google.com/workspace/add-ons): + OnClose on_close = 3; +} + +// An action that describes the behavior when the form is submitted. +// For example, you can invoke an Apps Script script to handle the form. +// If the action is triggered, the form values are sent to the server. +// +// [Google Workspace Add-ons and Chat +// apps](https://developers.google.com/workspace/extend): +message Action { + // List of string parameters to supply when the action method is invoked. + // For example, consider three snooze buttons: snooze now, snooze one day, + // or snooze next week. You might use `action method = snooze()`, passing the + // snooze type and snooze time in the list of string parameters. + // + // To learn more, see + // [`CommonEventObject`](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#commoneventobject). + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + message ActionParameter { + // The name of the parameter for the action script. + string key = 1; + + // The value of the parameter. + string value = 2; + } + + // Specifies the loading indicator that the action displays while + // making the call to the action. + // + // [Google Workspace Add-ons and Chat + // apps](https://developers.google.com/workspace/extend): + enum LoadIndicator { + // Displays a spinner to indicate that content is loading. + SPINNER = 0; + + // Nothing is displayed. + NONE = 1; + } + + // Optional. Required when opening a + // [dialog](https://developers.google.com/workspace/chat/dialogs). + // + // What to do in response to an interaction with a user, such as a user + // clicking a button in a card message. + // + // If unspecified, the app responds by executing an `action`—like opening a + // link or running a function—as normal. + // + // By specifying an `interaction`, the app can respond in special interactive + // ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can + // open a [dialog](https://developers.google.com/workspace/chat/dialogs). + // + // When specified, a loading indicator isn't shown. If specified for + // an add-on, the entire card is stripped and nothing is shown in the client. + // + // [Google Chat apps](https://developers.google.com/workspace/chat): + enum Interaction { + // Default value. The `action` executes as normal. + INTERACTION_UNSPECIFIED = 0; + + // Opens a [dialog](https://developers.google.com/workspace/chat/dialogs), a + // windowed, card-based interface that Chat apps use to interact with users. + // + // Only supported by Chat apps in response to button-clicks on card + // messages. If specified for + // an add-on, the entire card is stripped and nothing is shown in the + // client. + // + // [Google Chat apps](https://developers.google.com/workspace/chat): + OPEN_DIALOG = 1; + } + + // A custom function to invoke when the containing element is + // clicked or othrwise activated. + // + // For example usage, see [Read form + // data](https://developers.google.com/workspace/chat/read-form-data). + string function = 1; + + // List of action parameters. + repeated ActionParameter parameters = 2; + + // Specifies the loading indicator that the action displays while + // making the call to the action. + LoadIndicator load_indicator = 3; + + // Indicates whether form values persist after the action. The default value + // is `false`. + // + // If `true`, form values remain after the action is triggered. To let the + // user make changes while the action is being processed, set + // [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) + // to `NONE`. For [card + // messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create) + // in Chat apps, you must also set the action's + // [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype) + // to `UPDATE_MESSAGE` and use the same + // [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId) + // from the card that contained the action. + // + // If `false`, the form values are cleared when the action is triggered. + // To prevent the user from making changes while the action is being + // processed, set + // [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) + // to `SPINNER`. + bool persist_values = 4; + + // Optional. Required when opening a + // [dialog](https://developers.google.com/workspace/chat/dialogs). + // + // What to do in response to an interaction with a user, such as a user + // clicking a button in a card message. + // + // If unspecified, the app responds by executing an `action`—like opening a + // link or running a function—as normal. + // + // By specifying an `interaction`, the app can respond in special interactive + // ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can + // open a [dialog](https://developers.google.com/workspace/chat/dialogs). When + // specified, a loading indicator isn't shown. If specified for + // an add-on, the entire card is stripped and nothing is shown in the client. + // + // [Google Chat apps](https://developers.google.com/workspace/chat): + Interaction interaction = 5; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/action_status.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/action_status.proto new file mode 100644 index 00000000000..192022327c3 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/action_status.proto @@ -0,0 +1,39 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/rpc/code.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "ActionStatusProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// Represents the status for a request to either invoke or submit a +// [dialog](https://developers.google.com/workspace/chat/dialogs). +message ActionStatus { + // The status code. + google.rpc.Code status_code = 1; + + // The message to send users about the status of their request. + // If unset, a generic message based on the `status_code` is sent. + string user_facing_message = 2; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/annotation.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/annotation.proto new file mode 100644 index 00000000000..e7c72139844 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/annotation.proto @@ -0,0 +1,210 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/resource.proto"; +import "google/chat/v1/attachment.proto"; +import "google/chat/v1/user.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// Output only. Annotations associated with the plain-text body of the message. +// To add basic formatting to a text message, see +// [Format text +// messages](https://developers.google.com/workspace/chat/format-messages). +// +// Example plain-text message body: +// ``` +// Hello @FooBot how are you!" +// ``` +// +// The corresponding annotations metadata: +// ``` +// "annotations":[{ +// "type":"USER_MENTION", +// "startIndex":6, +// "length":7, +// "userMention": { +// "user": { +// "name":"users/{user}", +// "displayName":"FooBot", +// "avatarUrl":"https://goo.gl/aeDtrS", +// "type":"BOT" +// }, +// "type":"MENTION" +// } +// }] +// ``` +message Annotation { + // The type of this annotation. + AnnotationType type = 1; + + // Start index (0-based, inclusive) in the plain-text message body this + // annotation corresponds to. + optional int32 start_index = 2; + + // Length of the substring in the plain-text message body this annotation + // corresponds to. + int32 length = 3; + + // Additional metadata about the annotation. + oneof metadata { + // The metadata of user mention. + UserMentionMetadata user_mention = 4; + + // The metadata for a slash command. + SlashCommandMetadata slash_command = 5; + + // The metadata for a rich link. + RichLinkMetadata rich_link_metadata = 6; + } +} + +// Annotation metadata for user mentions (@). +message UserMentionMetadata { + enum Type { + // Default value for the enum. Don't use. + TYPE_UNSPECIFIED = 0; + + // Add user to space. + ADD = 1; + + // Mention user in space. + MENTION = 2; + } + + // The user mentioned. + User user = 1; + + // The type of user mention. + Type type = 2; +} + +// Annotation metadata for slash commands (/). +message SlashCommandMetadata { + enum Type { + // Default value for the enum. Don't use. + TYPE_UNSPECIFIED = 0; + + // Add Chat app to space. + ADD = 1; + + // Invoke slash command in space. + INVOKE = 2; + } + + // The Chat app whose command was invoked. + User bot = 1; + + // The type of slash command. + Type type = 2; + + // The name of the invoked slash command. + string command_name = 3; + + // The command ID of the invoked slash command. + int64 command_id = 4; + + // Indicates whether the slash command is for a dialog. + bool triggers_dialog = 5; +} + +// A rich link to a resource. +message RichLinkMetadata { + // The rich link type. More types might be added in the future. + enum RichLinkType { + // Default value for the enum. Don't use. + RICH_LINK_TYPE_UNSPECIFIED = 0; + + // A Google Drive rich link type. + DRIVE_FILE = 1; + + // A Chat space rich link type. For example, a space smart chip. + CHAT_SPACE = 2; + } + + // The URI of this link. + string uri = 1; + + // The rich link type. + RichLinkType rich_link_type = 2; + + // Data for the linked resource. + oneof data { + // Data for a drive link. + DriveLinkData drive_link_data = 3; + + // Data for a chat space link. + ChatSpaceLinkData chat_space_link_data = 4; + } +} + +// Data for Google Drive links. +message DriveLinkData { + // A + // [DriveDataRef](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) + // which references a Google Drive file. + DriveDataRef drive_data_ref = 1; + + // The mime type of the linked Google Drive resource. + string mime_type = 2; +} + +// Data for Chat space links. +message ChatSpaceLinkData { + // The space of the linked Chat space resource. + // + // Format: `spaces/{space}` + string space = 1 + [(google.api.resource_reference) = { type: "chat.googleapis.com/Space" }]; + + // The thread of the linked Chat space resource. + // + // Format: `spaces/{space}/threads/{thread}` + string thread = 2 [ + (google.api.resource_reference) = { type: "chat.googleapis.com/Thread" } + ]; + + // The message of the linked Chat space resource. + // + // Format: `spaces/{space}/messages/{message}` + string message = 3 [ + (google.api.resource_reference) = { type: "chat.googleapis.com/Message" } + ]; +} + +// Type of the annotation. +enum AnnotationType { + // Default value for the enum. Don't use. + ANNOTATION_TYPE_UNSPECIFIED = 0; + + // A user is mentioned. + USER_MENTION = 1; + + // A slash command is invoked. + SLASH_COMMAND = 2; + + // A rich link annotation. + RICH_LINK = 3; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/attachment.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/attachment.proto new file mode 100644 index 00000000000..c500959e5b7 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/attachment.proto @@ -0,0 +1,132 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "AttachmentProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// An attachment in Google Chat. +message Attachment { + option (google.api.resource) = { + type: "chat.googleapis.com/Attachment" + pattern: "spaces/{space}/messages/{message}/attachments/{attachment}" + }; + + // The source of the attachment. + enum Source { + // Reserved. + SOURCE_UNSPECIFIED = 0; + + // The file is a Google Drive file. + DRIVE_FILE = 1; + + // The file is uploaded to Chat. + UPLOADED_CONTENT = 2; + } + + // Resource name of the attachment, in the form + // `spaces/{space}/messages/{message}/attachments/{attachment}`. + string name = 1; + + // Output only. The original file name for the content, not the full path. + string content_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The content type (MIME type) of the file. + string content_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The data reference to the attachment. + oneof data_ref { + // A reference to the attachment data. This field is used with the media API + // to download the attachment data. + AttachmentDataRef attachment_data_ref = 4; + + // Output only. A reference to the Google Drive attachment. This field is + // used with the Google Drive API. + DriveDataRef drive_data_ref = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The thumbnail URL which should be used to preview the + // attachment to a human user. Chat apps shouldn't use this URL to download + // attachment content. + string thumbnail_uri = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The download URL which should be used to allow a human user to + // download the attachment. Chat apps shouldn't use this URL to download + // attachment content. + string download_uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The source of the attachment. + Source source = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A reference to the data of a drive attachment. +message DriveDataRef { + // The ID for the drive file. Use with the Drive API. + string drive_file_id = 2; +} + +// A reference to the attachment data. +message AttachmentDataRef { + // The resource name of the attachment data. This field is used with the media + // API to download the attachment data. + string resource_name = 1; + + // Opaque token containing a reference to an uploaded attachment. Treated by + // clients as an opaque string and used to create or update Chat messages with + // attachments. + string attachment_upload_token = 2; +} + +// Request to get an attachment. +message GetAttachmentRequest { + // Required. Resource name of the attachment, in the form + // `spaces/{space}/messages/{message}/attachments/{attachment}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "chat.googleapis.com/Attachment" } + ]; +} + +// Request to upload an attachment. +message UploadAttachmentRequest { + // Required. Resource name of the Chat space in which the attachment is + // uploaded. Format "spaces/{space}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "chat.googleapis.com/Message" + } + ]; + + // Required. The filename of the attachment, including the file extension. + string filename = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Response of uploading an attachment. +message UploadAttachmentResponse { + // Reference to the uploaded attachment. + AttachmentDataRef attachment_data_ref = 1; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/chat_service.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/chat_service.proto new file mode 100644 index 00000000000..c019c328ea7 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/chat_service.proto @@ -0,0 +1,643 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/chat/v1/attachment.proto"; +import "google/chat/v1/membership.proto"; +import "google/chat/v1/message.proto"; +import "google/chat/v1/reaction.proto"; +import "google/chat/v1/space.proto"; +import "google/chat/v1/space_event.proto"; +import "google/chat/v1/space_read_state.proto"; +import "google/chat/v1/space_setup.proto"; +import "google/chat/v1/thread_read_state.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "ChatServiceProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// Enables developers to build Chat apps and +// integrations on Google Chat Platform. +service ChatService { + option (google.api.default_host) = "chat.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/chat.admin.delete," + "https://www.googleapis.com/auth/chat.admin.memberships," + "https://www.googleapis.com/auth/chat.admin.memberships.readonly," + "https://www.googleapis.com/auth/chat.admin.spaces," + "https://www.googleapis.com/auth/chat.admin.spaces.readonly," + "https://www.googleapis.com/auth/chat.bot," + "https://www.googleapis.com/auth/chat.delete," + "https://www.googleapis.com/auth/chat.import," + "https://www.googleapis.com/auth/chat.memberships," + "https://www.googleapis.com/auth/chat.memberships.app," + "https://www.googleapis.com/auth/chat.memberships.readonly," + "https://www.googleapis.com/auth/chat.messages," + "https://www.googleapis.com/auth/chat.messages.create," + "https://www.googleapis.com/auth/chat.messages.reactions," + "https://www.googleapis.com/auth/chat.messages.reactions.create," + "https://www.googleapis.com/auth/chat.messages.reactions.readonly," + "https://www.googleapis.com/auth/chat.messages.readonly," + "https://www.googleapis.com/auth/chat.spaces," + "https://www.googleapis.com/auth/chat.spaces.create," + "https://www.googleapis.com/auth/chat.spaces.readonly," + "https://www.googleapis.com/auth/chat.users.readstate," + "https://www.googleapis.com/auth/chat.users.readstate.readonly"; + + // Creates a message in a Google Chat space. The maximum message size, + // including text and cards, is 32,000 bytes. For an example, see [Send a + // message](https://developers.google.com/workspace/chat/create-messages). + // + // Calling this method requires + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) + // and supports the following authentication types: + // + // - For text messages, user authentication or app authentication are + // supported. + // - For card messages, only app authentication is supported. (Only Chat apps + // can create card messages.) + rpc CreateMessage(CreateMessageRequest) returns (Message) { + option (google.api.http) = { + post: "/v1/{parent=spaces/*}/messages" + body: "message" + }; + option (google.api.method_signature) = "parent,message,message_id"; + } + + // Lists messages in a space that the caller is a member of, including + // messages from blocked members and spaces. For an example, see + // [List messages](/chat/api/guides/v1/messages/list). + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse) { + option (google.api.http) = { + get: "/v1/{parent=spaces/*}/messages" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists memberships in a space. For an example, see [List users and Google + // Chat apps in a + // space](https://developers.google.com/workspace/chat/list-members). Listing + // memberships with [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // lists memberships in spaces that the Chat app has + // access to, but excludes Chat app memberships, + // including its own. Listing memberships with + // [User + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // lists memberships in spaces that the authenticated user has access to. + // + // Requires + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + // Supports + // [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // and [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc ListMemberships(ListMembershipsRequest) + returns (ListMembershipsResponse) { + option (google.api.http) = { + get: "/v1/{parent=spaces/*}/members" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns details about a membership. For an example, see + // [Get details about a user's or Google Chat app's + // membership](https://developers.google.com/workspace/chat/get-members). + // + // Requires + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + // Supports + // [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // and [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc GetMembership(GetMembershipRequest) returns (Membership) { + option (google.api.http) = { + get: "/v1/{name=spaces/*/members/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns details about a message. + // For an example, see [Get details about a + // message](https://developers.google.com/workspace/chat/get-messages). + // + // Requires + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + // Supports + // [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // and [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // + // Note: Might return a message from a blocked member or space. + rpc GetMessage(GetMessageRequest) returns (Message) { + option (google.api.http) = { + get: "/v1/{name=spaces/*/messages/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a message. There's a difference between the `patch` and `update` + // methods. The `patch` + // method uses a `patch` request while the `update` method uses a `put` + // request. We recommend using the `patch` method. For an example, see + // [Update a + // message](https://developers.google.com/workspace/chat/update-messages). + // + // Requires + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + // Supports + // [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // and [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // When using app authentication, requests can only update messages + // created by the calling Chat app. + rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + option (google.api.http) = { + put: "/v1/{message.name=spaces/*/messages/*}" + body: "message" + additional_bindings { + patch: "/v1/{message.name=spaces/*/messages/*}" + body: "message" + } + }; + option (google.api.method_signature) = "message,update_mask"; + } + + // Deletes a message. + // For an example, see [Delete a + // message](https://developers.google.com/workspace/chat/delete-messages). + // + // Requires + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + // Supports + // [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // and [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // When using app authentication, requests can only delete messages + // created by the calling Chat app. + rpc DeleteMessage(DeleteMessageRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=spaces/*/messages/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the metadata of a message attachment. The attachment data is fetched + // using the [media + // API](https://developers.google.com/workspace/chat/api/reference/rest/v1/media/download). + // For an example, see + // [Get metadata about a message + // attachment](https://developers.google.com/workspace/chat/get-media-attachments). + // Requires [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + rpc GetAttachment(GetAttachmentRequest) returns (Attachment) { + option (google.api.http) = { + get: "/v1/{name=spaces/*/messages/*/attachments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Uploads an attachment. For an example, see + // [Upload media as a file + // attachment](https://developers.google.com/workspace/chat/upload-media-attachments). + // Requires user + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // + // You can upload attachments up to 200 MB. Certain file types aren't + // supported. For details, see [File types blocked by Google + // Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat). + rpc UploadAttachment(UploadAttachmentRequest) + returns (UploadAttachmentResponse) { + option (google.api.http) = { + post: "/v1/{parent=spaces/*}/attachments:upload" + body: "*" + }; + } + + // Lists spaces the caller is a member of. Group chats and DMs aren't listed + // until the first message is sent. For an example, see + // [List + // spaces](https://developers.google.com/workspace/chat/list-spaces). + // + // Requires + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + // Supports + // [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // and [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // + // Lists spaces visible to the caller or authenticated user. Group chats + // and DMs aren't listed until the first message is sent. + // + // To list all named spaces by Google Workspace organization, use the + // [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) + // method using Workspace administrator privileges instead. + rpc ListSpaces(ListSpacesRequest) returns (ListSpacesResponse) { + option (google.api.http) = { + get: "/v1/spaces" + }; + option (google.api.method_signature) = ""; + } + + // Returns a list of spaces in a Google Workspace organization based on an + // administrator's search. Requires [user + // authentication with administrator + // privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges). + // In the request, set `use_admin_access` to `true`. + rpc SearchSpaces(SearchSpacesRequest) returns (SearchSpacesResponse) { + option (google.api.http) = { + get: "/v1/spaces:search" + }; + option (google.api.method_signature) = ""; + } + + // Returns details about a space. For an example, see + // [Get details about a + // space](https://developers.google.com/workspace/chat/get-spaces). + // + // Requires + // [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + // Supports + // [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + // and [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc GetSpace(GetSpaceRequest) returns (Space) { + option (google.api.http) = { + get: "/v1/{name=spaces/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a named space. Spaces grouped by topics aren't supported. For an + // example, see [Create a + // space](https://developers.google.com/workspace/chat/create-spaces). + // + // If you receive the error message `ALREADY_EXISTS` when creating + // a space, try a different `displayName`. An existing space within + // the Google Workspace organization might already use this display name. + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc CreateSpace(CreateSpaceRequest) returns (Space) { + option (google.api.http) = { + post: "/v1/spaces" + body: "space" + }; + option (google.api.method_signature) = "space"; + } + + // Creates a space and adds specified users to it. The calling user is + // automatically added to the space, and shouldn't be specified as a + // membership in the request. For an example, see + // [Set up a space with initial + // members](https://developers.google.com/workspace/chat/set-up-spaces). + // + // To specify the human members to add, add memberships with the appropriate + // `membership.member.name`. To add a human user, use `users/{user}`, where + // `{user}` can be the email address for the user. For users in the same + // Workspace organization `{user}` can also be the `id` for the person from + // the People API, or the `id` for the user in the Directory API. For example, + // if the People API Person profile ID for `user@example.com` is `123456789`, + // you can add the user to the space by setting the `membership.member.name` + // to `users/user@example.com` or `users/123456789`. + // + // To specify the Google groups to add, add memberships with the + // appropriate `membership.group_member.name`. To add or invite a Google + // group, use `groups/{group}`, where `{group}` is the `id` for the group from + // the Cloud Identity Groups API. For example, you can use [Cloud Identity + // Groups lookup + // API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) + // to retrieve the ID `123456789` for group email `group@example.com`, then + // you can add the group to the space by setting the + // `membership.group_member.name` to `groups/123456789`. Group email is not + // supported, and Google groups can only be added as members in named spaces. + // + // For a named space or group chat, if the caller blocks, or is blocked + // by some members, or doesn't have permission to add some members, then + // those members aren't added to the created space. + // + // To create a direct message (DM) between the calling user and another human + // user, specify exactly one membership to represent the human user. If + // one user blocks the other, the request fails and the DM isn't created. + // + // To create a DM between the calling user and the calling app, set + // `Space.singleUserBotDm` to `true` and don't specify any memberships. You + // can only use this method to set up a DM with the calling app. To add the + // calling app as a member of a space or an existing DM between two human + // users, see + // [Invite or add a user or app to a + // space](https://developers.google.com/workspace/chat/create-members). + // + // If a DM already exists between two users, even when one user blocks the + // other at the time a request is made, then the existing DM is returned. + // + // Spaces with threaded replies aren't supported. If you receive the error + // message `ALREADY_EXISTS` when setting up a space, try a different + // `displayName`. An existing space within the Google Workspace organization + // might already use this display name. + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc SetUpSpace(SetUpSpaceRequest) returns (Space) { + option (google.api.http) = { + post: "/v1/spaces:setup" + body: "*" + }; + } + + // Updates a space. For an example, see + // [Update a + // space](https://developers.google.com/workspace/chat/update-spaces). + // + // If you're updating the `displayName` field and receive the error message + // `ALREADY_EXISTS`, try a different display name.. An existing space within + // the Google Workspace organization might already use this display name. + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc UpdateSpace(UpdateSpaceRequest) returns (Space) { + option (google.api.http) = { + patch: "/v1/{space.name=spaces/*}" + body: "space" + }; + option (google.api.method_signature) = "space,update_mask"; + } + + // Deletes a named space. Always performs a cascading delete, which means + // that the space's child resources—like messages posted in the space and + // memberships in the space—are also deleted. For an example, see + // [Delete a + // space](https://developers.google.com/workspace/chat/delete-spaces). + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // from a user who has permission to delete the space. + rpc DeleteSpace(DeleteSpaceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=spaces/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Completes the + // [import process](https://developers.google.com/workspace/chat/import-data) + // for the specified space and makes it visible to users. + // Requires app authentication and domain-wide delegation. For more + // information, see [Authorize Google Chat apps to import + // data](https://developers.google.com/workspace/chat/authorize-import). + rpc CompleteImportSpace(CompleteImportSpaceRequest) + returns (CompleteImportSpaceResponse) { + option (google.api.http) = { + post: "/v1/{name=spaces/*}:completeImport" + body: "*" + }; + } + + // Returns the existing direct message with the specified user. If no direct + // message space is found, returns a `404 NOT_FOUND` error. For an example, + // see + // [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). + // + // With [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + // returns the direct message space between the specified user and the + // authenticated user. + // + // With [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + // returns the direct message space between the specified user and the calling + // Chat app. + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // or [app + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + rpc FindDirectMessage(FindDirectMessageRequest) returns (Space) { + option (google.api.http) = { + get: "/v1/spaces:findDirectMessage" + }; + } + + // Creates a human membership or app membership for the calling app. Creating + // memberships for other apps isn't supported. For an example, see + // [Invite or add a user or a Google Chat app to a + // space](https://developers.google.com/workspace/chat/create-members). + // When creating a membership, if the specified member has their auto-accept + // policy turned off, then they're invited, and must accept the space + // invitation before joining. Otherwise, creating a membership adds the member + // directly to the specified space. Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // + // To specify the member to add, set the `membership.member.name` for the + // human or app member, or set the `membership.group_member.name` for the + // group member. + // + // - To add the calling app to a space or a direct message between two human + // users, use `users/app`. Unable to add other + // apps to the space. + // + // - To add a human user, use `users/{user}`, where `{user}` can be the email + // address for the user. For users in the same Workspace organization `{user}` + // can also be the `id` for the person from the People API, or the `id` for + // the user in the Directory API. For example, if the People API Person + // profile ID for `user@example.com` is `123456789`, you can add the user to + // the space by setting the `membership.member.name` to + // `users/user@example.com` or `users/123456789`. + // + // - To add or invite a Google group in a named space, use + // `groups/{group}`, where `{group}` is the `id` for the group from the Cloud + // Identity Groups API. For example, you can use [Cloud Identity Groups lookup + // API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) + // to retrieve the ID `123456789` for group email `group@example.com`, then + // you can add or invite the group to a named space by setting the + // `membership.group_member.name` to `groups/123456789`. Group email is not + // supported, and Google groups can only be added as members in named spaces. + rpc CreateMembership(CreateMembershipRequest) returns (Membership) { + option (google.api.http) = { + post: "/v1/{parent=spaces/*}/members" + body: "membership" + }; + option (google.api.method_signature) = "parent,membership"; + } + + // Updates a membership. For an example, see [Update a user's membership in + // a space](https://developers.google.com/workspace/chat/update-members). + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc UpdateMembership(UpdateMembershipRequest) returns (Membership) { + option (google.api.http) = { + patch: "/v1/{membership.name=spaces/*/members/*}" + body: "membership" + }; + option (google.api.method_signature) = "membership,update_mask"; + } + + // Deletes a membership. For an example, see + // [Remove a user or a Google Chat app from a + // space](https://developers.google.com/workspace/chat/delete-members). + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc DeleteMembership(DeleteMembershipRequest) returns (Membership) { + option (google.api.http) = { + delete: "/v1/{name=spaces/*/members/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a reaction and adds it to a message. Only unicode emojis are + // supported. For an example, see + // [Add a reaction to a + // message](https://developers.google.com/workspace/chat/create-reactions). + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc CreateReaction(CreateReactionRequest) returns (Reaction) { + option (google.api.http) = { + post: "/v1/{parent=spaces/*/messages/*}/reactions" + body: "reaction" + }; + option (google.api.method_signature) = "parent,reaction"; + } + + // Lists reactions to a message. For an example, see + // [List reactions for a + // message](https://developers.google.com/workspace/chat/list-reactions). + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc ListReactions(ListReactionsRequest) returns (ListReactionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=spaces/*/messages/*}/reactions" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a reaction to a message. Only unicode emojis are supported. + // For an example, see + // [Delete a + // reaction](https://developers.google.com/workspace/chat/delete-reactions). + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc DeleteReaction(DeleteReactionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=spaces/*/messages/*/reactions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns details about a user's read state within a space, used to identify + // read and unread messages. For an example, see [Get details about a user's + // space read + // state](https://developers.google.com/workspace/chat/get-space-read-state). + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc GetSpaceReadState(GetSpaceReadStateRequest) returns (SpaceReadState) { + option (google.api.http) = { + get: "/v1/{name=users/*/spaces/*/spaceReadState}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a user's read state within a space, used to identify read and + // unread messages. For an example, see [Update a user's space read + // state](https://developers.google.com/workspace/chat/update-space-read-state). + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc UpdateSpaceReadState(UpdateSpaceReadStateRequest) + returns (SpaceReadState) { + option (google.api.http) = { + patch: "/v1/{space_read_state.name=users/*/spaces/*/spaceReadState}" + body: "space_read_state" + }; + option (google.api.method_signature) = "space_read_state,update_mask"; + } + + // Returns details about a user's read state within a thread, used to identify + // read and unread messages. For an example, see [Get details about a user's + // thread read + // state](https://developers.google.com/workspace/chat/get-thread-read-state). + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc GetThreadReadState(GetThreadReadStateRequest) returns (ThreadReadState) { + option (google.api.http) = { + get: "/v1/{name=users/*/spaces/*/threads/*/threadReadState}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns an event from a Google Chat space. The [event + // payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) + // contains the most recent version of the resource that changed. For example, + // if you request an event about a new message but the message was later + // updated, the server returns the updated `Message` resource in the event + // payload. + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // To get an event, the authenticated user must be a member of the space. + // + // For an example, see [Get details about an + // event from a Google Chat + // space](https://developers.google.com/workspace/chat/get-space-event). + rpc GetSpaceEvent(GetSpaceEventRequest) returns (SpaceEvent) { + option (google.api.http) = { + get: "/v1/{name=spaces/*/spaceEvents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists events from a Google Chat space. For each event, the + // [payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) + // contains the most recent version of the Chat resource. For example, if you + // list events about new space members, the server returns `Membership` + // resources that contain the latest membership details. If new members were + // removed during the requested period, the event payload contains an empty + // `Membership` resource. + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // To list events, the authenticated user must be a member of the space. + // + // For an example, see [List events from a Google Chat + // space](https://developers.google.com/workspace/chat/list-space-events). + rpc ListSpaceEvents(ListSpaceEventsRequest) + returns (ListSpaceEventsResponse) { + option (google.api.http) = { + get: "/v1/{parent=spaces/*}/spaceEvents" + }; + option (google.api.method_signature) = "parent,filter"; + } +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/contextual_addon.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/contextual_addon.proto new file mode 100644 index 00000000000..9daa7346c38 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/contextual_addon.proto @@ -0,0 +1,107 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/chat/v1/widgets.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "ContextualAddOnProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// The markup for developers to specify the contents of a contextual AddOn. +message ContextualAddOnMarkup { + // A card is a UI element that can contain UI widgets such as text and + // images. + message Card { + message CardHeader { + enum ImageStyle { + IMAGE_STYLE_UNSPECIFIED = 0; + + // Square border. + IMAGE = 1; + + // Circular border. + AVATAR = 2; + } + + // The title must be specified. The header has a fixed height: if both a + // title and subtitle is specified, each takes up one line. If only the + // title is specified, it takes up both lines. + string title = 1; + + // The subtitle of the card header. + string subtitle = 2; + + // The image's type (for example, square border or circular border). + ImageStyle image_style = 3; + + // The URL of the image in the card header. + string image_url = 4; + } + + // A section contains a collection of widgets that are rendered + // (vertically) in the order that they are specified. Across all platforms, + // cards have a narrow fixed width, so + // there's currently no need for layout properties (for example, float). + message Section { + // The header of the section. Formatted text is + // supported. For more information + // about formatting text, see + // [Formatting text in Google Chat + // apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) + // and + // [Formatting + // text in Google Workspace + // Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + string header = 1; + + // A section must contain at least one widget. + repeated WidgetMarkup widgets = 2; + } + + // A card action is + // the action associated with the card. For an invoice card, a + // typical action would be: delete invoice, email invoice or open the + // invoice in browser. + // + // Not supported by Google Chat apps. + message CardAction { + // The label used to be displayed in the action menu item. + string action_label = 1; + + // The onclick action for this action item. + WidgetMarkup.OnClick on_click = 2; + } + + // The header of the card. A header usually contains a title and an image. + CardHeader header = 1; + + // Sections are separated by a line divider. + repeated Section sections = 2; + + // The actions of this card. + repeated CardAction card_actions = 3; + + // Name of the card. + string name = 4; + } +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/deletion_metadata.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/deletion_metadata.proto new file mode 100644 index 00000000000..4b208755efc --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/deletion_metadata.proto @@ -0,0 +1,57 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "DeletionMetadataProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// Information about a deleted message. A message is deleted when `delete_time` +// is set. +message DeletionMetadata { + // Who deleted the message and how it was deleted. + enum DeletionType { + // This value is unused. + DELETION_TYPE_UNSPECIFIED = 0; + + // User deleted their own message. + CREATOR = 1; + + // The space owner deleted the message. + SPACE_OWNER = 2; + + // A Google Workspace admin deleted the message. + ADMIN = 3; + + // A Chat app deleted its own message when it expired. + APP_MESSAGE_EXPIRY = 4; + + // A Chat app deleted the message on behalf of the user. + CREATOR_VIA_APP = 5; + + // A Chat app deleted the message on behalf of the space owner. + SPACE_OWNER_VIA_APP = 6; + } + + // Indicates who deleted the message. + DeletionType deletion_type = 1; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/event_payload.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/event_payload.proto new file mode 100644 index 00000000000..bd7674124ce --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/event_payload.proto @@ -0,0 +1,177 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/field_behavior.proto"; +import "google/chat/v1/membership.proto"; +import "google/chat/v1/message.proto"; +import "google/chat/v1/reaction.proto"; +import "google/chat/v1/space.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "EventPayloadProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// Event payload for a new membership. +// +// Event type: `google.workspace.chat.membership.v1.created`. +message MembershipCreatedEventData { + // The new membership. + Membership membership = 1; +} + +// Event payload for a deleted membership. +// +// Event type: `google.workspace.chat.membership.v1.deleted` +message MembershipDeletedEventData { + // The deleted membership. Only the `name` and `state` fields are populated. + Membership membership = 1; +} + +// Event payload for an updated membership. +// +// Event type: `google.workspace.chat.membership.v1.updated` +message MembershipUpdatedEventData { + // The updated membership. + Membership membership = 1; +} + +// Event payload for multiple new memberships. +// +// Event type: `google.workspace.chat.membership.v1.batchCreated` +message MembershipBatchCreatedEventData { + // A list of new memberships. + repeated MembershipCreatedEventData memberships = 1; +} + +// Event payload for multiple updated memberships. +// +// Event type: `google.workspace.chat.membership.v1.batchUpdated` +message MembershipBatchUpdatedEventData { + // A list of updated memberships. + repeated MembershipUpdatedEventData memberships = 1; +} + +// Event payload for multiple deleted memberships. +// +// Event type: `google.workspace.chat.membership.v1.batchDeleted` +message MembershipBatchDeletedEventData { + // A list of deleted memberships. + repeated MembershipDeletedEventData memberships = 1; +} + +// Event payload for a new message. +// +// Event type: `google.workspace.chat.message.v1.created` +message MessageCreatedEventData { + // The new message. + Message message = 1; +} + +// Event payload for an updated message. +// +// Event type: `google.workspace.chat.message.v1.updated` +message MessageUpdatedEventData { + // The updated message. + Message message = 1; +} + +// Event payload for a deleted message. +// +// Event type: `google.workspace.chat.message.v1.deleted` +message MessageDeletedEventData { + // The deleted message. Only the `name`, `createTime`, `deleteTime`, and + // `deletionMetadata` fields are populated. + Message message = 1; +} + +// Event payload for multiple new messages. +// +// Event type: `google.workspace.chat.message.v1.batchCreated` +message MessageBatchCreatedEventData { + // A list of new messages. + repeated MessageCreatedEventData messages = 1; +} + +// Event payload for multiple updated messages. +// +// Event type: `google.workspace.chat.message.v1.batchUpdated` +message MessageBatchUpdatedEventData { + // A list of updated messages. + repeated MessageUpdatedEventData messages = 1; +} + +// Event payload for multiple deleted messages. +// +// Event type: `google.workspace.chat.message.v1.batchDeleted` +message MessageBatchDeletedEventData { + // A list of deleted messages. + repeated MessageDeletedEventData messages = 1; +} + +// Event payload for an updated space. +// +// Event type: `google.workspace.chat.space.v1.updated` +message SpaceUpdatedEventData { + // The updated space. + Space space = 1; +} + +// Event payload for multiple updates to a space. +// +// Event type: `google.workspace.chat.space.v1.batchUpdated` +message SpaceBatchUpdatedEventData { + // A list of updated spaces. + repeated SpaceUpdatedEventData spaces = 1; +} + +// Event payload for a new reaction. +// +// Event type: `google.workspace.chat.reaction.v1.created` +message ReactionCreatedEventData { + // The new reaction. + Reaction reaction = 1; +} + +// Event payload for a deleted reaction. +// +// Type: `google.workspace.chat.reaction.v1.deleted` +message ReactionDeletedEventData { + // The deleted reaction. + Reaction reaction = 1; +} + +// Event payload for multiple new reactions. +// +// Event type: `google.workspace.chat.reaction.v1.batchCreated` +message ReactionBatchCreatedEventData { + // A list of new reactions. + repeated ReactionCreatedEventData reactions = 1; +} + +// Event payload for multiple deleted reactions. +// +// Event type: `google.workspace.chat.reaction.v1.batchDeleted` +message ReactionBatchDeletedEventData { + // A list of deleted reactions. + repeated ReactionDeletedEventData reactions = 1; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/group.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/group.proto new file mode 100644 index 00000000000..068828e3ba3 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/group.proto @@ -0,0 +1,38 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "GroupProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// A Google Group in Google Chat. +message Group { + // Resource name for a Google Group. + // + // Represents a + // [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in + // Cloud Identity Groups API. + // + // Format: groups/{group} + string name = 1; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/history_state.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/history_state.proto new file mode 100644 index 00000000000..41828c8a7ec --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/history_state.proto @@ -0,0 +1,42 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "HistoryStateProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// The history state for messages and spaces. Specifies how long messages and +// conversation threads are kept after creation. +enum HistoryState { + // Default value. Do not use. + HISTORY_STATE_UNSPECIFIED = 0; + + // History off. [Messages and threads are kept for 24 + // hours](https://support.google.com/chat/answer/7664687). + HISTORY_OFF = 1; + + // History on. The organization's [Vault retention + // rules](https://support.google.com/vault/answer/7657597) specify for + // how long messages and threads are kept. + HISTORY_ON = 2; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/matched_url.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/matched_url.proto new file mode 100644 index 00000000000..89c95c635cc --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/matched_url.proto @@ -0,0 +1,36 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "MatchedUrlProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// A matched URL in a Chat message. Chat apps can preview matched URLs. For more +// information, see [Preview +// links](https://developers.google.com/chat/how-tos/preview-links). +message MatchedUrl { + // Output only. The URL that was matched. + string url = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/membership.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/membership.proto new file mode 100644 index 00000000000..5222a49b0be --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/membership.proto @@ -0,0 +1,387 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/chat/v1/group.proto"; +import "google/chat/v1/user.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "MembershipProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// Represents a membership relation in Google Chat, such as whether a user or +// Chat app is invited to, part of, or absent from a space. +message Membership { + option (google.api.resource) = { + type: "chat.googleapis.com/Membership" + pattern: "spaces/{space}/members/{member}" + }; + + // Specifies the member's relationship with a space. Other membership states + // might be supported in the future. + enum MembershipState { + // Default value. Don't use. + MEMBERSHIP_STATE_UNSPECIFIED = 0; + + // The user is added to the space, and can participate in the space. + JOINED = 1; + + // The user is invited to join the space, but hasn't joined it. + INVITED = 2; + + // The user doesn't belong to the space and doesn't have a pending + // invitation to join the space. + NOT_A_MEMBER = 3; + } + + // Represents a user's permitted actions in a Chat space. More enum values + // might be added in the future. + enum MembershipRole { + // Default value. For [users][google.chat.v1.Membership.member]: they + // aren't a member of the space, but can be invited. For + // [Google Groups][google.chat.v1.Membership.group_member]: they're always + // assigned this role (other enum values might be used in the future). + MEMBERSHIP_ROLE_UNSPECIFIED = 0; + + // A member of the space. The user has basic permissions, like sending + // messages to the space. In 1:1 and unnamed group conversations, everyone + // has this role. + ROLE_MEMBER = 1; + + // A space manager. The user has all basic permissions plus administrative + // permissions that let them manage the space, like adding or removing + // members. Only supported in + // [SpaceType.SPACE][google.chat.v1.Space.SpaceType]. + ROLE_MANAGER = 2; + } + + // Resource name of the membership, assigned by the server. + // + // Format: `spaces/{space}/members/{member}` + string name = 1 [ + (google.api.resource_reference) = { type: "chat.googleapis.com/Membership" } + ]; + + // Output only. State of the membership. + MembershipState state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User's role within a Chat space, which determines their permitted + // actions in the space. + // + // This field can only be used as input in `UpdateMembership`. + MembershipRole role = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Member associated with this membership. Other member types might be + // supported in the future. + oneof memberType { + // The Google Chat user or app the membership corresponds to. + // If your Chat app [authenticates as a + // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + // the output populates the + // [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) + // `name` and `type`. + User member = 3; + + // The Google Group the membership corresponds to. + Group group_member = 5; + } + + // Optional. Immutable. The creation time of the membership, such as when a + // member joined or was invited to join a space. This field is output only, + // except when used to import historical memberships in import mode spaces. + google.protobuf.Timestamp create_time = 4 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Immutable. The deletion time of the membership, such as when a + // member left or was removed from a space. This field is output only, except + // when used to import historical memberships in import mode spaces. + google.protobuf.Timestamp delete_time = 8 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for creating a membership. +message CreateMembershipRequest { + // Required. The resource name of the space for which to create the + // membership. + // + // Format: spaces/{space} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "chat.googleapis.com/Membership" + } + ]; + + // Required. The membership relation to create. + // The `memberType` field must contain a user with the `user.name` and + // `user.type` fields populated. The server will assign a resource name + // and overwrite anything specified. + // When a Chat app creates a membership relation for a human user, it must use + // the `chat.memberships` scope, set `user.type` to `HUMAN`, and set + // `user.name` with format `users/{user}`, where `{user}` can be the email + // address for the user. For users in the same Workspace organization `{user}` + // can also be the `id` of the + // [person](https://developers.google.com/people/api/rest/v1/people) from the + // People API, or the `id` for the user in the Directory API. For example, if + // the People API Person profile ID for `user@example.com` is `123456789`, you + // can add the user to the space by setting the `membership.member.name` to + // `users/user@example.com` or `users/123456789`. When a Chat app creates a + // membership relation for itself, it must use the `chat.memberships.app` + // scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + Membership membership = 2 [(google.api.field_behavior) = REQUIRED]; + + // When `true`, the method runs using the user's Google Workspace + // administrator privileges. + // + // The calling user must be a Google Workspace administrator with the + // [manage chat and spaces conversations + // privilege](https://support.google.com/a/answer/13369245). + // + // Requires the `chat.admin.memberships` [OAuth 2.0 + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + // + // Creating app memberships or creating memberships for users outside the + // administrator's Google Workspace organization isn't supported using admin + // access. + bool use_admin_access = 5; +} + +// Request message for updating a membership. +message UpdateMembershipRequest { + // Required. The membership to update. Only fields specified by `update_mask` + // are updated. + Membership membership = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The field paths to update. Separate multiple values with commas + // or use `*` to update all field paths. + // + // Currently supported field paths: + // + // - `role` + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // When `true`, the method runs using the user's Google Workspace + // administrator privileges. + // + // The calling user must be a Google Workspace administrator with the + // [manage chat and spaces conversations + // privilege](https://support.google.com/a/answer/13369245). + // + // Requires the `chat.admin.memberships` [OAuth 2.0 + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + bool use_admin_access = 3; +} + +// Request message for listing memberships. +message ListMembershipsRequest { + // Required. The resource name of the space for which to fetch a membership + // list. + // + // Format: spaces/{space} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "chat.googleapis.com/Membership" + } + ]; + + // Optional. The maximum number of memberships to return. The service might + // return fewer than this value. + // + // If unspecified, at most 100 memberships are returned. + // + // The maximum value is 1000. If you use a value more than 1000, it's + // automatically changed to 1000. + // + // Negative values return an `INVALID_ARGUMENT` error. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous call to list memberships. + // Provide this parameter to retrieve the subsequent page. + // + // When paginating, all other parameters provided should match the call that + // provided the page token. Passing different values to the other parameters + // might lead to unexpected results. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A query filter. + // + // You can filter memberships by a member's role + // ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole)) + // and type + // ([`member.type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)). + // + // To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. + // + // To filter by type, set `member.type` to `HUMAN` or `BOT`. You can also + // filter for `member.type` using the `!=` operator. + // + // To filter by both role and type, use the `AND` operator. To filter by + // either role or type, use the `OR` operator. + // + // Either `member.type = "HUMAN"` or `member.type != "BOT"` is required + // when `use_admin_access` is set to true. Other member type filters will be + // rejected. + // + // For example, the following queries are valid: + // + // ``` + // role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + // member.type = "HUMAN" AND role = "ROLE_MANAGER" + // + // member.type != "BOT" + // ``` + // + // The following queries are invalid: + // + // ``` + // member.type = "HUMAN" AND member.type = "BOT" + // role = "ROLE_MANAGER" AND role = "ROLE_MEMBER" + // ``` + // + // Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + // error. + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When `true`, also returns memberships associated with a + // [Google Group][google.chat.v1.Membership.group_member], in + // addition to other types of memberships. If a + // [filter][google.chat.v1.ListMembershipsRequest.filter] is set, + // [Google Group][google.chat.v1.Membership.group_member] + // memberships that don't match the filter criteria aren't returned. + bool show_groups = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When `true`, also returns memberships associated with + // [invited][google.chat.v1.Membership.MembershipState.INVITED] members, in + // addition to other types of memberships. If a + // filter is set, + // [invited][google.chat.v1.Membership.MembershipState.INVITED] memberships + // that don't match the filter criteria aren't returned. + // + // Currently requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + bool show_invited = 7 [(google.api.field_behavior) = OPTIONAL]; + + // When `true`, the method runs using the user's Google Workspace + // administrator privileges. + // + // The calling user must be a Google Workspace administrator with the + // [manage chat and spaces conversations + // privilege](https://support.google.com/a/answer/13369245). + // + // Requires either the `chat.admin.memberships.readonly` or + // `chat.admin.memberships` [OAuth 2.0 + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + // + // Listing app memberships in a space isn't supported when using admin access. + bool use_admin_access = 8; +} + +// Response to list memberships of the space. +message ListMembershipsResponse { + // Unordered list. List of memberships in the requested (or first) page. + repeated Membership memberships = 1 + [(google.api.field_behavior) = UNORDERED_LIST]; + + // A token that you can send as `pageToken` to retrieve the next page of + // results. If empty, there are no subsequent pages. + string next_page_token = 2; +} + +// Request to get a membership of a space. +message GetMembershipRequest { + // Required. Resource name of the membership to retrieve. + // + // To get the app's own membership [by using user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + // you can optionally use `spaces/{space}/members/app`. + // + // Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` + // + // When [authenticated as a + // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + // you can use the user's email as an alias for `{member}`. For example, + // `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + // email of the Google Chat user. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "chat.googleapis.com/Membership" } + ]; + + // When `true`, the method runs using the user's Google Workspace + // administrator privileges. + // + // The calling user must be a Google Workspace administrator with the + // [manage chat and spaces conversations + // privilege](https://support.google.com/a/answer/13369245). + // + // Requires the `chat.admin.memberships` or `chat.admin.memberships.readonly` + // [OAuth 2.0 + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + // + // Getting app memberships in a space isn't supported when using admin access. + bool use_admin_access = 3; +} + +// Request to delete a membership in a space. +message DeleteMembershipRequest { + // Required. Resource name of the membership to delete. Chat apps can delete + // human users' or their own memberships. Chat apps can't delete other apps' + // memberships. + // + // When deleting a human membership, requires the `chat.memberships` scope and + // `spaces/{space}/members/{member}` format. You can use the email as an + // alias for `{member}`. For example, + // `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + // email of the Google Chat user. + // + // When deleting an app membership, requires the `chat.memberships.app` scope + // and `spaces/{space}/members/app` format. + // + // Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "chat.googleapis.com/Membership" } + ]; + + // When `true`, the method runs using the user's Google Workspace + // administrator privileges. + // + // The calling user must be a Google Workspace administrator with the + // [manage chat and spaces conversations + // privilege](https://support.google.com/a/answer/13369245). + // + // Requires the `chat.admin.memberships` [OAuth 2.0 + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + // + // Deleting app memberships in a space isn't supported using admin access. + bool use_admin_access = 2; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/message.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/message.proto new file mode 100644 index 00000000000..ca6a432c83e --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/message.proto @@ -0,0 +1,677 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/apps/card/v1/card.proto"; +import "google/chat/v1/action_status.proto"; +import "google/chat/v1/annotation.proto"; +import "google/chat/v1/attachment.proto"; +import "google/chat/v1/contextual_addon.proto"; +import "google/chat/v1/deletion_metadata.proto"; +import "google/chat/v1/matched_url.proto"; +import "google/chat/v1/reaction.proto"; +import "google/chat/v1/slash_command.proto"; +import "google/chat/v1/space.proto"; +import "google/chat/v1/user.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// A message in a Google Chat space. +message Message { + option (google.api.resource) = { + type: "chat.googleapis.com/Message" + pattern: "spaces/{space}/messages/{message}" + }; + + // Resource name of the message. + // + // Format: `spaces/{space}/messages/{message}` + // + // + // Where `{space}` is the ID of the space where the message is posted and + // `{message}` is a system-assigned ID for the message. For example, + // `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`. + // + // If you set a custom ID when you create a message, you can use this ID to + // specify the message in a request by replacing `{message}` with the value + // from the `clientAssignedMessageId` field. For example, + // `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name + // a + // message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). + string name = 1; + + // Output only. The user who created the message. + // If your Chat app [authenticates as a + // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + // the output populates the + // [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) + // `name` and `type`. + User sender = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Immutable. For spaces created in Chat, the time at which the + // message was created. This field is output only, except when used in import + // mode spaces. + // + // For import mode spaces, set this field to the historical timestamp at which + // the message was created in the source in order to preserve the original + // creation time. + google.protobuf.Timestamp create_time = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + + // Output only. The time at which the message was last edited by a user. If + // the message has never been edited, this field is empty. + google.protobuf.Timestamp last_update_time = 23 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the message was deleted in + // Google Chat. If the message is never deleted, this field is empty. + google.protobuf.Timestamp delete_time = 26 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Plain-text body of the message. The first link to an image, video, or web + // page generates a + // [preview chip](https://developers.google.com/workspace/chat/preview-links). + // You can also [@mention a Google Chat + // user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), + // or everyone in the space. + // + // To learn about creating text messages, see [Send a text + // message](https://developers.google.com/workspace/chat/create-messages#create-text-messages). + string text = 4; + + // Output only. Contains the message `text` with markups added to communicate + // formatting. This field might not capture all formatting visible in the UI, + // but includes the following: + // + // * [Markup + // syntax](https://developers.google.com/workspace/chat/format-messages) + // for bold, italic, strikethrough, monospace, monospace block, and bulleted + // list. + // + // * [User + // mentions](https://developers.google.com/workspace/chat/format-messages#messages-@mention) + // using the format ``. + // + // * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the + // first string is the URL and the second is the rendered text—for example, + // ``. + // + // * Custom emoji using the format `:{emoji_name}:`—for example, `:smile:`. + // This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning + // face emoji. + // + // For more information, see [View text formatting sent in a + // message](https://developers.google.com/workspace/chat/format-messages#view_text_formatting_sent_in_a_message) + string formatted_text = 43 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Deprecated: Use `cards_v2` instead. + // + // Rich, formatted, and interactive cards that you can use to display UI + // elements such as: formatted texts, buttons, and clickable images. Cards are + // normally displayed below the plain-text body of the message. `cards` and + // `cards_v2` can have a maximum size of 32 KB. + repeated ContextualAddOnMarkup.Card cards = 5 [deprecated = true]; + + // An array of + // [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards). + // + // Only Chat apps can create cards. If your Chat app [authenticates as a + // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + // the messages can't contain cards. + // + // To learn about cards and how to create them, see [Send card + // messages](https://developers.google.com/workspace/chat/create-messages#create). + // + // [Card builder](https://addons.gsuite.google.com/uikit/builder) + repeated CardWithId cards_v2 = 22; + + // Output only. Annotations associated with the `text` in this message. + repeated Annotation annotations = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The thread the message belongs to. For example usage, see + // [Start or reply to a message + // thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). + Thread thread = 11; + + // If your Chat app [authenticates as a + // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + // the output populates the + // [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + // `name`. + Space space = 12; + + // A plain-text description of the message's cards, used when the actual cards + // can't be displayed—for example, mobile notifications. + string fallback_text = 13; + + // Input only. Parameters that a Chat app can use to configure how its + // response is posted. + ActionResponse action_response = 14 + [(google.api.field_behavior) = INPUT_ONLY]; + + // Output only. Plain-text body of the message with all Chat app mentions + // stripped out. + string argument_text = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Slash command information, if applicable. + SlashCommand slash_command = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-uploaded attachment. + repeated Attachment attachment = 18; + + // Output only. A URL in `spaces.messages.text` that matches a link preview + // pattern. For more information, see [Preview + // links](https://developers.google.com/workspace/chat/preview-links). + MatchedUrl matched_url = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When `true`, the message is a response in a reply thread. When + // `false`, the message is visible in the space's top-level conversation as + // either the first message of a thread or a message with no threaded replies. + // + // If the space doesn't support reply in threads, this field is always + // `false`. + bool thread_reply = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A custom ID for the message. You can use field to identify a + // message, or to get, delete, or update a message. To set a custom ID, + // specify the + // [`messageId`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) + // field when you create the message. For details, see [Name a + // message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). + string client_assigned_message_id = 32; + + // Output only. The list of emoji reaction summaries on the message. + repeated EmojiReactionSummary emoji_reaction_summaries = 33 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Input for creating a message, otherwise output only. The user + // that can view the message. When set, the message is private and only + // visible to the specified user and the Chat app. Link previews and + // attachments aren't supported for private messages. + // + // Only Chat apps can send private messages. If your Chat app [authenticates + // as a + // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + // to send a message, the message can't be private and must omit this field. + // + // For details, see [Send private messages to Google Chat + // users](https://developers.google.com/workspace/chat/private-messages). + User private_message_viewer = 36 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Information about a deleted message. A message is deleted when + // `delete_time` is set. + DeletionMetadata deletion_metadata = 38 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information about a message that's quoted by a Google Chat + // user in a space. Google Chat users can quote a message to reply to it. + QuotedMessageMetadata quoted_message_metadata = 39 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. GIF images that are attached to the message. + repeated AttachedGif attached_gifs = 42 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // One or more interactive widgets that appear at the bottom of a message. + // You can add accessory widgets to messages that contain text, cards, or both + // text and cards. Not supported for messages that contain dialogs. For + // details, see [Add interactive widgets at the bottom of a + // message](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets). + // + // Creating a message with accessory widgets requires [app + // authentication] + // (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + repeated AccessoryWidget accessory_widgets = 44; +} + +// A GIF image that's specified by a URL. +message AttachedGif { + // Output only. The URL that hosts the GIF image. + string uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information about a quoted message. +message QuotedMessageMetadata { + option (google.api.resource) = { + type: "chat.googleapis.com/QuotedMessageMetadata" + pattern: "spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}" + }; + + // Output only. Resource name of the quoted message. + // + // Format: `spaces/{space}/messages/{message}` + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "chat.googleapis.com/Message" } + ]; + + // Output only. The timestamp when the quoted message was created or when the + // quoted message was last updated. + google.protobuf.Timestamp last_update_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A thread in a Google Chat space. For example usage, see +// [Start or reply to a message +// thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). +// +// If you specify a thread when creating a message, you can set the +// [`messageReplyOption`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#messagereplyoption) +// field to determine what happens if no matching thread is found. +message Thread { + option (google.api.resource) = { + type: "chat.googleapis.com/Thread" + pattern: "spaces/{space}/threads/{thread}" + }; + + // Output only. Resource name of the thread. + // + // Example: `spaces/{space}/threads/{thread}` + string name = 1; + + // Optional. Input for creating or updating a thread. Otherwise, output only. + // ID for the thread. Supports up to 4000 characters. + // + // This ID is unique to the Chat app that sets it. For example, if + // multiple Chat apps create a message using the same thread key, + // the messages are posted in different threads. To reply in a + // thread created by a person or another Chat app, specify the thread `name` + // field instead. + string thread_key = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Parameters that a Chat app can use to configure how its response is posted. +message ActionResponse { + // The type of Chat app response. + enum ResponseType { + // Default type that's handled as `NEW_MESSAGE`. + TYPE_UNSPECIFIED = 0; + + // Post as a new message in the topic. + NEW_MESSAGE = 1; + + // Update the Chat app's message. This is only permitted on a `CARD_CLICKED` + // event where the message sender type is `BOT`. + UPDATE_MESSAGE = 2; + + // Update the cards on a user's message. This is only permitted as a + // response to a `MESSAGE` event with a matched url, or a `CARD_CLICKED` + // event where the message sender type is `HUMAN`. Text is ignored. + UPDATE_USER_MESSAGE_CARDS = 6; + + // Privately ask the user for additional authentication or configuration. + REQUEST_CONFIG = 3; + + // Presents a + // [dialog](https://developers.google.com/workspace/chat/dialogs). + DIALOG = 4; + + // Widget text autocomplete options query. + UPDATE_WIDGET = 7; + } + + // List of widget autocomplete results. + message SelectionItems { + // An array of the SelectionItem objects. + repeated google.apps.card.v1.SelectionInput.SelectionItem items = 1; + } + + // The response of the updated widget. + // Used to provide autocomplete options for a widget. + message UpdatedWidget { + // The widget updated in response to a user action. + oneof updated_widget { + // List of widget autocomplete results + SelectionItems suggestions = 1; + } + + // The ID of the updated widget. The ID must match the one for the + // widget that triggered the update request. + string widget = 2; + } + + // Input only. The type of Chat app response. + ResponseType type = 1 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. URL for users to authenticate or configure. (Only for + // `REQUEST_CONFIG` response types.) + string url = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. A response to an interaction event related to a + // [dialog](https://developers.google.com/workspace/chat/dialogs). Must be + // accompanied by `ResponseType.Dialog`. + DialogAction dialog_action = 3 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. The response of the updated widget. + UpdatedWidget updated_widget = 4 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// One or more interactive widgets that appear at the bottom of a message. For +// details, see [Add interactive widgets at the bottom of a +// message](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets). +message AccessoryWidget { + // The type of action. + oneof action { + // A list of buttons. + google.apps.card.v1.ButtonList button_list = 1; + } +} + +// Request to get a message. +message GetMessageRequest { + // Required. Resource name of the message. + // + // Format: `spaces/{space}/messages/{message}` + // + // If you've set a custom ID for your message, you can use the value from the + // `clientAssignedMessageId` field for `{message}`. For details, see [Name a + // message] + // (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "chat.googleapis.com/Message" } + ]; +} + +// Request to delete a message. +message DeleteMessageRequest { + // Required. Resource name of the message. + // + // Format: `spaces/{space}/messages/{message}` + // + // If you've set a custom ID for your message, you can use the value from the + // `clientAssignedMessageId` field for `{message}`. For details, see [Name a + // message] + // (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "chat.googleapis.com/Message" } + ]; + + // When `true`, deleting a message also deletes its threaded replies. When + // `false`, if a message has threaded replies, deletion fails. + // + // Only applies when [authenticating as a + // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + // Has no effect when [authenticating as a Chat app] + // (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + bool force = 2; +} + +// Request to update a message. +message UpdateMessageRequest { + // Required. Message with fields updated. + Message message = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The field paths to update. Separate multiple values with commas + // or use `*` to update all field paths. + // + // Currently supported field paths: + // + // - `text` + // + // - `attachment` + // + // - `cards` (Requires [app + // authentication](/chat/api/guides/auth/service-accounts).) + // + // - `cards_v2` (Requires [app + // authentication](/chat/api/guides/auth/service-accounts).) + // + // - `accessory_widgets` (Requires [app + // authentication](/chat/api/guides/auth/service-accounts).) + google.protobuf.FieldMask update_mask = 2; + + // Optional. If `true` and the message isn't found, a new message is created + // and `updateMask` is ignored. The specified message ID must be + // [client-assigned](https://developers.google.com/workspace/chat/create-messages#name_a_created_message) + // or the request fails. + bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Creates a message. +message CreateMessageRequest { + // Specifies how to reply to a message. + // More states might be added in the future. + enum MessageReplyOption { + // Default. Starts a new thread. Using this option ignores any [thread + // ID][google.chat.v1.Thread.name] or + // [`thread_key`][google.chat.v1.Thread.thread_key] that's included. + MESSAGE_REPLY_OPTION_UNSPECIFIED = 0; + + // Creates the message as a reply to the thread specified by [thread + // ID][google.chat.v1.Thread.name] or + // [`thread_key`][google.chat.v1.Thread.thread_key]. If it fails, the + // message starts a new thread instead. + REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD = 1; + + // Creates the message as a reply to the thread specified by [thread + // ID][google.chat.v1.Thread.name] or + // [`thread_key`][google.chat.v1.Thread.thread_key]. If a new `thread_key` + // is used, a new thread is created. If the message creation fails, a + // `NOT_FOUND` error is returned instead. + REPLY_MESSAGE_OR_FAIL = 2; + } + + // Required. The resource name of the space in which to create a message. + // + // Format: `spaces/{space}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "chat.googleapis.com/Message" + } + ]; + + // Required. Message body. + Message message = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Deprecated: Use + // [thread.thread_key][google.chat.v1.Thread.thread_key] instead. ID for the + // thread. Supports up to 4000 characters. To start or add to a thread, create + // a message and specify a `threadKey` or the + // [thread.name][google.chat.v1.Thread.name]. For example usage, see [Start or + // reply to a message + // thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). + string thread_key = 6 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique request ID for this message. Specifying an existing + // request ID returns the message created with that ID instead of creating a + // new message. + string request_id = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether a message starts a thread or replies to one. + // Only supported in named spaces. + MessageReplyOption message_reply_option = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A custom ID for a message. Lets Chat apps get, update, or delete + // a message without needing to store the system-assigned ID in the message's + // resource name (represented in the message `name` field). + // + // The value for this field must meet the following requirements: + // + // * Begins with `client-`. For example, `client-custom-name` is a valid + // custom ID, but `custom-name` is not. + // * Contains up to 63 characters and only lowercase letters, numbers, and + // hyphens. + // * Is unique within a space. A Chat app can't use the same custom ID for + // different messages. + // + // For details, see [Name a + // message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). + string message_id = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Lists messages in the specified space, that the user is a member of. +message ListMessagesRequest { + // Required. The resource name of the space to list messages from. + // + // Format: `spaces/{space}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "chat.googleapis.com/Message" + } + ]; + + // The maximum number of messages returned. The service might return fewer + // messages than this value. + // + // If unspecified, at most 25 are returned. + // + // The maximum value is 1000. If you use a value more than 1000, it's + // automatically changed to 1000. + // + // Negative values return an `INVALID_ARGUMENT` error. + int32 page_size = 2; + + // Optional, if resuming from a previous query. + // + // A page token received from a previous list messages call. Provide this + // parameter to retrieve the subsequent page. + // + // When paginating, all other parameters provided should match the call that + // provided the page token. Passing different values to the other parameters + // might lead to unexpected results. + string page_token = 3; + + // A query filter. + // + // You can filter messages by date (`create_time`) and thread (`thread.name`). + // + // To filter messages by the date they were created, specify the `create_time` + // with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) + // format and double quotation marks. For example, + // `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to + // list messages that were created after a timestamp, or the less than + // operator `<` to list messages that were created before a timestamp. To + // filter messages within a time interval, use the `AND` operator between two + // timestamps. + // + // To filter by thread, specify the `thread.name`, formatted as + // `spaces/{space}/threads/{thread}`. You can only specify one + // `thread.name` per query. + // + // To filter by both thread and date, use the `AND` operator in your query. + // + // For example, the following queries are valid: + // + // ``` + // create_time > "2012-04-21T11:30:00-04:00" + // + // create_time > "2012-04-21T11:30:00-04:00" AND + // thread.name = spaces/AAAAAAAAAAA/threads/123 + // + // create_time > "2012-04-21T11:30:00+00:00" AND + // + // create_time < "2013-01-01T00:00:00+00:00" AND + // thread.name = spaces/AAAAAAAAAAA/threads/123 + // + // thread.name = spaces/AAAAAAAAAAA/threads/123 + // ``` + // + // Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + // error. + string filter = 4; + + // Optional, if resuming from a previous query. + // + // How the list of messages is ordered. Specify a value to order by an + // ordering operation. Valid ordering operation values are as follows: + // + // - `ASC` for ascending. + // + // - `DESC` for descending. + // + // The default ordering is `create_time ASC`. + string order_by = 5; + + // Whether to include deleted messages. Deleted messages include deleted time + // and metadata about their deletion, but message content is unavailable. + bool show_deleted = 6; +} + +// Response message for listing messages. +message ListMessagesResponse { + // List of messages. + repeated Message messages = 1; + + // You can send a token as `pageToken` to retrieve the next page of + // results. If empty, there are no subsequent pages. + string next_page_token = 2; +} + +// Contains a +// [dialog](https://developers.google.com/workspace/chat/dialogs) and request +// status code. +message DialogAction { + // Action to perform. + oneof action { + // Input only. + // [Dialog](https://developers.google.com/workspace/chat/dialogs) for the + // request. + Dialog dialog = 1 [(google.api.field_behavior) = INPUT_ONLY]; + } + + // Input only. Status for a request to either invoke or submit a + // [dialog](https://developers.google.com/workspace/chat/dialogs). Displays + // a status and message to users, if necessary. + // For example, in case of an error or success. + ActionStatus action_status = 2 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// Wrapper around the card body of the dialog. +message Dialog { + // Input only. Body of the dialog, which is rendered in a modal. + // Google Chat apps don't support the following card entities: + // `DateTimePicker`, `OnChangeAction`. + google.apps.card.v1.Card body = 1 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// A +// [card](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards) +// in a Google Chat message. +// +// Only Chat apps can create cards. If your Chat app [authenticates as a +// user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), +// the message can't contain cards. +// +// [Card builder](https://addons.gsuite.google.com/uikit/builder) +message CardWithId { + // Required if the message contains multiple cards. A unique identifier for + // a card in a message. + string card_id = 1; + + // A card. Maximum size is 32 KB. + google.apps.card.v1.Card card = 2; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/reaction.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/reaction.proto new file mode 100644 index 00000000000..9639b1f5b29 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/reaction.proto @@ -0,0 +1,186 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/chat/v1/user.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "ReactionProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// A reaction to a message. +message Reaction { + option (google.api.resource) = { + type: "chat.googleapis.com/Reaction" + pattern: "spaces/{space}/messages/{message}/reactions/{reaction}" + }; + + // The resource name of the reaction. + // + // Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + string name = 1; + + // Output only. The user who created the reaction. + User user = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The emoji used in the reaction. + Emoji emoji = 3; +} + +// An emoji that is used as a reaction to a message. +message Emoji { + // The content of the emoji. + oneof content { + // A basic emoji represented by a unicode string. + string unicode = 1; + + // Output only. A custom emoji. + CustomEmoji custom_emoji = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// Represents a custom emoji. +message CustomEmoji { + // Output only. Unique key for the custom emoji resource. + string uid = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The number of people who reacted to a message with a specific emoji. +message EmojiReactionSummary { + // Emoji associated with the reactions. + Emoji emoji = 1; + + // The total number of reactions using the associated emoji. + optional int32 reaction_count = 2; +} + +// Creates a reaction to a message. +message CreateReactionRequest { + // Required. The message where the reaction is created. + // + // Format: `spaces/{space}/messages/{message}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "chat.googleapis.com/Reaction" + } + ]; + + // Required. The reaction to create. + Reaction reaction = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Lists reactions to a message. +message ListReactionsRequest { + // Required. The message users reacted to. + // + // Format: `spaces/{space}/messages/{message}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "chat.googleapis.com/Reaction" + } + ]; + + // Optional. The maximum number of reactions returned. The service can return + // fewer reactions than this value. If unspecified, the default value is 25. + // The maximum value is 200; values above 200 are changed to 200. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. (If resuming from a previous query.) + // + // A page token received from a previous list reactions call. Provide this + // to retrieve the subsequent page. + // + // When paginating, the filter value should match the call that provided the + // page token. Passing a different value might lead to unexpected results. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A query filter. + // + // You can filter reactions by + // [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) + // (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + // [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) + // (`user.name`). + // + // To filter reactions for multiple emojis or users, join similar fields + // with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = + // "👍"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. + // + // To filter reactions by emoji and user, use the `AND` operator, such as + // `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. + // + // If your query uses both `AND` and `OR`, group them with parentheses. + // + // For example, the following queries are valid: + // + // ``` + // user.name = "users/{user}" + // emoji.unicode = "🙂" + // emoji.custom_emoji.uid = "{uid}" + // emoji.unicode = "🙂" OR emoji.unicode = "👍" + // emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + // emoji.unicode = "🙂" AND user.name = "users/{user}" + // (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") + // AND user.name = "users/{user}" + // ``` + // + // The following queries are invalid: + // + // ``` + // emoji.unicode = "🙂" AND emoji.unicode = "👍" + // emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" + // emoji.unicode = "🙂" OR user.name = "users/{user}" + // emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR + // user.name = "users/{user}" + // emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + // AND user.name = "users/{user}" + // ``` + // + // Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + // error. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response to a list reactions request. +message ListReactionsResponse { + // List of reactions in the requested (or first) page. + repeated Reaction reactions = 1; + + // Continuation token to retrieve the next page of results. It's empty + // for the last page of results. + string next_page_token = 2; +} + +// Deletes a reaction to a message. +message DeleteReactionRequest { + // Required. Name of the reaction to delete. + // + // Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "chat.googleapis.com/Reaction" } + ]; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/slash_command.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/slash_command.proto new file mode 100644 index 00000000000..75f21354955 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/slash_command.proto @@ -0,0 +1,34 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "SlashCommandProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// A [slash +// command](https://developers.google.com/workspace/chat/slash-commands) in +// Google Chat. +message SlashCommand { + // The ID of the slash command invoked. + int64 command_id = 1; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/space.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/space.proto new file mode 100644 index 00000000000..3796f82fbe3 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/space.proto @@ -0,0 +1,629 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/chat/v1/history_state.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "SpaceProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// A space in Google Chat. Spaces are conversations between two or more users +// or 1:1 messages between a user and a Chat app. +message Space { + option (google.api.resource) = { + type: "chat.googleapis.com/Space" + pattern: "spaces/{space}" + }; + + // Deprecated: Use `SpaceType` instead. + enum Type { + // Reserved. + TYPE_UNSPECIFIED = 0; + + // Conversations between two or more humans. + ROOM = 1; + + // 1:1 Direct Message between a human and a Chat app, where all messages are + // flat. Note that this doesn't include direct messages between two humans. + DM = 2; + } + + // The type of space. Required when creating or updating a space. Output only + // for other usage. + enum SpaceType { + // Reserved. + SPACE_TYPE_UNSPECIFIED = 0; + + // A place where people send messages, share files, and collaborate. + // A `SPACE` can include Chat apps. + SPACE = 1; + + // Group conversations between 3 or more people. + // A `GROUP_CHAT` can include Chat apps. + GROUP_CHAT = 2; + + // 1:1 messages between two humans or a human and a Chat app. + DIRECT_MESSAGE = 3; + } + + // Specifies the type of threading state in the Chat space. + enum SpaceThreadingState { + // Reserved. + SPACE_THREADING_STATE_UNSPECIFIED = 0; + + // Named spaces that support message threads. When users respond to a + // message, they can reply in-thread, which keeps their response in the + // context of the original message. + THREADED_MESSAGES = 2; + + // Named spaces where the conversation is organized by topic. Topics and + // their replies are grouped together. + GROUPED_MESSAGES = 3; + + // Direct messages (DMs) between two people and group conversations between + // 3 or more people. + UNTHREADED_MESSAGES = 4; + } + + // Details about the space including description and rules. + message SpaceDetails { + // Optional. A description of the space. For example, describe the space's + // discussion topic, functional purpose, or participants. + // + // Supports up to 150 characters. + string description = 1; + + // Optional. The space's rules, expectations, and etiquette. + // + // Supports up to 5,000 characters. + string guidelines = 2; + } + + // Represents the count of memberships of a space, grouped into categories. + message MembershipCount { + // Count of human users that have directly joined the space, not counting + // users joined by having membership in a joined group. + int32 joined_direct_human_user_count = 4; + + // Count of all groups that have directly joined the space. + int32 joined_group_count = 5; + } + + // Represents the [access + // setting](https://support.google.com/chat/answer/11971020) of the space. + message AccessSettings { + // Represents the access state of the space. + enum AccessState { + // Access state is unknown or not supported in this API. + ACCESS_STATE_UNSPECIFIED = 0; + + // Space is discoverable by added or invited members or groups. + PRIVATE = 1; + + // Space is discoverable by the selected [target + // audience](https://support.google.com/a/answer/9934697), as well as + // added or invited members or groups. + DISCOVERABLE = 2; + } + + // Output only. Indicates the access state of the space. + AccessState access_state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The resource name of the [target + // audience](https://support.google.com/a/answer/9934697) who can discover + // the space, join the space, and preview the messages in the space. For + // details, see [Make a space discoverable to a target + // audience](https://developers.google.com/workspace/chat/space-target-audience). + // + // Format: `audiences/{audience}` + // + // To use the default target audience for the Google Workspace organization, + // set to `audiences/default`. + string audience = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Resource name of the space. + // + // Format: `spaces/{space}` + string name = 1; + + // Output only. Deprecated: Use `space_type` instead. + // The type of a space. + Type type = 2 [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // The type of space. Required when creating a space or updating the space + // type of a space. Output only for other usage. + SpaceType space_type = 10; + + // Optional. Whether the space is a DM between a Chat app and a single + // human. + bool single_user_bot_dm = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Deprecated: Use `spaceThreadingState` instead. + // Whether messages are threaded in this space. + bool threaded = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // The space's display name. Required when [creating a + // space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create). + // If you receive the error message `ALREADY_EXISTS` when creating a space or + // updating the `displayName`, try a different `displayName`. An + // existing space within the Google Workspace organization might already use + // this display name. + // + // For direct messages, this field might be empty. + // + // Supports up to 128 characters. + string display_name = 3; + + // Immutable. Whether this space permits any Google Chat user as a member. + // Input when creating a space in a Google Workspace organization. Omit this + // field when creating spaces in the following conditions: + // + // * The authenticated user uses a consumer account (unmanaged user + // account). By default, a space created by a consumer account permits any + // Google Chat user. + // + // * The space is used to [import data to Google Chat] + // (https://developers.google.com/chat/api/guides/import-data-overview) + // because import mode spaces must only permit members from the same + // Google Workspace organization. However, as part of the [Google + // Workspace Developer Preview + // Program](https://developers.google.com/workspace/preview), import mode + // spaces can permit any Google Chat user so this field can then be set + // for import mode spaces. + // + // For existing spaces, this field is output only. + bool external_user_allowed = 8 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The threading state in the Chat space. + SpaceThreadingState space_threading_state = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Details about the space including description and rules. + SpaceDetails space_details = 11; + + // The message history state for messages and threads in this space. + HistoryState space_history_state = 13; + + // Optional. Whether this space is created in `Import Mode` as part of a data + // migration into Google Workspace. While spaces are being imported, they + // aren't visible to users until the import is complete. + bool import_mode = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Immutable. For spaces created in Chat, the time the space was + // created. This field is output only, except when used in import mode spaces. + // + // For import mode spaces, set this field to the historical timestamp at which + // the space was created in the source in order to preserve the original + // creation time. + // + // Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`. + google.protobuf.Timestamp create_time = 17 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + + // Output only. Timestamp of the last message in the space. + google.protobuf.Timestamp last_active_time = 18 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For direct message (DM) spaces with a Chat app, whether the + // space was created by a Google Workspace administrator. Administrators can + // install and set up a direct message with a Chat app on behalf of users in + // their organization. + // + // To support admin install, your Chat app must feature direct messaging. + bool admin_installed = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The count of joined memberships grouped by member type. + // Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or + // `GROUP_CHAT`. + MembershipCount membership_count = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Specifies the [access + // setting](https://support.google.com/chat/answer/11971020) of the space. + // Only populated when the `space_type` is `SPACE`. + AccessSettings access_settings = 23 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The URI for a user to access the space. + string space_uri = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to create a named space. +message CreateSpaceRequest { + // Required. The `displayName` and `spaceType` fields must be populated. Only + // `SpaceType.SPACE` is supported. + // + // If you receive the error message `ALREADY_EXISTS` when creating a space, + // try a different `displayName`. An existing space within the Google + // Workspace organization might already use this display name. + // + // The space `name` is assigned on the server so anything specified in this + // field will be ignored. + Space space = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. + // A random UUID is recommended. + // Specifying an existing request ID returns the space created with that ID + // instead of creating a new space. + // Specifying an existing request ID from the same Chat app with a different + // authenticated user returns an error. + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to list the spaces the caller is a member of. +message ListSpacesRequest { + // Optional. The maximum number of spaces to return. The service might return + // fewer than this value. + // + // If unspecified, at most 100 spaces are returned. + // + // The maximum value is 1000. If you use a value more than 1000, it's + // automatically changed to 1000. + // + // Negative values return an `INVALID_ARGUMENT` error. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous list spaces call. + // Provide this parameter to retrieve the subsequent page. + // + // When paginating, the filter value should match the call that provided the + // page token. Passing a different value may lead to unexpected results. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A query filter. + // + // You can filter spaces by the space type + // ([`space_type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)). + // + // To filter by space type, you must specify valid enum value, such as + // `SPACE` or `GROUP_CHAT` (the `space_type` can't be + // `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` + // operator. + // + // For example, the following queries are valid: + // + // ``` + // space_type = "SPACE" + // spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" + // ``` + // + // Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + // error. + string filter = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for a list spaces request. +message ListSpacesResponse { + // List of spaces in the requested (or first) page. + repeated Space spaces = 1; + + // You can send a token as `pageToken` to retrieve the next page of + // results. If empty, there are no subsequent pages. + string next_page_token = 2; +} + +// A request to return a single space. +message GetSpaceRequest { + // Required. Resource name of the space, in the form `spaces/{space}`. + // + // Format: `spaces/{space}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "chat.googleapis.com/Space" } + ]; + + // When `true`, the method runs using the user's Google Workspace + // administrator privileges. + // + // The calling user must be a Google Workspace administrator with the + // [manage chat and spaces conversations + // privilege](https://support.google.com/a/answer/13369245). + // + // Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0 + // scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + bool use_admin_access = 2; +} + +// A request to get direct message space based on the user resource. +message FindDirectMessageRequest { + // Required. Resource name of the user to find direct message with. + // + // Format: `users/{user}`, where `{user}` is either the `id` for the + // [person](https://developers.google.com/people/api/rest/v1/people) from the + // People API, or the `id` for the + // [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + // in the Directory API. For example, if the People API profile ID is + // `123456789`, you can find a direct message with that person by using + // `users/123456789` as the `name`. When [authenticated as a + // user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + // you can use the email as an alias for `{user}`. For example, + // `users/example@gmail.com` where `example@gmail.com` is the email of the + // Google Chat user. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to update a single space. +message UpdateSpaceRequest { + // Required. Space with fields to be updated. `Space.name` must be + // populated in the form of `spaces/{space}`. Only fields + // specified by `update_mask` are updated. + Space space = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The updated field paths, comma separated if there are + // multiple. + // + // Currently supported field paths: + // + // - `display_name` (Only supports changing the display name of a space with + // the `SPACE` type, or when also including the `space_type` mask to change a + // `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a + // `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument + // error. If you receive the error message `ALREADY_EXISTS` when updating the + // `displayName`, try a different `displayName`. An existing space within the + // Google Workspace organization might already use this display name.) + // + // - `space_type` (Only supports changing a `GROUP_CHAT` space type to + // `SPACE`. Include `display_name` together + // with `space_type` in the update mask and ensure that the specified space + // has a non-empty display name and the `SPACE` space type. Including the + // `space_type` mask and the `SPACE` type in the specified space when updating + // the display name is optional if the existing space already has the `SPACE` + // type. Trying to update the space type in other ways results in an invalid + // argument error). + // `space_type` is not supported with admin access. + // + // - `space_details` + // + // - `space_history_state` (Supports [turning history on or off for the + // space](https://support.google.com/chat/answer/7664687) if [the organization + // allows users to change their history + // setting](https://support.google.com/a/answer/7664184). + // Warning: mutually exclusive with all other field paths.) + // `space_history_state` is not supported with admin access. + // + // - `access_settings.audience` (Supports changing the [access + // setting](https://support.google.com/chat/answer/11971020) of who can + // discover the space, join the space, and preview the messages in space. If + // no audience is specified in the access setting, the space's access setting + // is updated to private. Warning: mutually exclusive with all other field + // paths.) + // `access_settings.audience` is not supported with admin access. + // + // - Developer Preview: Supports changing the [permission + // settings](https://support.google.com/chat/answer/13340792) of a space, + // supported field paths + // include: `permission_settings.manage_members_and_groups`, + // `permission_settings.modify_space_details`, + // `permission_settings.toggle_history`, + // `permission_settings.use_at_mention_all`, + // `permission_settings.manage_apps`, `permission_settings.manage_webhooks`, + // `permission_settings.reply_messages` + // (Warning: mutually exclusive with all other non-permission settings field + // paths). `permission_settings` is not supported with admin access. + google.protobuf.FieldMask update_mask = 2; + + // When `true`, the method runs using the user's Google Workspace + // administrator privileges. + // + // The calling user must be a Google Workspace administrator with the + // [manage chat and spaces conversations + // privilege](https://support.google.com/a/answer/13369245). + // + // Requires the `chat.admin.spaces` [OAuth 2.0 + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + // + // Some `FieldMask` values are not supported using admin access. For details, + // see the description of `update_mask`. + bool use_admin_access = 3; +} + +// Request to search for a list of spaces based on a query. +message SearchSpacesRequest { + // When `true`, the method runs using the user's Google Workspace + // administrator privileges. + // + // The calling user must be a Google Workspace administrator with the + // [manage chat and spaces conversations + // privilege](https://support.google.com/a/answer/13369245). + // + // Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces` + // [OAuth 2.0 + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + // + // This method currently only supports admin access, thus only `true` is + // accepted for this field. + bool use_admin_access = 1; + + // The maximum number of spaces to return. The service may return fewer than + // this value. + // + // If unspecified, at most 100 spaces are returned. + // + // The maximum value is 1000. If you use a value more than 1000, it's + // automatically changed to 1000. + int32 page_size = 2; + + // A token, received from the previous search spaces call. Provide this + // parameter to retrieve the subsequent page. + // + // When paginating, all other parameters provided should match the call that + // provided the page token. Passing different values to the other parameters + // might lead to unexpected results. + string page_token = 3; + + // Required. A search query. + // + // You can search by using the following parameters: + // + // - `create_time` + // - `customer` + // - `display_name` + // - `external_user_allowed` + // - `last_active_time` + // - `space_history_state` + // - `space_type` + // + // `create_time` and `last_active_time` accept a timestamp in + // [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported + // comparison operators are: `=`, `<`, `>`, `<=`, `>=`. + // + // `customer` is required and is used to indicate which customer + // to fetch spaces from. `customers/my_customer` is the only supported value. + // + // `display_name` only accepts the `HAS` (`:`) operator. The text to + // match is first tokenized into tokens and each token is prefix-matched + // case-insensitively and independently as a substring anywhere in the space's + // `display_name`. For example, `Fun Eve` matches `Fun event` or `The + // evening was fun`, but not `notFun event` or `even`. + // + // `external_user_allowed` accepts either `true` or `false`. + // + // `space_history_state` only accepts values from the [`historyState`] + // (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) + // field of a `space` resource. + // + // `space_type` is required and the only valid value is `SPACE`. + // + // Across different fields, only `AND` operators are supported. A valid + // example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid + // example is `space_type = "SPACE" OR display_name:"Hello"`. + // + // Among the same field, + // `space_type` doesn't support `AND` or `OR` operators. + // `display_name`, 'space_history_state', and 'external_user_allowed' only + // support `OR` operators. + // `last_active_time` and `create_time` support both `AND` and `OR` operators. + // `AND` can only be used to represent an interval, such as `last_active_time + // < "2022-01-01T00:00:00+00:00" AND last_active_time > + // "2023-01-01T00:00:00+00:00"`. + // + // The following example queries are valid: + // + // ``` + // customer = "customers/my_customer" AND space_type = "SPACE" + // + // customer = "customers/my_customer" AND space_type = "SPACE" AND + // display_name:"Hello World" + // + // customer = "customers/my_customer" AND space_type = "SPACE" AND + // (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > + // "2022-01-01T00:00:00+00:00") + // + // customer = "customers/my_customer" AND space_type = "SPACE" AND + // (display_name:"Hello World" OR display_name:"Fun event") AND + // (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < + // "2022-01-01T00:00:00+00:00") + // + // customer = "customers/my_customer" AND space_type = "SPACE" AND + // (create_time > "2019-01-01T00:00:00+00:00" AND create_time < + // "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND + // (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF") + // ``` + string query = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. How the list of spaces is ordered. + // + // Supported attributes to order by are: + // + // - `membership_count.joined_direct_human_user_count` — Denotes the count of + // human users that have directly joined a space. + // - `last_active_time` — Denotes the time when last eligible item is added to + // any topic of this space. + // - `create_time` — Denotes the time of the space creation. + // + // Valid ordering operation values are: + // + // - `ASC` for ascending. Default value. + // + // - `DESC` for descending. + // + // The supported syntax are: + // + // - `membership_count.joined_direct_human_user_count DESC` + // - `membership_count.joined_direct_human_user_count ASC` + // - `last_active_time DESC` + // - `last_active_time ASC` + // - `create_time DESC` + // - `create_time ASC` + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response with a list of spaces corresponding to the search spaces request. +message SearchSpacesResponse { + // A page of the requested spaces. + repeated Space spaces = 1; + + // A token that can be used to retrieve the next page. If this field is empty, + // there are no subsequent pages. + string next_page_token = 2; + + // The total number of spaces that match the query, across all pages. If the + // result is over 10,000 spaces, this value is an estimate. + int32 total_size = 3; +} + +// Request for deleting a space. +message DeleteSpaceRequest { + // Required. Resource name of the space to delete. + // + // Format: `spaces/{space}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "chat.googleapis.com/Space" } + ]; + + // When `true`, the method runs using the user's Google Workspace + // administrator privileges. + // + // The calling user must be a Google Workspace administrator with the + // [manage chat and spaces conversations + // privilege](https://support.google.com/a/answer/13369245). + // + // Requires the `chat.admin.delete` [OAuth 2.0 + // scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + bool use_admin_access = 2; +} + +// Request message for completing the import process for a space. +message CompleteImportSpaceRequest { + // Required. Resource name of the import mode space. + // + // Format: `spaces/{space}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "chat.googleapis.com/Space" } + ]; +} + +// Response message for completing the import process for a space. +message CompleteImportSpaceResponse { + // The import mode space. + Space space = 1; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/space_event.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/space_event.proto new file mode 100644 index 00000000000..84379a096a4 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/space_event.proto @@ -0,0 +1,292 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/chat/v1/event_payload.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "SpaceEventProto"; +option java_package = "com.google.chat.v1"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// An event that represents a change or activity in a Google Chat space. To +// learn more, see [Work with events from Google +// Chat](https://developers.google.com/workspace/chat/events-overview). +message SpaceEvent { + option (google.api.resource) = { + type: "chat.googleapis.com/SpaceEvent" + pattern: "spaces/{space}/spaceEvents/{space_event}" + }; + + // Resource name of the space event. + // + // Format: `spaces/{space}/spaceEvents/{spaceEvent}` + string name = 1; + + // Time when the event occurred. + google.protobuf.Timestamp event_time = 3; + + // Type of space event. Each event type has a batch version, which + // represents multiple instances of the event type that occur in a short + // period of time. For `spaceEvents.list()` requests, omit batch event types + // in your query filter. By default, the server returns both event type and + // its batch version. + // + // Supported event types for + // [messages](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages): + // + // * New message: `google.workspace.chat.message.v1.created` + // * Updated message: `google.workspace.chat.message.v1.updated` + // * Deleted message: `google.workspace.chat.message.v1.deleted` + // * Multiple new messages: `google.workspace.chat.message.v1.batchCreated` + // * Multiple updated messages: + // `google.workspace.chat.message.v1.batchUpdated` + // * Multiple deleted messages: + // `google.workspace.chat.message.v1.batchDeleted` + // + // Supported event types for + // [memberships](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members): + // + // * New membership: `google.workspace.chat.membership.v1.created` + // * Updated membership: `google.workspace.chat.membership.v1.updated` + // * Deleted membership: `google.workspace.chat.membership.v1.deleted` + // * Multiple new memberships: + // `google.workspace.chat.membership.v1.batchCreated` + // * Multiple updated memberships: + // `google.workspace.chat.membership.v1.batchUpdated` + // * Multiple deleted memberships: + // `google.workspace.chat.membership.v1.batchDeleted` + // + // Supported event types for + // [reactions](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.reactions): + // + // * New reaction: `google.workspace.chat.reaction.v1.created` + // * Deleted reaction: `google.workspace.chat.reaction.v1.deleted` + // * Multiple new reactions: + // `google.workspace.chat.reaction.v1.batchCreated` + // * Multiple deleted reactions: + // `google.workspace.chat.reaction.v1.batchDeleted` + // + // Supported event types about the + // [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces): + // + // * Updated space: `google.workspace.chat.space.v1.updated` + // * Multiple space updates: `google.workspace.chat.space.v1.batchUpdated` + string event_type = 6; + + oneof payload { + // Event payload for a new message. + // + // Event type: `google.workspace.chat.message.v1.created` + MessageCreatedEventData message_created_event_data = 12; + + // Event payload for an updated message. + // + // Event type: `google.workspace.chat.message.v1.updated` + MessageUpdatedEventData message_updated_event_data = 13; + + // Event payload for a deleted message. + // + // Event type: `google.workspace.chat.message.v1.deleted` + MessageDeletedEventData message_deleted_event_data = 14; + + // Event payload for multiple new messages. + // + // Event type: `google.workspace.chat.message.v1.batchCreated` + MessageBatchCreatedEventData message_batch_created_event_data = 26; + + // Event payload for multiple updated messages. + // + // Event type: `google.workspace.chat.message.v1.batchUpdated` + MessageBatchUpdatedEventData message_batch_updated_event_data = 27; + + // Event payload for multiple deleted messages. + // + // Event type: `google.workspace.chat.message.v1.batchDeleted` + MessageBatchDeletedEventData message_batch_deleted_event_data = 28; + + // Event payload for a space update. + // + // Event type: `google.workspace.chat.space.v1.updated` + SpaceUpdatedEventData space_updated_event_data = 15; + + // Event payload for multiple updates to a space. + // + // Event type: `google.workspace.chat.space.v1.batchUpdated` + SpaceBatchUpdatedEventData space_batch_updated_event_data = 29; + + // Event payload for a new membership. + // + // Event type: `google.workspace.chat.membership.v1.created` + MembershipCreatedEventData membership_created_event_data = 17; + + // Event payload for an updated membership. + // + // Event type: `google.workspace.chat.membership.v1.updated` + MembershipUpdatedEventData membership_updated_event_data = 18; + + // Event payload for a deleted membership. + // + // Event type: `google.workspace.chat.membership.v1.deleted` + MembershipDeletedEventData membership_deleted_event_data = 219; + + // Event payload for multiple new memberships. + // + // Event type: `google.workspace.chat.membership.v1.batchCreated` + MembershipBatchCreatedEventData membership_batch_created_event_data = 31; + + // Event payload for multiple updated memberships. + // + // Event type: `google.workspace.chat.membership.v1.batchUpdated` + MembershipBatchUpdatedEventData membership_batch_updated_event_data = 32; + + // Event payload for multiple deleted memberships. + // + // Event type: `google.workspace.chat.membership.v1.batchDeleted` + MembershipBatchDeletedEventData membership_batch_deleted_event_data = 33; + + // Event payload for a new reaction. + // + // Event type: `google.workspace.chat.reaction.v1.created` + ReactionCreatedEventData reaction_created_event_data = 21; + + // Event payload for a deleted reaction. + // + // Event type: `google.workspace.chat.reaction.v1.deleted` + ReactionDeletedEventData reaction_deleted_event_data = 22; + + // Event payload for multiple new reactions. + // + // Event type: `google.workspace.chat.reaction.v1.batchCreated` + ReactionBatchCreatedEventData reaction_batch_created_event_data = 34; + + // Event payload for multiple deleted reactions. + // + // Event type: `google.workspace.chat.reaction.v1.batchDeleted` + ReactionBatchDeletedEventData reaction_batch_deleted_event_data = 35; + } +} + +// Request message for getting a space event. +message GetSpaceEventRequest { + // Required. The resource name of the space event. + // + // Format: `spaces/{space}/spaceEvents/{spaceEvent}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "chat.googleapis.com/SpaceEvent" } + ]; +} + +// Request message for listing space events. +message ListSpaceEventsRequest { + // Required. Resource name of the [Google Chat + // space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + // where the events occurred. + // + // Format: `spaces/{space}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "chat.googleapis.com/SpaceEvent" + } + ]; + + // Optional. The maximum number of space events returned. The service might + // return fewer than this value. + // + // Negative values return an `INVALID_ARGUMENT` error. + int32 page_size = 5; + + // A page token, received from a previous list space events call. Provide this + // to retrieve the subsequent page. + // + // When paginating, all other parameters provided to list space events must + // match the call that provided the page token. Passing different values to + // the other parameters might lead to unexpected results. + string page_token = 6; + + // Required. A query filter. + // + // You must specify at least one event type (`event_type`) + // using the has `:` operator. To filter by multiple event types, use the `OR` + // operator. Omit batch event types in your filter. The request automatically + // returns any related batch events. For example, if you filter by new + // reactions + // (`google.workspace.chat.reaction.v1.created`), the server also returns + // batch new reactions events + // (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + // event types, see the [`SpaceEvents` reference + // documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + // + // Optionally, you can also filter by start time (`start_time`) and + // end time (`end_time`): + // + // * `start_time`: Exclusive timestamp from which to start listing space + // events. + // You can list events that occurred up to 28 days ago. If unspecified, lists + // space events from the past 28 days. + // * `end_time`: Inclusive timestamp until which space events are listed. + // If unspecified, lists events up to the time of the request. + // + // To specify a start or end time, use the equals `=` operator and format in + // [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both + // `start_time` and `end_time`, use the `AND` operator. + // + // For example, the following queries are valid: + // + // ``` + // start_time="2023-08-23T19:20:33+00:00" AND + // end_time="2023-08-23T19:21:54+00:00" + // ``` + // ``` + // start_time="2023-08-23T19:20:33+00:00" AND + // (event_types:"google.workspace.chat.space.v1.updated" OR + // event_types:"google.workspace.chat.message.v1.created") + // ``` + // + // The following queries are invalid: + // + // ``` + // start_time="2023-08-23T19:20:33+00:00" OR + // end_time="2023-08-23T19:21:54+00:00" + // ``` + // ``` + // event_types:"google.workspace.chat.space.v1.updated" AND + // event_types:"google.workspace.chat.message.v1.created" + // ``` + // + // Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + // error. + string filter = 8 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for listing space events. +message ListSpaceEventsResponse { + // Results are returned in chronological order (oldest event first). + repeated SpaceEvent space_events = 1; + + // Continuation token used to fetch more events. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/space_read_state.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/space_read_state.proto new file mode 100644 index 00000000000..24c4f56b861 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/space_read_state.proto @@ -0,0 +1,113 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "SpaceReadStateProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// A user's read state within a space, used to identify read and unread +// messages. +message SpaceReadState { + option (google.api.resource) = { + type: "chat.googleapis.com/SpaceReadState" + pattern: "users/{user}/spaces/{space}/spaceReadState" + singular: "spaceReadState" + }; + + // Resource name of the space read state. + // + // Format: `users/{user}/spaces/{space}/spaceReadState` + string name = 1; + + // Optional. The time when the user's space read state was updated. Usually + // this corresponds with either the timestamp of the last read message, or a + // timestamp specified by the user to mark the last read position in a space. + google.protobuf.Timestamp last_read_time = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for GetSpaceReadState API. +message GetSpaceReadStateRequest { + // Required. Resource name of the space read state to retrieve. + // + // Only supports getting read state for the calling user. + // + // To refer to the calling user, set one of the following: + // + // - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`. + // + // - Their Workspace email address. For example, + // `users/user@example.com/spaces/{space}/spaceReadState`. + // + // - Their user id. For example, + // `users/123456789/spaces/{space}/spaceReadState`. + // + // Format: users/{user}/spaces/{space}/spaceReadState + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "chat.googleapis.com/SpaceReadState" + } + ]; +} + +// Request message for UpdateSpaceReadState API. +message UpdateSpaceReadStateRequest { + // Required. The space read state and fields to update. + // + // Only supports updating read state for the calling user. + // + // To refer to the calling user, set one of the following: + // + // - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`. + // + // - Their Workspace email address. For example, + // `users/user@example.com/spaces/{space}/spaceReadState`. + // + // - Their user id. For example, + // `users/123456789/spaces/{space}/spaceReadState`. + // + // Format: users/{user}/spaces/{space}/spaceReadState + SpaceReadState space_read_state = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The field paths to update. Currently supported field paths: + // + // - `last_read_time` + // + // When the `last_read_time` is before the latest message create time, the + // space appears as unread in the UI. + // + // To mark the space as read, set `last_read_time` to any value later (larger) + // than the latest message create time. The `last_read_time` is coerced to + // match the latest message create time. Note that the space read state only + // affects the read state of messages that are visible in the space's + // top-level conversation. Replies in threads are unaffected by this + // timestamp, and instead rely on the thread read state. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/space_setup.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/space_setup.proto new file mode 100644 index 00000000000..2377d28293a --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/space_setup.proto @@ -0,0 +1,97 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/field_behavior.proto"; +import "google/chat/v1/membership.proto"; +import "google/chat/v1/space.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "SpaceSetupProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// Request to create a space and add specified users to it. +message SetUpSpaceRequest { + // Required. The `Space.spaceType` field is required. + // + // To create a space, set `Space.spaceType` to `SPACE` and set + // `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when + // setting up a space, try a different `displayName`. An existing space + // within the Google Workspace organization might already use this display + // name. + // + // To create a group chat, set `Space.spaceType` to + // `GROUP_CHAT`. Don't set `Space.displayName`. + // + // To create a 1:1 conversation between humans, + // set `Space.spaceType` to `DIRECT_MESSAGE` and set + // `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or + // `Space.spaceDetails`. + // + // To create an 1:1 conversation between a human and the calling Chat app, set + // `Space.spaceType` to `DIRECT_MESSAGE` and + // `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or + // `Space.spaceDetails`. + // + // If a `DIRECT_MESSAGE` space already exists, that space is returned instead + // of creating a new space. + Space space = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. + // A random UUID is recommended. + // Specifying an existing request ID returns the space created with that ID + // instead of creating a new space. + // Specifying an existing request ID from the same Chat app with a different + // authenticated user returns an error. + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Google Chat users or groups to invite to join the space. Omit + // the calling user, as they are added automatically. + // + // The set currently allows up to 20 memberships (in addition to the caller). + // + // For human membership, the `Membership.member` field must contain a `user` + // with `name` populated (format: `users/{user}`) and `type` set to + // `User.Type.HUMAN`. You can only add human users when setting up a space + // (adding Chat apps is only supported for direct message setup with the + // calling app). You can also add members using the user's email as an alias + // for {user}. For example, the `user.name` can be `users/example@gmail.com`. + // To invite Gmail users or users from external Google Workspace domains, + // user's email must be used for `{user}`. + // + // For Google group membership, the `Membership.group_member` field must + // contain a `group` with `name` populated (format `groups/{group}`). You + // can only add Google groups when setting `Space.spaceType` to `SPACE`. + // + // Optional when setting `Space.spaceType` to `SPACE`. + // + // Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at + // least two memberships. + // + // Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human + // user, along with exactly one membership. + // + // Must be empty when creating a 1:1 conversation between a human and the + // calling Chat app (when setting `Space.spaceType` to + // `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). + repeated Membership memberships = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/thread_read_state.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/thread_read_state.proto new file mode 100644 index 00000000000..38c86feb7b3 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/thread_read_state.proto @@ -0,0 +1,75 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "ThreadReadStateProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// A user's read state within a thread, used to identify read and unread +// messages. +message ThreadReadState { + option (google.api.resource) = { + type: "chat.googleapis.com/ThreadReadState" + pattern: "users/{user}/spaces/{space}/threads/{thread}/threadReadState" + singular: "threadReadState" + }; + + // Resource name of the thread read state. + // + // Format: `users/{user}/spaces/{space}/threads/{thread}/threadReadState` + string name = 1; + + // The time when the user's thread read state was updated. Usually this + // corresponds with the timestamp of the last read message in a thread. + google.protobuf.Timestamp last_read_time = 2; +} + +// Request message for GetThreadReadStateRequest API. +message GetThreadReadStateRequest { + // Required. Resource name of the thread read state to retrieve. + // + // Only supports getting read state for the calling user. + // + // To refer to the calling user, set one of the following: + // + // - The `me` alias. For example, + // `users/me/spaces/{space}/threads/{thread}/threadReadState`. + // + // - Their Workspace email address. For example, + // `users/user@example.com/spaces/{space}/threads/{thread}/threadReadState`. + // + // - Their user id. For example, + // `users/123456789/spaces/{space}/threads/{thread}/threadReadState`. + // + // Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "chat.googleapis.com/ThreadReadState" + } + ]; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/user.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/user.proto new file mode 100644 index 00000000000..8e02de7608f --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/user.proto @@ -0,0 +1,84 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "UserProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// A user in Google Chat. +// When returned as an output from a request, if your Chat app [authenticates as +// a +// user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), +// the output for a `User` resource only populates the user's `name` and `type`. +message User { + enum Type { + // Default value for the enum. DO NOT USE. + TYPE_UNSPECIFIED = 0; + + // Human user. + HUMAN = 1; + + // Chat app user. + BOT = 2; + } + + // Resource name for a Google Chat [user][google.chat.v1.User]. + // + // Format: `users/{user}`. `users/app` can be used as an alias for the calling + // app [bot][google.chat.v1.User.Type.BOT] user. + // + // For [human users][google.chat.v1.User.Type.HUMAN], `{user}` is the same + // user identifier as: + // + // - the `id` for the + // [Person](https://developers.google.com/people/api/rest/v1/people) in the + // People API. For example, `users/123456789` in Chat API represents the same + // person as the `123456789` Person profile ID in People API. + // + // - the `id` for a + // [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + // in the Admin SDK Directory API. + // + // - the user's email address can be used as an alias for `{user}` in API + // requests. For example, if the People API Person profile ID for + // `user@example.com` is `123456789`, you can use `users/user@example.com` as + // an alias to reference `users/123456789`. Only the canonical resource name + // (for example `users/123456789`) will be returned from the API. + string name = 1; + + // Output only. The user's display name. + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Unique identifier of the user's Google Workspace domain. + string domain_id = 6; + + // User type. + Type type = 5; + + // Output only. When `true`, the user is deleted or their profile is not + // visible. + bool is_anonymous = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-chat/v1/protos/google/chat/v1/widgets.proto b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/widgets.proto new file mode 100644 index 00000000000..c28c969fec6 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/google/chat/v1/widgets.proto @@ -0,0 +1,278 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.chat.v1; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "WidgetsProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// A widget is a UI element that presents text and images. +message WidgetMarkup { + // A paragraph of text. Formatted text supported. For more information + // about formatting text, see + // [Formatting text in Google Chat + // apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) + // and + // [Formatting + // text in Google Workspace + // Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + message TextParagraph { + string text = 1; + } + + // The set of supported icons. + enum Icon { + ICON_UNSPECIFIED = 0; + + AIRPLANE = 1; + + BOOKMARK = 26; + + BUS = 25; + + CAR = 9; + + CLOCK = 2; + + CONFIRMATION_NUMBER_ICON = 12; + + DOLLAR = 14; + + DESCRIPTION = 27; + + EMAIL = 10; + + EVENT_PERFORMER = 20; + + EVENT_SEAT = 21; + + FLIGHT_ARRIVAL = 16; + + FLIGHT_DEPARTURE = 15; + + HOTEL = 6; + + HOTEL_ROOM_TYPE = 17; + + INVITE = 19; + + MAP_PIN = 3; + + MEMBERSHIP = 24; + + MULTIPLE_PEOPLE = 18; + + OFFER = 30; + + PERSON = 11; + + PHONE = 13; + + RESTAURANT_ICON = 7; + + SHOPPING_CART = 8; + + STAR = 5; + + STORE = 22; + + TICKET = 4; + + TRAIN = 23; + + VIDEO_CAMERA = 28; + + VIDEO_PLAY = 29; + } + + // A button. Can be a text button or an image button. + message Button { + oneof type { + // A button with text and `onclick` action. + TextButton text_button = 1; + + // A button with image and `onclick` action. + ImageButton image_button = 2; + } + } + + // A button with text and `onclick` action. + message TextButton { + // The text of the button. + string text = 1; + + // The `onclick` action of the button. + OnClick on_click = 2; + } + + // A UI element contains a key (label) and a value (content). This + // element can also contain some actions such as `onclick` button. + message KeyValue { + // At least one of icons, `top_label` and `bottom_label` must be defined. + oneof icons { + // An enum value that's replaced by the Chat API with the + // corresponding icon image. + Icon icon = 1; + + // The icon specified by a URL. + string icon_url = 2; + } + + // The text of the top label. Formatted text supported. For more information + // about formatting text, see + // [Formatting text in Google Chat + // apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) + // and + // [Formatting + // text in Google Workspace + // Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + string top_label = 3; + + // The text of the content. Formatted text supported and always required. + // For more information + // about formatting text, see + // [Formatting text in Google Chat + // apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) + // and + // [Formatting + // text in Google Workspace + // Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + string content = 4; + + // If the content should be multiline. + bool content_multiline = 9; + + // The text of the bottom label. Formatted text supported. For more + // information about formatting text, see [Formatting text in Google Chat + // apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) + // and + // [Formatting + // text in Google Workspace + // Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + string bottom_label = 5; + + // The `onclick` action. Only the top label, bottom label, and content + // region are clickable. + OnClick on_click = 6; + + // A control widget. You can set either `button` or `switch_widget`, + // but not both. + oneof control { + // A button that can be clicked to trigger an action. + Button button = 7; + } + } + + // An image that's specified by a URL and can have an `onclick` action. + message Image { + // The URL of the image. + string image_url = 1; + + // The `onclick` action. + OnClick on_click = 2; + + // The aspect ratio of this image (width and height). This field lets you + // reserve the right height for the image while waiting for it to load. + // It's not meant to override the built-in aspect ratio of the image. + // If unset, the server fills it by prefetching the image. + double aspect_ratio = 3; + } + + // An image button with an `onclick` action. + message ImageButton { + // The icon can be specified by an `Icon` `enum` or a URL. + oneof icons { + // The icon specified by an `enum` that indices to an icon provided by + // Chat API. + Icon icon = 1; + + // The icon specified by a URL. + string icon_url = 3; + } + + // The `onclick` action. + OnClick on_click = 2; + + // The name of this `image_button` that's used for accessibility. + // Default value is provided if this name isn't specified. + string name = 4; + } + + // An `onclick` action (for example, open a link). + message OnClick { + oneof data { + // A form action is triggered by this `onclick` action if specified. + FormAction action = 1; + + // This `onclick` action triggers an open link action if specified. + OpenLink open_link = 2; + } + } + + // A link that opens a new window. + message OpenLink { + // The URL to open. + string url = 1; + } + + // A form action describes the behavior when the form is submitted. + // For example, you can invoke Apps Script to handle the form. + message FormAction { + // List of string parameters to supply when the action method is invoked. + // For example, consider three snooze buttons: snooze now, snooze one day, + // snooze next week. You might use `action method = snooze()`, passing the + // snooze type and snooze time in the list of string parameters. + message ActionParameter { + // The name of the parameter for the action script. + string key = 1; + + // The value of the parameter. + string value = 2; + } + + // The method name is used to identify which part of the form triggered the + // form submission. This information is echoed back to the Chat app as part + // of the card click event. You can use the same method name for several + // elements that trigger a common behavior. + string action_method_name = 1; + + // List of action parameters. + repeated ActionParameter parameters = 2; + } + + // A `WidgetMarkup` can only have one of the following items. You can use + // multiple `WidgetMarkup` fields to display more items. + oneof data { + // Display a text paragraph in this widget. + TextParagraph text_paragraph = 1; + + // Display an image in this widget. + Image image = 2; + + // Display a key value item in this widget. + KeyValue key_value = 3; + } + + // A list of buttons. Buttons is also `oneof data` and only one of these + // fields should be set. + repeated Button buttons = 6; +} diff --git a/owl-bot-staging/google-chat/v1/protos/protos.d.ts b/owl-bot-staging/google-chat/v1/protos/protos.d.ts new file mode 100644 index 00000000000..70f2bb33112 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/protos.d.ts @@ -0,0 +1,24474 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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 protobuf. */ + namespace protobuf { + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of 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.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|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|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a 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; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace apps. */ + namespace apps { + + /** Namespace card. */ + namespace card { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Card. */ + interface ICard { + + /** Card header */ + header?: (google.apps.card.v1.Card.ICardHeader|null); + + /** Card sections */ + sections?: (google.apps.card.v1.Card.ISection[]|null); + + /** Card sectionDividerStyle */ + sectionDividerStyle?: (google.apps.card.v1.Card.DividerStyle|keyof typeof google.apps.card.v1.Card.DividerStyle|null); + + /** Card cardActions */ + cardActions?: (google.apps.card.v1.Card.ICardAction[]|null); + + /** Card name */ + name?: (string|null); + + /** Card fixedFooter */ + fixedFooter?: (google.apps.card.v1.Card.ICardFixedFooter|null); + + /** Card displayStyle */ + displayStyle?: (google.apps.card.v1.Card.DisplayStyle|keyof typeof google.apps.card.v1.Card.DisplayStyle|null); + + /** Card peekCardHeader */ + peekCardHeader?: (google.apps.card.v1.Card.ICardHeader|null); + } + + /** Represents a Card. */ + class Card implements ICard { + + /** + * Constructs a new Card. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.ICard); + + /** Card header. */ + public header?: (google.apps.card.v1.Card.ICardHeader|null); + + /** Card sections. */ + public sections: google.apps.card.v1.Card.ISection[]; + + /** Card sectionDividerStyle. */ + public sectionDividerStyle: (google.apps.card.v1.Card.DividerStyle|keyof typeof google.apps.card.v1.Card.DividerStyle); + + /** Card cardActions. */ + public cardActions: google.apps.card.v1.Card.ICardAction[]; + + /** Card name. */ + public name: string; + + /** Card fixedFooter. */ + public fixedFooter?: (google.apps.card.v1.Card.ICardFixedFooter|null); + + /** Card displayStyle. */ + public displayStyle: (google.apps.card.v1.Card.DisplayStyle|keyof typeof google.apps.card.v1.Card.DisplayStyle); + + /** Card peekCardHeader. */ + public peekCardHeader?: (google.apps.card.v1.Card.ICardHeader|null); + + /** + * Creates a new Card instance using the specified properties. + * @param [properties] Properties to set + * @returns Card instance + */ + public static create(properties?: google.apps.card.v1.ICard): google.apps.card.v1.Card; + + /** + * Encodes the specified Card message. Does not implicitly {@link google.apps.card.v1.Card.verify|verify} messages. + * @param message Card message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.ICard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Card message, length delimited. Does not implicitly {@link google.apps.card.v1.Card.verify|verify} messages. + * @param message Card message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.ICard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Card message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Card; + + /** + * Decodes a Card message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Card; + + /** + * Verifies a Card message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Card message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Card + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Card; + + /** + * Creates a plain object from a Card message. Also converts values to other types if specified. + * @param message Card + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Card, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Card to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Card + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Card { + + /** Properties of a CardHeader. */ + interface ICardHeader { + + /** CardHeader title */ + title?: (string|null); + + /** CardHeader subtitle */ + subtitle?: (string|null); + + /** CardHeader imageType */ + imageType?: (google.apps.card.v1.Widget.ImageType|keyof typeof google.apps.card.v1.Widget.ImageType|null); + + /** CardHeader imageUrl */ + imageUrl?: (string|null); + + /** CardHeader imageAltText */ + imageAltText?: (string|null); + } + + /** Represents a CardHeader. */ + class CardHeader implements ICardHeader { + + /** + * Constructs a new CardHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.Card.ICardHeader); + + /** CardHeader title. */ + public title: string; + + /** CardHeader subtitle. */ + public subtitle: string; + + /** CardHeader imageType. */ + public imageType: (google.apps.card.v1.Widget.ImageType|keyof typeof google.apps.card.v1.Widget.ImageType); + + /** CardHeader imageUrl. */ + public imageUrl: string; + + /** CardHeader imageAltText. */ + public imageAltText: string; + + /** + * Creates a new CardHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns CardHeader instance + */ + public static create(properties?: google.apps.card.v1.Card.ICardHeader): google.apps.card.v1.Card.CardHeader; + + /** + * Encodes the specified CardHeader message. Does not implicitly {@link google.apps.card.v1.Card.CardHeader.verify|verify} messages. + * @param message CardHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.Card.ICardHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CardHeader message, length delimited. Does not implicitly {@link google.apps.card.v1.Card.CardHeader.verify|verify} messages. + * @param message CardHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.Card.ICardHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CardHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CardHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Card.CardHeader; + + /** + * Decodes a CardHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CardHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Card.CardHeader; + + /** + * Verifies a CardHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CardHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CardHeader + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Card.CardHeader; + + /** + * Creates a plain object from a CardHeader message. Also converts values to other types if specified. + * @param message CardHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Card.CardHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CardHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CardHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Section. */ + interface ISection { + + /** Section header */ + header?: (string|null); + + /** Section widgets */ + widgets?: (google.apps.card.v1.IWidget[]|null); + + /** Section collapsible */ + collapsible?: (boolean|null); + + /** Section uncollapsibleWidgetsCount */ + uncollapsibleWidgetsCount?: (number|null); + } + + /** Represents a Section. */ + class Section implements ISection { + + /** + * Constructs a new Section. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.Card.ISection); + + /** Section header. */ + public header: string; + + /** Section widgets. */ + public widgets: google.apps.card.v1.IWidget[]; + + /** Section collapsible. */ + public collapsible: boolean; + + /** Section uncollapsibleWidgetsCount. */ + public uncollapsibleWidgetsCount: number; + + /** + * Creates a new Section instance using the specified properties. + * @param [properties] Properties to set + * @returns Section instance + */ + public static create(properties?: google.apps.card.v1.Card.ISection): google.apps.card.v1.Card.Section; + + /** + * Encodes the specified Section message. Does not implicitly {@link google.apps.card.v1.Card.Section.verify|verify} messages. + * @param message Section message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.Card.ISection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Section message, length delimited. Does not implicitly {@link google.apps.card.v1.Card.Section.verify|verify} messages. + * @param message Section message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.Card.ISection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Section message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Section + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Card.Section; + + /** + * Decodes a Section message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Section + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Card.Section; + + /** + * Verifies a Section message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Section message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Section + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Card.Section; + + /** + * Creates a plain object from a Section message. Also converts values to other types if specified. + * @param message Section + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Card.Section, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Section to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Section + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DividerStyle enum. */ + enum DividerStyle { + DIVIDER_STYLE_UNSPECIFIED = 0, + SOLID_DIVIDER = 1, + NO_DIVIDER = 2 + } + + /** Properties of a CardAction. */ + interface ICardAction { + + /** CardAction actionLabel */ + actionLabel?: (string|null); + + /** CardAction onClick */ + onClick?: (google.apps.card.v1.IOnClick|null); + } + + /** Represents a CardAction. */ + class CardAction implements ICardAction { + + /** + * Constructs a new CardAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.Card.ICardAction); + + /** CardAction actionLabel. */ + public actionLabel: string; + + /** CardAction onClick. */ + public onClick?: (google.apps.card.v1.IOnClick|null); + + /** + * Creates a new CardAction instance using the specified properties. + * @param [properties] Properties to set + * @returns CardAction instance + */ + public static create(properties?: google.apps.card.v1.Card.ICardAction): google.apps.card.v1.Card.CardAction; + + /** + * Encodes the specified CardAction message. Does not implicitly {@link google.apps.card.v1.Card.CardAction.verify|verify} messages. + * @param message CardAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.Card.ICardAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CardAction message, length delimited. Does not implicitly {@link google.apps.card.v1.Card.CardAction.verify|verify} messages. + * @param message CardAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.Card.ICardAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CardAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CardAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Card.CardAction; + + /** + * Decodes a CardAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CardAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Card.CardAction; + + /** + * Verifies a CardAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CardAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CardAction + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Card.CardAction; + + /** + * Creates a plain object from a CardAction message. Also converts values to other types if specified. + * @param message CardAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Card.CardAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CardAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CardAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CardFixedFooter. */ + interface ICardFixedFooter { + + /** CardFixedFooter primaryButton */ + primaryButton?: (google.apps.card.v1.IButton|null); + + /** CardFixedFooter secondaryButton */ + secondaryButton?: (google.apps.card.v1.IButton|null); + } + + /** Represents a CardFixedFooter. */ + class CardFixedFooter implements ICardFixedFooter { + + /** + * Constructs a new CardFixedFooter. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.Card.ICardFixedFooter); + + /** CardFixedFooter primaryButton. */ + public primaryButton?: (google.apps.card.v1.IButton|null); + + /** CardFixedFooter secondaryButton. */ + public secondaryButton?: (google.apps.card.v1.IButton|null); + + /** + * Creates a new CardFixedFooter instance using the specified properties. + * @param [properties] Properties to set + * @returns CardFixedFooter instance + */ + public static create(properties?: google.apps.card.v1.Card.ICardFixedFooter): google.apps.card.v1.Card.CardFixedFooter; + + /** + * Encodes the specified CardFixedFooter message. Does not implicitly {@link google.apps.card.v1.Card.CardFixedFooter.verify|verify} messages. + * @param message CardFixedFooter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.Card.ICardFixedFooter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CardFixedFooter message, length delimited. Does not implicitly {@link google.apps.card.v1.Card.CardFixedFooter.verify|verify} messages. + * @param message CardFixedFooter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.Card.ICardFixedFooter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CardFixedFooter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CardFixedFooter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Card.CardFixedFooter; + + /** + * Decodes a CardFixedFooter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CardFixedFooter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Card.CardFixedFooter; + + /** + * Verifies a CardFixedFooter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CardFixedFooter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CardFixedFooter + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Card.CardFixedFooter; + + /** + * Creates a plain object from a CardFixedFooter message. Also converts values to other types if specified. + * @param message CardFixedFooter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Card.CardFixedFooter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CardFixedFooter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CardFixedFooter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DisplayStyle enum. */ + enum DisplayStyle { + DISPLAY_STYLE_UNSPECIFIED = 0, + PEEK = 1, + REPLACE = 2 + } + } + + /** Properties of a Widget. */ + interface IWidget { + + /** Widget textParagraph */ + textParagraph?: (google.apps.card.v1.ITextParagraph|null); + + /** Widget image */ + image?: (google.apps.card.v1.IImage|null); + + /** Widget decoratedText */ + decoratedText?: (google.apps.card.v1.IDecoratedText|null); + + /** Widget buttonList */ + buttonList?: (google.apps.card.v1.IButtonList|null); + + /** Widget textInput */ + textInput?: (google.apps.card.v1.ITextInput|null); + + /** Widget selectionInput */ + selectionInput?: (google.apps.card.v1.ISelectionInput|null); + + /** Widget dateTimePicker */ + dateTimePicker?: (google.apps.card.v1.IDateTimePicker|null); + + /** Widget divider */ + divider?: (google.apps.card.v1.IDivider|null); + + /** Widget grid */ + grid?: (google.apps.card.v1.IGrid|null); + + /** Widget columns */ + columns?: (google.apps.card.v1.IColumns|null); + + /** Widget horizontalAlignment */ + horizontalAlignment?: (google.apps.card.v1.Widget.HorizontalAlignment|keyof typeof google.apps.card.v1.Widget.HorizontalAlignment|null); + } + + /** Represents a Widget. */ + class Widget implements IWidget { + + /** + * Constructs a new Widget. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IWidget); + + /** Widget textParagraph. */ + public textParagraph?: (google.apps.card.v1.ITextParagraph|null); + + /** Widget image. */ + public image?: (google.apps.card.v1.IImage|null); + + /** Widget decoratedText. */ + public decoratedText?: (google.apps.card.v1.IDecoratedText|null); + + /** Widget buttonList. */ + public buttonList?: (google.apps.card.v1.IButtonList|null); + + /** Widget textInput. */ + public textInput?: (google.apps.card.v1.ITextInput|null); + + /** Widget selectionInput. */ + public selectionInput?: (google.apps.card.v1.ISelectionInput|null); + + /** Widget dateTimePicker. */ + public dateTimePicker?: (google.apps.card.v1.IDateTimePicker|null); + + /** Widget divider. */ + public divider?: (google.apps.card.v1.IDivider|null); + + /** Widget grid. */ + public grid?: (google.apps.card.v1.IGrid|null); + + /** Widget columns. */ + public columns?: (google.apps.card.v1.IColumns|null); + + /** Widget horizontalAlignment. */ + public horizontalAlignment: (google.apps.card.v1.Widget.HorizontalAlignment|keyof typeof google.apps.card.v1.Widget.HorizontalAlignment); + + /** Widget data. */ + public data?: ("textParagraph"|"image"|"decoratedText"|"buttonList"|"textInput"|"selectionInput"|"dateTimePicker"|"divider"|"grid"|"columns"); + + /** + * Creates a new Widget instance using the specified properties. + * @param [properties] Properties to set + * @returns Widget instance + */ + public static create(properties?: google.apps.card.v1.IWidget): google.apps.card.v1.Widget; + + /** + * Encodes the specified Widget message. Does not implicitly {@link google.apps.card.v1.Widget.verify|verify} messages. + * @param message Widget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IWidget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Widget message, length delimited. Does not implicitly {@link google.apps.card.v1.Widget.verify|verify} messages. + * @param message Widget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IWidget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Widget message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Widget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Widget; + + /** + * Decodes a Widget message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Widget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Widget; + + /** + * Verifies a Widget message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Widget message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Widget + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Widget; + + /** + * Creates a plain object from a Widget message. Also converts values to other types if specified. + * @param message Widget + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Widget, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Widget to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Widget + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Widget { + + /** ImageType enum. */ + enum ImageType { + SQUARE = 0, + CIRCLE = 1 + } + + /** HorizontalAlignment enum. */ + enum HorizontalAlignment { + HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0, + START = 1, + CENTER = 2, + END = 3 + } + } + + /** Properties of a TextParagraph. */ + interface ITextParagraph { + + /** TextParagraph text */ + text?: (string|null); + } + + /** Represents a TextParagraph. */ + class TextParagraph implements ITextParagraph { + + /** + * Constructs a new TextParagraph. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.ITextParagraph); + + /** TextParagraph text. */ + public text: string; + + /** + * Creates a new TextParagraph instance using the specified properties. + * @param [properties] Properties to set + * @returns TextParagraph instance + */ + public static create(properties?: google.apps.card.v1.ITextParagraph): google.apps.card.v1.TextParagraph; + + /** + * Encodes the specified TextParagraph message. Does not implicitly {@link google.apps.card.v1.TextParagraph.verify|verify} messages. + * @param message TextParagraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.ITextParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextParagraph message, length delimited. Does not implicitly {@link google.apps.card.v1.TextParagraph.verify|verify} messages. + * @param message TextParagraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.ITextParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextParagraph message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextParagraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.TextParagraph; + + /** + * Decodes a TextParagraph message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextParagraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.TextParagraph; + + /** + * Verifies a TextParagraph message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextParagraph message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextParagraph + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.TextParagraph; + + /** + * Creates a plain object from a TextParagraph message. Also converts values to other types if specified. + * @param message TextParagraph + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.TextParagraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextParagraph to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextParagraph + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image imageUrl */ + imageUrl?: (string|null); + + /** Image onClick */ + onClick?: (google.apps.card.v1.IOnClick|null); + + /** Image altText */ + altText?: (string|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IImage); + + /** Image imageUrl. */ + public imageUrl: string; + + /** Image onClick. */ + public onClick?: (google.apps.card.v1.IOnClick|null); + + /** Image altText. */ + public altText: string; + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.apps.card.v1.IImage): google.apps.card.v1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.apps.card.v1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.apps.card.v1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Image; + + /** + * Verifies an Image message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Image + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Divider. */ + interface IDivider { + } + + /** Represents a Divider. */ + class Divider implements IDivider { + + /** + * Constructs a new Divider. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IDivider); + + /** + * Creates a new Divider instance using the specified properties. + * @param [properties] Properties to set + * @returns Divider instance + */ + public static create(properties?: google.apps.card.v1.IDivider): google.apps.card.v1.Divider; + + /** + * Encodes the specified Divider message. Does not implicitly {@link google.apps.card.v1.Divider.verify|verify} messages. + * @param message Divider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IDivider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Divider message, length delimited. Does not implicitly {@link google.apps.card.v1.Divider.verify|verify} messages. + * @param message Divider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IDivider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Divider message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Divider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Divider; + + /** + * Decodes a Divider message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Divider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Divider; + + /** + * Verifies a Divider message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Divider message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Divider + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Divider; + + /** + * Creates a plain object from a Divider message. Also converts values to other types if specified. + * @param message Divider + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Divider, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Divider to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Divider + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DecoratedText. */ + interface IDecoratedText { + + /** DecoratedText icon */ + icon?: (google.apps.card.v1.IIcon|null); + + /** DecoratedText startIcon */ + startIcon?: (google.apps.card.v1.IIcon|null); + + /** DecoratedText topLabel */ + topLabel?: (string|null); + + /** DecoratedText text */ + text?: (string|null); + + /** DecoratedText wrapText */ + wrapText?: (boolean|null); + + /** DecoratedText bottomLabel */ + bottomLabel?: (string|null); + + /** DecoratedText onClick */ + onClick?: (google.apps.card.v1.IOnClick|null); + + /** DecoratedText button */ + button?: (google.apps.card.v1.IButton|null); + + /** DecoratedText switchControl */ + switchControl?: (google.apps.card.v1.DecoratedText.ISwitchControl|null); + + /** DecoratedText endIcon */ + endIcon?: (google.apps.card.v1.IIcon|null); + } + + /** Represents a DecoratedText. */ + class DecoratedText implements IDecoratedText { + + /** + * Constructs a new DecoratedText. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IDecoratedText); + + /** DecoratedText icon. */ + public icon?: (google.apps.card.v1.IIcon|null); + + /** DecoratedText startIcon. */ + public startIcon?: (google.apps.card.v1.IIcon|null); + + /** DecoratedText topLabel. */ + public topLabel: string; + + /** DecoratedText text. */ + public text: string; + + /** DecoratedText wrapText. */ + public wrapText: boolean; + + /** DecoratedText bottomLabel. */ + public bottomLabel: string; + + /** DecoratedText onClick. */ + public onClick?: (google.apps.card.v1.IOnClick|null); + + /** DecoratedText button. */ + public button?: (google.apps.card.v1.IButton|null); + + /** DecoratedText switchControl. */ + public switchControl?: (google.apps.card.v1.DecoratedText.ISwitchControl|null); + + /** DecoratedText endIcon. */ + public endIcon?: (google.apps.card.v1.IIcon|null); + + /** DecoratedText control. */ + public control?: ("button"|"switchControl"|"endIcon"); + + /** + * Creates a new DecoratedText instance using the specified properties. + * @param [properties] Properties to set + * @returns DecoratedText instance + */ + public static create(properties?: google.apps.card.v1.IDecoratedText): google.apps.card.v1.DecoratedText; + + /** + * Encodes the specified DecoratedText message. Does not implicitly {@link google.apps.card.v1.DecoratedText.verify|verify} messages. + * @param message DecoratedText message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IDecoratedText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DecoratedText message, length delimited. Does not implicitly {@link google.apps.card.v1.DecoratedText.verify|verify} messages. + * @param message DecoratedText message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IDecoratedText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DecoratedText message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DecoratedText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.DecoratedText; + + /** + * Decodes a DecoratedText message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DecoratedText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.DecoratedText; + + /** + * Verifies a DecoratedText message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DecoratedText message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DecoratedText + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.DecoratedText; + + /** + * Creates a plain object from a DecoratedText message. Also converts values to other types if specified. + * @param message DecoratedText + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.DecoratedText, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DecoratedText to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DecoratedText + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DecoratedText { + + /** Properties of a SwitchControl. */ + interface ISwitchControl { + + /** SwitchControl name */ + name?: (string|null); + + /** SwitchControl value */ + value?: (string|null); + + /** SwitchControl selected */ + selected?: (boolean|null); + + /** SwitchControl onChangeAction */ + onChangeAction?: (google.apps.card.v1.IAction|null); + + /** SwitchControl controlType */ + controlType?: (google.apps.card.v1.DecoratedText.SwitchControl.ControlType|keyof typeof google.apps.card.v1.DecoratedText.SwitchControl.ControlType|null); + } + + /** Represents a SwitchControl. */ + class SwitchControl implements ISwitchControl { + + /** + * Constructs a new SwitchControl. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.DecoratedText.ISwitchControl); + + /** SwitchControl name. */ + public name: string; + + /** SwitchControl value. */ + public value: string; + + /** SwitchControl selected. */ + public selected: boolean; + + /** SwitchControl onChangeAction. */ + public onChangeAction?: (google.apps.card.v1.IAction|null); + + /** SwitchControl controlType. */ + public controlType: (google.apps.card.v1.DecoratedText.SwitchControl.ControlType|keyof typeof google.apps.card.v1.DecoratedText.SwitchControl.ControlType); + + /** + * Creates a new SwitchControl instance using the specified properties. + * @param [properties] Properties to set + * @returns SwitchControl instance + */ + public static create(properties?: google.apps.card.v1.DecoratedText.ISwitchControl): google.apps.card.v1.DecoratedText.SwitchControl; + + /** + * Encodes the specified SwitchControl message. Does not implicitly {@link google.apps.card.v1.DecoratedText.SwitchControl.verify|verify} messages. + * @param message SwitchControl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.DecoratedText.ISwitchControl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SwitchControl message, length delimited. Does not implicitly {@link google.apps.card.v1.DecoratedText.SwitchControl.verify|verify} messages. + * @param message SwitchControl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.DecoratedText.ISwitchControl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SwitchControl message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SwitchControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.DecoratedText.SwitchControl; + + /** + * Decodes a SwitchControl message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SwitchControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.DecoratedText.SwitchControl; + + /** + * Verifies a SwitchControl message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SwitchControl message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SwitchControl + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.DecoratedText.SwitchControl; + + /** + * Creates a plain object from a SwitchControl message. Also converts values to other types if specified. + * @param message SwitchControl + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.DecoratedText.SwitchControl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SwitchControl to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SwitchControl + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SwitchControl { + + /** ControlType enum. */ + enum ControlType { + SWITCH = 0, + CHECKBOX = 1, + CHECK_BOX = 2 + } + } + } + + /** Properties of a TextInput. */ + interface ITextInput { + + /** TextInput name */ + name?: (string|null); + + /** TextInput label */ + label?: (string|null); + + /** TextInput hintText */ + hintText?: (string|null); + + /** TextInput value */ + value?: (string|null); + + /** TextInput type */ + type?: (google.apps.card.v1.TextInput.Type|keyof typeof google.apps.card.v1.TextInput.Type|null); + + /** TextInput onChangeAction */ + onChangeAction?: (google.apps.card.v1.IAction|null); + + /** TextInput initialSuggestions */ + initialSuggestions?: (google.apps.card.v1.ISuggestions|null); + + /** TextInput autoCompleteAction */ + autoCompleteAction?: (google.apps.card.v1.IAction|null); + + /** TextInput placeholderText */ + placeholderText?: (string|null); + } + + /** Represents a TextInput. */ + class TextInput implements ITextInput { + + /** + * Constructs a new TextInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.ITextInput); + + /** TextInput name. */ + public name: string; + + /** TextInput label. */ + public label: string; + + /** TextInput hintText. */ + public hintText: string; + + /** TextInput value. */ + public value: string; + + /** TextInput type. */ + public type: (google.apps.card.v1.TextInput.Type|keyof typeof google.apps.card.v1.TextInput.Type); + + /** TextInput onChangeAction. */ + public onChangeAction?: (google.apps.card.v1.IAction|null); + + /** TextInput initialSuggestions. */ + public initialSuggestions?: (google.apps.card.v1.ISuggestions|null); + + /** TextInput autoCompleteAction. */ + public autoCompleteAction?: (google.apps.card.v1.IAction|null); + + /** TextInput placeholderText. */ + public placeholderText: string; + + /** + * Creates a new TextInput instance using the specified properties. + * @param [properties] Properties to set + * @returns TextInput instance + */ + public static create(properties?: google.apps.card.v1.ITextInput): google.apps.card.v1.TextInput; + + /** + * Encodes the specified TextInput message. Does not implicitly {@link google.apps.card.v1.TextInput.verify|verify} messages. + * @param message TextInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.apps.card.v1.TextInput.verify|verify} messages. + * @param message TextInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.TextInput; + + /** + * Decodes a TextInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.TextInput; + + /** + * Verifies a TextInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextInput + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.TextInput; + + /** + * Creates a plain object from a TextInput message. Also converts values to other types if specified. + * @param message TextInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.TextInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TextInput { + + /** Type enum. */ + enum Type { + SINGLE_LINE = 0, + MULTIPLE_LINE = 1 + } + } + + /** Properties of a Suggestions. */ + interface ISuggestions { + + /** Suggestions items */ + items?: (google.apps.card.v1.Suggestions.ISuggestionItem[]|null); + } + + /** Represents a Suggestions. */ + class Suggestions implements ISuggestions { + + /** + * Constructs a new Suggestions. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.ISuggestions); + + /** Suggestions items. */ + public items: google.apps.card.v1.Suggestions.ISuggestionItem[]; + + /** + * Creates a new Suggestions instance using the specified properties. + * @param [properties] Properties to set + * @returns Suggestions instance + */ + public static create(properties?: google.apps.card.v1.ISuggestions): google.apps.card.v1.Suggestions; + + /** + * Encodes the specified Suggestions message. Does not implicitly {@link google.apps.card.v1.Suggestions.verify|verify} messages. + * @param message Suggestions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.ISuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Suggestions message, length delimited. Does not implicitly {@link google.apps.card.v1.Suggestions.verify|verify} messages. + * @param message Suggestions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.ISuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Suggestions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Suggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Suggestions; + + /** + * Decodes a Suggestions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Suggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Suggestions; + + /** + * Verifies a Suggestions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Suggestions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Suggestions + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Suggestions; + + /** + * Creates a plain object from a Suggestions message. Also converts values to other types if specified. + * @param message Suggestions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Suggestions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Suggestions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Suggestions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Suggestions { + + /** Properties of a SuggestionItem. */ + interface ISuggestionItem { + + /** SuggestionItem text */ + text?: (string|null); + } + + /** Represents a SuggestionItem. */ + class SuggestionItem implements ISuggestionItem { + + /** + * Constructs a new SuggestionItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.Suggestions.ISuggestionItem); + + /** SuggestionItem text. */ + public text?: (string|null); + + /** SuggestionItem content. */ + public content?: "text"; + + /** + * Creates a new SuggestionItem instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionItem instance + */ + public static create(properties?: google.apps.card.v1.Suggestions.ISuggestionItem): google.apps.card.v1.Suggestions.SuggestionItem; + + /** + * Encodes the specified SuggestionItem message. Does not implicitly {@link google.apps.card.v1.Suggestions.SuggestionItem.verify|verify} messages. + * @param message SuggestionItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.Suggestions.ISuggestionItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionItem message, length delimited. Does not implicitly {@link google.apps.card.v1.Suggestions.SuggestionItem.verify|verify} messages. + * @param message SuggestionItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.Suggestions.ISuggestionItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Suggestions.SuggestionItem; + + /** + * Decodes a SuggestionItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Suggestions.SuggestionItem; + + /** + * Verifies a SuggestionItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionItem + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Suggestions.SuggestionItem; + + /** + * Creates a plain object from a SuggestionItem message. Also converts values to other types if specified. + * @param message SuggestionItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Suggestions.SuggestionItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SuggestionItem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ButtonList. */ + interface IButtonList { + + /** ButtonList buttons */ + buttons?: (google.apps.card.v1.IButton[]|null); + } + + /** Represents a ButtonList. */ + class ButtonList implements IButtonList { + + /** + * Constructs a new ButtonList. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IButtonList); + + /** ButtonList buttons. */ + public buttons: google.apps.card.v1.IButton[]; + + /** + * Creates a new ButtonList instance using the specified properties. + * @param [properties] Properties to set + * @returns ButtonList instance + */ + public static create(properties?: google.apps.card.v1.IButtonList): google.apps.card.v1.ButtonList; + + /** + * Encodes the specified ButtonList message. Does not implicitly {@link google.apps.card.v1.ButtonList.verify|verify} messages. + * @param message ButtonList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IButtonList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ButtonList message, length delimited. Does not implicitly {@link google.apps.card.v1.ButtonList.verify|verify} messages. + * @param message ButtonList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IButtonList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ButtonList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ButtonList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.ButtonList; + + /** + * Decodes a ButtonList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ButtonList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.ButtonList; + + /** + * Verifies a ButtonList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ButtonList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ButtonList + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.ButtonList; + + /** + * Creates a plain object from a ButtonList message. Also converts values to other types if specified. + * @param message ButtonList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.ButtonList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ButtonList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ButtonList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SelectionInput. */ + interface ISelectionInput { + + /** SelectionInput name */ + name?: (string|null); + + /** SelectionInput label */ + label?: (string|null); + + /** SelectionInput type */ + type?: (google.apps.card.v1.SelectionInput.SelectionType|keyof typeof google.apps.card.v1.SelectionInput.SelectionType|null); + + /** SelectionInput items */ + items?: (google.apps.card.v1.SelectionInput.ISelectionItem[]|null); + + /** SelectionInput onChangeAction */ + onChangeAction?: (google.apps.card.v1.IAction|null); + + /** SelectionInput multiSelectMaxSelectedItems */ + multiSelectMaxSelectedItems?: (number|null); + + /** SelectionInput multiSelectMinQueryLength */ + multiSelectMinQueryLength?: (number|null); + + /** SelectionInput externalDataSource */ + externalDataSource?: (google.apps.card.v1.IAction|null); + + /** SelectionInput platformDataSource */ + platformDataSource?: (google.apps.card.v1.SelectionInput.IPlatformDataSource|null); + } + + /** Represents a SelectionInput. */ + class SelectionInput implements ISelectionInput { + + /** + * Constructs a new SelectionInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.ISelectionInput); + + /** SelectionInput name. */ + public name: string; + + /** SelectionInput label. */ + public label: string; + + /** SelectionInput type. */ + public type: (google.apps.card.v1.SelectionInput.SelectionType|keyof typeof google.apps.card.v1.SelectionInput.SelectionType); + + /** SelectionInput items. */ + public items: google.apps.card.v1.SelectionInput.ISelectionItem[]; + + /** SelectionInput onChangeAction. */ + public onChangeAction?: (google.apps.card.v1.IAction|null); + + /** SelectionInput multiSelectMaxSelectedItems. */ + public multiSelectMaxSelectedItems: number; + + /** SelectionInput multiSelectMinQueryLength. */ + public multiSelectMinQueryLength: number; + + /** SelectionInput externalDataSource. */ + public externalDataSource?: (google.apps.card.v1.IAction|null); + + /** SelectionInput platformDataSource. */ + public platformDataSource?: (google.apps.card.v1.SelectionInput.IPlatformDataSource|null); + + /** SelectionInput multiSelectDataSource. */ + public multiSelectDataSource?: ("externalDataSource"|"platformDataSource"); + + /** + * Creates a new SelectionInput instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectionInput instance + */ + public static create(properties?: google.apps.card.v1.ISelectionInput): google.apps.card.v1.SelectionInput; + + /** + * Encodes the specified SelectionInput message. Does not implicitly {@link google.apps.card.v1.SelectionInput.verify|verify} messages. + * @param message SelectionInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.ISelectionInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectionInput message, length delimited. Does not implicitly {@link google.apps.card.v1.SelectionInput.verify|verify} messages. + * @param message SelectionInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.ISelectionInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectionInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.SelectionInput; + + /** + * Decodes a SelectionInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.SelectionInput; + + /** + * Verifies a SelectionInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectionInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectionInput + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.SelectionInput; + + /** + * Creates a plain object from a SelectionInput message. Also converts values to other types if specified. + * @param message SelectionInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.SelectionInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectionInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectionInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SelectionInput { + + /** SelectionType enum. */ + enum SelectionType { + CHECK_BOX = 0, + RADIO_BUTTON = 1, + SWITCH = 2, + DROPDOWN = 3, + MULTI_SELECT = 4 + } + + /** Properties of a SelectionItem. */ + interface ISelectionItem { + + /** SelectionItem text */ + text?: (string|null); + + /** SelectionItem value */ + value?: (string|null); + + /** SelectionItem selected */ + selected?: (boolean|null); + + /** SelectionItem startIconUri */ + startIconUri?: (string|null); + + /** SelectionItem bottomText */ + bottomText?: (string|null); + } + + /** Represents a SelectionItem. */ + class SelectionItem implements ISelectionItem { + + /** + * Constructs a new SelectionItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.SelectionInput.ISelectionItem); + + /** SelectionItem text. */ + public text: string; + + /** SelectionItem value. */ + public value: string; + + /** SelectionItem selected. */ + public selected: boolean; + + /** SelectionItem startIconUri. */ + public startIconUri: string; + + /** SelectionItem bottomText. */ + public bottomText: string; + + /** + * Creates a new SelectionItem instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectionItem instance + */ + public static create(properties?: google.apps.card.v1.SelectionInput.ISelectionItem): google.apps.card.v1.SelectionInput.SelectionItem; + + /** + * Encodes the specified SelectionItem message. Does not implicitly {@link google.apps.card.v1.SelectionInput.SelectionItem.verify|verify} messages. + * @param message SelectionItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.SelectionInput.ISelectionItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectionItem message, length delimited. Does not implicitly {@link google.apps.card.v1.SelectionInput.SelectionItem.verify|verify} messages. + * @param message SelectionItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.SelectionInput.ISelectionItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectionItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectionItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.SelectionInput.SelectionItem; + + /** + * Decodes a SelectionItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectionItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.SelectionInput.SelectionItem; + + /** + * Verifies a SelectionItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectionItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectionItem + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.SelectionInput.SelectionItem; + + /** + * Creates a plain object from a SelectionItem message. Also converts values to other types if specified. + * @param message SelectionItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.SelectionInput.SelectionItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectionItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectionItem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlatformDataSource. */ + interface IPlatformDataSource { + + /** PlatformDataSource commonDataSource */ + commonDataSource?: (google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource|keyof typeof google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource|null); + } + + /** Represents a PlatformDataSource. */ + class PlatformDataSource implements IPlatformDataSource { + + /** + * Constructs a new PlatformDataSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.SelectionInput.IPlatformDataSource); + + /** PlatformDataSource commonDataSource. */ + public commonDataSource?: (google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource|keyof typeof google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource|null); + + /** PlatformDataSource dataSource. */ + public dataSource?: "commonDataSource"; + + /** + * Creates a new PlatformDataSource instance using the specified properties. + * @param [properties] Properties to set + * @returns PlatformDataSource instance + */ + public static create(properties?: google.apps.card.v1.SelectionInput.IPlatformDataSource): google.apps.card.v1.SelectionInput.PlatformDataSource; + + /** + * Encodes the specified PlatformDataSource message. Does not implicitly {@link google.apps.card.v1.SelectionInput.PlatformDataSource.verify|verify} messages. + * @param message PlatformDataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.SelectionInput.IPlatformDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlatformDataSource message, length delimited. Does not implicitly {@link google.apps.card.v1.SelectionInput.PlatformDataSource.verify|verify} messages. + * @param message PlatformDataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.SelectionInput.IPlatformDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlatformDataSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlatformDataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.SelectionInput.PlatformDataSource; + + /** + * Decodes a PlatformDataSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlatformDataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.SelectionInput.PlatformDataSource; + + /** + * Verifies a PlatformDataSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PlatformDataSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlatformDataSource + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.SelectionInput.PlatformDataSource; + + /** + * Creates a plain object from a PlatformDataSource message. Also converts values to other types if specified. + * @param message PlatformDataSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.SelectionInput.PlatformDataSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlatformDataSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlatformDataSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PlatformDataSource { + + /** CommonDataSource enum. */ + enum CommonDataSource { + UNKNOWN = 0, + USER = 1 + } + } + } + + /** Properties of a DateTimePicker. */ + interface IDateTimePicker { + + /** DateTimePicker name */ + name?: (string|null); + + /** DateTimePicker label */ + label?: (string|null); + + /** DateTimePicker type */ + type?: (google.apps.card.v1.DateTimePicker.DateTimePickerType|keyof typeof google.apps.card.v1.DateTimePicker.DateTimePickerType|null); + + /** DateTimePicker valueMsEpoch */ + valueMsEpoch?: (number|Long|string|null); + + /** DateTimePicker timezoneOffsetDate */ + timezoneOffsetDate?: (number|null); + + /** DateTimePicker onChangeAction */ + onChangeAction?: (google.apps.card.v1.IAction|null); + } + + /** Represents a DateTimePicker. */ + class DateTimePicker implements IDateTimePicker { + + /** + * Constructs a new DateTimePicker. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IDateTimePicker); + + /** DateTimePicker name. */ + public name: string; + + /** DateTimePicker label. */ + public label: string; + + /** DateTimePicker type. */ + public type: (google.apps.card.v1.DateTimePicker.DateTimePickerType|keyof typeof google.apps.card.v1.DateTimePicker.DateTimePickerType); + + /** DateTimePicker valueMsEpoch. */ + public valueMsEpoch: (number|Long|string); + + /** DateTimePicker timezoneOffsetDate. */ + public timezoneOffsetDate: number; + + /** DateTimePicker onChangeAction. */ + public onChangeAction?: (google.apps.card.v1.IAction|null); + + /** + * Creates a new DateTimePicker instance using the specified properties. + * @param [properties] Properties to set + * @returns DateTimePicker instance + */ + public static create(properties?: google.apps.card.v1.IDateTimePicker): google.apps.card.v1.DateTimePicker; + + /** + * Encodes the specified DateTimePicker message. Does not implicitly {@link google.apps.card.v1.DateTimePicker.verify|verify} messages. + * @param message DateTimePicker message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IDateTimePicker, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateTimePicker message, length delimited. Does not implicitly {@link google.apps.card.v1.DateTimePicker.verify|verify} messages. + * @param message DateTimePicker message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IDateTimePicker, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateTimePicker message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateTimePicker + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.DateTimePicker; + + /** + * Decodes a DateTimePicker message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateTimePicker + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.DateTimePicker; + + /** + * Verifies a DateTimePicker message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DateTimePicker message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateTimePicker + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.DateTimePicker; + + /** + * Creates a plain object from a DateTimePicker message. Also converts values to other types if specified. + * @param message DateTimePicker + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.DateTimePicker, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateTimePicker to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateTimePicker + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DateTimePicker { + + /** DateTimePickerType enum. */ + enum DateTimePickerType { + DATE_AND_TIME = 0, + DATE_ONLY = 1, + TIME_ONLY = 2 + } + } + + /** Properties of a Button. */ + interface IButton { + + /** Button text */ + text?: (string|null); + + /** Button icon */ + icon?: (google.apps.card.v1.IIcon|null); + + /** Button color */ + color?: (google.type.IColor|null); + + /** Button onClick */ + onClick?: (google.apps.card.v1.IOnClick|null); + + /** Button disabled */ + disabled?: (boolean|null); + + /** Button altText */ + altText?: (string|null); + } + + /** Represents a Button. */ + class Button implements IButton { + + /** + * Constructs a new Button. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IButton); + + /** Button text. */ + public text: string; + + /** Button icon. */ + public icon?: (google.apps.card.v1.IIcon|null); + + /** Button color. */ + public color?: (google.type.IColor|null); + + /** Button onClick. */ + public onClick?: (google.apps.card.v1.IOnClick|null); + + /** Button disabled. */ + public disabled: boolean; + + /** Button altText. */ + public altText: string; + + /** + * Creates a new Button instance using the specified properties. + * @param [properties] Properties to set + * @returns Button instance + */ + public static create(properties?: google.apps.card.v1.IButton): google.apps.card.v1.Button; + + /** + * Encodes the specified Button message. Does not implicitly {@link google.apps.card.v1.Button.verify|verify} messages. + * @param message Button message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.apps.card.v1.Button.verify|verify} messages. + * @param message Button message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Button message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Button; + + /** + * Decodes a Button message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Button; + + /** + * Verifies a Button message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Button message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Button + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Button; + + /** + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @param message Button + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Button to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Button + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Icon. */ + interface IIcon { + + /** Icon knownIcon */ + knownIcon?: (string|null); + + /** Icon iconUrl */ + iconUrl?: (string|null); + + /** Icon materialIcon */ + materialIcon?: (google.apps.card.v1.IMaterialIcon|null); + + /** Icon altText */ + altText?: (string|null); + + /** Icon imageType */ + imageType?: (google.apps.card.v1.Widget.ImageType|keyof typeof google.apps.card.v1.Widget.ImageType|null); + } + + /** Represents an Icon. */ + class Icon implements IIcon { + + /** + * Constructs a new Icon. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IIcon); + + /** Icon knownIcon. */ + public knownIcon?: (string|null); + + /** Icon iconUrl. */ + public iconUrl?: (string|null); + + /** Icon materialIcon. */ + public materialIcon?: (google.apps.card.v1.IMaterialIcon|null); + + /** Icon altText. */ + public altText: string; + + /** Icon imageType. */ + public imageType: (google.apps.card.v1.Widget.ImageType|keyof typeof google.apps.card.v1.Widget.ImageType); + + /** Icon icons. */ + public icons?: ("knownIcon"|"iconUrl"|"materialIcon"); + + /** + * Creates a new Icon instance using the specified properties. + * @param [properties] Properties to set + * @returns Icon instance + */ + public static create(properties?: google.apps.card.v1.IIcon): google.apps.card.v1.Icon; + + /** + * Encodes the specified Icon message. Does not implicitly {@link google.apps.card.v1.Icon.verify|verify} messages. + * @param message Icon message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IIcon, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Icon message, length delimited. Does not implicitly {@link google.apps.card.v1.Icon.verify|verify} messages. + * @param message Icon message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IIcon, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Icon message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Icon + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Icon; + + /** + * Decodes an Icon message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Icon + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Icon; + + /** + * Verifies an Icon message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Icon message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Icon + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Icon; + + /** + * Creates a plain object from an Icon message. Also converts values to other types if specified. + * @param message Icon + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Icon, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Icon to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Icon + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaterialIcon. */ + interface IMaterialIcon { + + /** MaterialIcon name */ + name?: (string|null); + + /** MaterialIcon fill */ + fill?: (boolean|null); + + /** MaterialIcon weight */ + weight?: (number|null); + + /** MaterialIcon grade */ + grade?: (number|null); + } + + /** Represents a MaterialIcon. */ + class MaterialIcon implements IMaterialIcon { + + /** + * Constructs a new MaterialIcon. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IMaterialIcon); + + /** MaterialIcon name. */ + public name: string; + + /** MaterialIcon fill. */ + public fill: boolean; + + /** MaterialIcon weight. */ + public weight: number; + + /** MaterialIcon grade. */ + public grade: number; + + /** + * Creates a new MaterialIcon instance using the specified properties. + * @param [properties] Properties to set + * @returns MaterialIcon instance + */ + public static create(properties?: google.apps.card.v1.IMaterialIcon): google.apps.card.v1.MaterialIcon; + + /** + * Encodes the specified MaterialIcon message. Does not implicitly {@link google.apps.card.v1.MaterialIcon.verify|verify} messages. + * @param message MaterialIcon message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IMaterialIcon, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaterialIcon message, length delimited. Does not implicitly {@link google.apps.card.v1.MaterialIcon.verify|verify} messages. + * @param message MaterialIcon message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IMaterialIcon, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaterialIcon message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaterialIcon + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.MaterialIcon; + + /** + * Decodes a MaterialIcon message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaterialIcon + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.MaterialIcon; + + /** + * Verifies a MaterialIcon message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaterialIcon message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaterialIcon + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.MaterialIcon; + + /** + * Creates a plain object from a MaterialIcon message. Also converts values to other types if specified. + * @param message MaterialIcon + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.MaterialIcon, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaterialIcon to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaterialIcon + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageCropStyle. */ + interface IImageCropStyle { + + /** ImageCropStyle type */ + type?: (google.apps.card.v1.ImageCropStyle.ImageCropType|keyof typeof google.apps.card.v1.ImageCropStyle.ImageCropType|null); + + /** ImageCropStyle aspectRatio */ + aspectRatio?: (number|null); + } + + /** Represents an ImageCropStyle. */ + class ImageCropStyle implements IImageCropStyle { + + /** + * Constructs a new ImageCropStyle. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IImageCropStyle); + + /** ImageCropStyle type. */ + public type: (google.apps.card.v1.ImageCropStyle.ImageCropType|keyof typeof google.apps.card.v1.ImageCropStyle.ImageCropType); + + /** ImageCropStyle aspectRatio. */ + public aspectRatio: number; + + /** + * Creates a new ImageCropStyle instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageCropStyle instance + */ + public static create(properties?: google.apps.card.v1.IImageCropStyle): google.apps.card.v1.ImageCropStyle; + + /** + * Encodes the specified ImageCropStyle message. Does not implicitly {@link google.apps.card.v1.ImageCropStyle.verify|verify} messages. + * @param message ImageCropStyle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IImageCropStyle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageCropStyle message, length delimited. Does not implicitly {@link google.apps.card.v1.ImageCropStyle.verify|verify} messages. + * @param message ImageCropStyle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IImageCropStyle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageCropStyle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageCropStyle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.ImageCropStyle; + + /** + * Decodes an ImageCropStyle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageCropStyle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.ImageCropStyle; + + /** + * Verifies an ImageCropStyle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImageCropStyle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageCropStyle + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.ImageCropStyle; + + /** + * Creates a plain object from an ImageCropStyle message. Also converts values to other types if specified. + * @param message ImageCropStyle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.ImageCropStyle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageCropStyle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageCropStyle + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImageCropStyle { + + /** ImageCropType enum. */ + enum ImageCropType { + IMAGE_CROP_TYPE_UNSPECIFIED = 0, + SQUARE = 1, + CIRCLE = 2, + RECTANGLE_CUSTOM = 3, + RECTANGLE_4_3 = 4 + } + } + + /** Properties of a BorderStyle. */ + interface IBorderStyle { + + /** BorderStyle type */ + type?: (google.apps.card.v1.BorderStyle.BorderType|keyof typeof google.apps.card.v1.BorderStyle.BorderType|null); + + /** BorderStyle strokeColor */ + strokeColor?: (google.type.IColor|null); + + /** BorderStyle cornerRadius */ + cornerRadius?: (number|null); + } + + /** Represents a BorderStyle. */ + class BorderStyle implements IBorderStyle { + + /** + * Constructs a new BorderStyle. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IBorderStyle); + + /** BorderStyle type. */ + public type: (google.apps.card.v1.BorderStyle.BorderType|keyof typeof google.apps.card.v1.BorderStyle.BorderType); + + /** BorderStyle strokeColor. */ + public strokeColor?: (google.type.IColor|null); + + /** BorderStyle cornerRadius. */ + public cornerRadius: number; + + /** + * Creates a new BorderStyle instance using the specified properties. + * @param [properties] Properties to set + * @returns BorderStyle instance + */ + public static create(properties?: google.apps.card.v1.IBorderStyle): google.apps.card.v1.BorderStyle; + + /** + * Encodes the specified BorderStyle message. Does not implicitly {@link google.apps.card.v1.BorderStyle.verify|verify} messages. + * @param message BorderStyle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IBorderStyle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BorderStyle message, length delimited. Does not implicitly {@link google.apps.card.v1.BorderStyle.verify|verify} messages. + * @param message BorderStyle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IBorderStyle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BorderStyle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BorderStyle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.BorderStyle; + + /** + * Decodes a BorderStyle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BorderStyle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.BorderStyle; + + /** + * Verifies a BorderStyle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BorderStyle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BorderStyle + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.BorderStyle; + + /** + * Creates a plain object from a BorderStyle message. Also converts values to other types if specified. + * @param message BorderStyle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.BorderStyle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BorderStyle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BorderStyle + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BorderStyle { + + /** BorderType enum. */ + enum BorderType { + BORDER_TYPE_UNSPECIFIED = 0, + NO_BORDER = 1, + STROKE = 2 + } + } + + /** Properties of an ImageComponent. */ + interface IImageComponent { + + /** ImageComponent imageUri */ + imageUri?: (string|null); + + /** ImageComponent altText */ + altText?: (string|null); + + /** ImageComponent cropStyle */ + cropStyle?: (google.apps.card.v1.IImageCropStyle|null); + + /** ImageComponent borderStyle */ + borderStyle?: (google.apps.card.v1.IBorderStyle|null); + } + + /** Represents an ImageComponent. */ + class ImageComponent implements IImageComponent { + + /** + * Constructs a new ImageComponent. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IImageComponent); + + /** ImageComponent imageUri. */ + public imageUri: string; + + /** ImageComponent altText. */ + public altText: string; + + /** ImageComponent cropStyle. */ + public cropStyle?: (google.apps.card.v1.IImageCropStyle|null); + + /** ImageComponent borderStyle. */ + public borderStyle?: (google.apps.card.v1.IBorderStyle|null); + + /** + * Creates a new ImageComponent instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageComponent instance + */ + public static create(properties?: google.apps.card.v1.IImageComponent): google.apps.card.v1.ImageComponent; + + /** + * Encodes the specified ImageComponent message. Does not implicitly {@link google.apps.card.v1.ImageComponent.verify|verify} messages. + * @param message ImageComponent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IImageComponent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageComponent message, length delimited. Does not implicitly {@link google.apps.card.v1.ImageComponent.verify|verify} messages. + * @param message ImageComponent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IImageComponent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageComponent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageComponent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.ImageComponent; + + /** + * Decodes an ImageComponent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageComponent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.ImageComponent; + + /** + * Verifies an ImageComponent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImageComponent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageComponent + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.ImageComponent; + + /** + * Creates a plain object from an ImageComponent message. Also converts values to other types if specified. + * @param message ImageComponent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.ImageComponent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageComponent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageComponent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Grid. */ + interface IGrid { + + /** Grid title */ + title?: (string|null); + + /** Grid items */ + items?: (google.apps.card.v1.Grid.IGridItem[]|null); + + /** Grid borderStyle */ + borderStyle?: (google.apps.card.v1.IBorderStyle|null); + + /** Grid columnCount */ + columnCount?: (number|null); + + /** Grid onClick */ + onClick?: (google.apps.card.v1.IOnClick|null); + } + + /** Represents a Grid. */ + class Grid implements IGrid { + + /** + * Constructs a new Grid. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IGrid); + + /** Grid title. */ + public title: string; + + /** Grid items. */ + public items: google.apps.card.v1.Grid.IGridItem[]; + + /** Grid borderStyle. */ + public borderStyle?: (google.apps.card.v1.IBorderStyle|null); + + /** Grid columnCount. */ + public columnCount: number; + + /** Grid onClick. */ + public onClick?: (google.apps.card.v1.IOnClick|null); + + /** + * Creates a new Grid instance using the specified properties. + * @param [properties] Properties to set + * @returns Grid instance + */ + public static create(properties?: google.apps.card.v1.IGrid): google.apps.card.v1.Grid; + + /** + * Encodes the specified Grid message. Does not implicitly {@link google.apps.card.v1.Grid.verify|verify} messages. + * @param message Grid message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IGrid, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Grid message, length delimited. Does not implicitly {@link google.apps.card.v1.Grid.verify|verify} messages. + * @param message Grid message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IGrid, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Grid message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Grid + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Grid; + + /** + * Decodes a Grid message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Grid + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Grid; + + /** + * Verifies a Grid message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Grid message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Grid + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Grid; + + /** + * Creates a plain object from a Grid message. Also converts values to other types if specified. + * @param message Grid + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Grid, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Grid to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Grid + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Grid { + + /** Properties of a GridItem. */ + interface IGridItem { + + /** GridItem id */ + id?: (string|null); + + /** GridItem image */ + image?: (google.apps.card.v1.IImageComponent|null); + + /** GridItem title */ + title?: (string|null); + + /** GridItem subtitle */ + subtitle?: (string|null); + + /** GridItem layout */ + layout?: (google.apps.card.v1.Grid.GridItem.GridItemLayout|keyof typeof google.apps.card.v1.Grid.GridItem.GridItemLayout|null); + } + + /** Represents a GridItem. */ + class GridItem implements IGridItem { + + /** + * Constructs a new GridItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.Grid.IGridItem); + + /** GridItem id. */ + public id: string; + + /** GridItem image. */ + public image?: (google.apps.card.v1.IImageComponent|null); + + /** GridItem title. */ + public title: string; + + /** GridItem subtitle. */ + public subtitle: string; + + /** GridItem layout. */ + public layout: (google.apps.card.v1.Grid.GridItem.GridItemLayout|keyof typeof google.apps.card.v1.Grid.GridItem.GridItemLayout); + + /** + * Creates a new GridItem instance using the specified properties. + * @param [properties] Properties to set + * @returns GridItem instance + */ + public static create(properties?: google.apps.card.v1.Grid.IGridItem): google.apps.card.v1.Grid.GridItem; + + /** + * Encodes the specified GridItem message. Does not implicitly {@link google.apps.card.v1.Grid.GridItem.verify|verify} messages. + * @param message GridItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.Grid.IGridItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GridItem message, length delimited. Does not implicitly {@link google.apps.card.v1.Grid.GridItem.verify|verify} messages. + * @param message GridItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.Grid.IGridItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GridItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GridItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Grid.GridItem; + + /** + * Decodes a GridItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GridItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Grid.GridItem; + + /** + * Verifies a GridItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GridItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GridItem + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Grid.GridItem; + + /** + * Creates a plain object from a GridItem message. Also converts values to other types if specified. + * @param message GridItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Grid.GridItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GridItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GridItem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GridItem { + + /** GridItemLayout enum. */ + enum GridItemLayout { + GRID_ITEM_LAYOUT_UNSPECIFIED = 0, + TEXT_BELOW = 1, + TEXT_ABOVE = 2 + } + } + } + + /** Properties of a Columns. */ + interface IColumns { + + /** Columns columnItems */ + columnItems?: (google.apps.card.v1.Columns.IColumn[]|null); + } + + /** Represents a Columns. */ + class Columns implements IColumns { + + /** + * Constructs a new Columns. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IColumns); + + /** Columns columnItems. */ + public columnItems: google.apps.card.v1.Columns.IColumn[]; + + /** + * Creates a new Columns instance using the specified properties. + * @param [properties] Properties to set + * @returns Columns instance + */ + public static create(properties?: google.apps.card.v1.IColumns): google.apps.card.v1.Columns; + + /** + * Encodes the specified Columns message. Does not implicitly {@link google.apps.card.v1.Columns.verify|verify} messages. + * @param message Columns message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IColumns, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Columns message, length delimited. Does not implicitly {@link google.apps.card.v1.Columns.verify|verify} messages. + * @param message Columns message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IColumns, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Columns message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Columns + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Columns; + + /** + * Decodes a Columns message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Columns + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Columns; + + /** + * Verifies a Columns message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Columns message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Columns + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Columns; + + /** + * Creates a plain object from a Columns message. Also converts values to other types if specified. + * @param message Columns + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Columns, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Columns to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Columns + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Columns { + + /** Properties of a Column. */ + interface IColumn { + + /** Column horizontalSizeStyle */ + horizontalSizeStyle?: (google.apps.card.v1.Columns.Column.HorizontalSizeStyle|keyof typeof google.apps.card.v1.Columns.Column.HorizontalSizeStyle|null); + + /** Column horizontalAlignment */ + horizontalAlignment?: (google.apps.card.v1.Widget.HorizontalAlignment|keyof typeof google.apps.card.v1.Widget.HorizontalAlignment|null); + + /** Column verticalAlignment */ + verticalAlignment?: (google.apps.card.v1.Columns.Column.VerticalAlignment|keyof typeof google.apps.card.v1.Columns.Column.VerticalAlignment|null); + + /** Column widgets */ + widgets?: (google.apps.card.v1.Columns.Column.IWidgets[]|null); + } + + /** Represents a Column. */ + class Column implements IColumn { + + /** + * Constructs a new Column. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.Columns.IColumn); + + /** Column horizontalSizeStyle. */ + public horizontalSizeStyle: (google.apps.card.v1.Columns.Column.HorizontalSizeStyle|keyof typeof google.apps.card.v1.Columns.Column.HorizontalSizeStyle); + + /** Column horizontalAlignment. */ + public horizontalAlignment: (google.apps.card.v1.Widget.HorizontalAlignment|keyof typeof google.apps.card.v1.Widget.HorizontalAlignment); + + /** Column verticalAlignment. */ + public verticalAlignment: (google.apps.card.v1.Columns.Column.VerticalAlignment|keyof typeof google.apps.card.v1.Columns.Column.VerticalAlignment); + + /** Column widgets. */ + public widgets: google.apps.card.v1.Columns.Column.IWidgets[]; + + /** + * Creates a new Column instance using the specified properties. + * @param [properties] Properties to set + * @returns Column instance + */ + public static create(properties?: google.apps.card.v1.Columns.IColumn): google.apps.card.v1.Columns.Column; + + /** + * Encodes the specified Column message. Does not implicitly {@link google.apps.card.v1.Columns.Column.verify|verify} messages. + * @param message Column message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.Columns.IColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Column message, length delimited. Does not implicitly {@link google.apps.card.v1.Columns.Column.verify|verify} messages. + * @param message Column message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.Columns.IColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Column message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Columns.Column; + + /** + * Decodes a Column message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Columns.Column; + + /** + * Verifies a Column message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Column message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Column + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Columns.Column; + + /** + * Creates a plain object from a Column message. Also converts values to other types if specified. + * @param message Column + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Columns.Column, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Column to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Column + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Column { + + /** HorizontalSizeStyle enum. */ + enum HorizontalSizeStyle { + HORIZONTAL_SIZE_STYLE_UNSPECIFIED = 0, + FILL_AVAILABLE_SPACE = 1, + FILL_MINIMUM_SPACE = 2 + } + + /** VerticalAlignment enum. */ + enum VerticalAlignment { + VERTICAL_ALIGNMENT_UNSPECIFIED = 0, + CENTER = 1, + TOP = 2, + BOTTOM = 3 + } + + /** Properties of a Widgets. */ + interface IWidgets { + + /** Widgets textParagraph */ + textParagraph?: (google.apps.card.v1.ITextParagraph|null); + + /** Widgets image */ + image?: (google.apps.card.v1.IImage|null); + + /** Widgets decoratedText */ + decoratedText?: (google.apps.card.v1.IDecoratedText|null); + + /** Widgets buttonList */ + buttonList?: (google.apps.card.v1.IButtonList|null); + + /** Widgets textInput */ + textInput?: (google.apps.card.v1.ITextInput|null); + + /** Widgets selectionInput */ + selectionInput?: (google.apps.card.v1.ISelectionInput|null); + + /** Widgets dateTimePicker */ + dateTimePicker?: (google.apps.card.v1.IDateTimePicker|null); + } + + /** Represents a Widgets. */ + class Widgets implements IWidgets { + + /** + * Constructs a new Widgets. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.Columns.Column.IWidgets); + + /** Widgets textParagraph. */ + public textParagraph?: (google.apps.card.v1.ITextParagraph|null); + + /** Widgets image. */ + public image?: (google.apps.card.v1.IImage|null); + + /** Widgets decoratedText. */ + public decoratedText?: (google.apps.card.v1.IDecoratedText|null); + + /** Widgets buttonList. */ + public buttonList?: (google.apps.card.v1.IButtonList|null); + + /** Widgets textInput. */ + public textInput?: (google.apps.card.v1.ITextInput|null); + + /** Widgets selectionInput. */ + public selectionInput?: (google.apps.card.v1.ISelectionInput|null); + + /** Widgets dateTimePicker. */ + public dateTimePicker?: (google.apps.card.v1.IDateTimePicker|null); + + /** Widgets data. */ + public data?: ("textParagraph"|"image"|"decoratedText"|"buttonList"|"textInput"|"selectionInput"|"dateTimePicker"); + + /** + * Creates a new Widgets instance using the specified properties. + * @param [properties] Properties to set + * @returns Widgets instance + */ + public static create(properties?: google.apps.card.v1.Columns.Column.IWidgets): google.apps.card.v1.Columns.Column.Widgets; + + /** + * Encodes the specified Widgets message. Does not implicitly {@link google.apps.card.v1.Columns.Column.Widgets.verify|verify} messages. + * @param message Widgets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.Columns.Column.IWidgets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Widgets message, length delimited. Does not implicitly {@link google.apps.card.v1.Columns.Column.Widgets.verify|verify} messages. + * @param message Widgets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.Columns.Column.IWidgets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Widgets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Widgets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Columns.Column.Widgets; + + /** + * Decodes a Widgets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Widgets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Columns.Column.Widgets; + + /** + * Verifies a Widgets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Widgets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Widgets + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Columns.Column.Widgets; + + /** + * Creates a plain object from a Widgets message. Also converts values to other types if specified. + * @param message Widgets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Columns.Column.Widgets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Widgets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Widgets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an OnClick. */ + interface IOnClick { + + /** OnClick action */ + action?: (google.apps.card.v1.IAction|null); + + /** OnClick openLink */ + openLink?: (google.apps.card.v1.IOpenLink|null); + + /** OnClick openDynamicLinkAction */ + openDynamicLinkAction?: (google.apps.card.v1.IAction|null); + + /** OnClick card */ + card?: (google.apps.card.v1.ICard|null); + } + + /** Represents an OnClick. */ + class OnClick implements IOnClick { + + /** + * Constructs a new OnClick. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IOnClick); + + /** OnClick action. */ + public action?: (google.apps.card.v1.IAction|null); + + /** OnClick openLink. */ + public openLink?: (google.apps.card.v1.IOpenLink|null); + + /** OnClick openDynamicLinkAction. */ + public openDynamicLinkAction?: (google.apps.card.v1.IAction|null); + + /** OnClick card. */ + public card?: (google.apps.card.v1.ICard|null); + + /** OnClick data. */ + public data?: ("action"|"openLink"|"openDynamicLinkAction"|"card"); + + /** + * Creates a new OnClick instance using the specified properties. + * @param [properties] Properties to set + * @returns OnClick instance + */ + public static create(properties?: google.apps.card.v1.IOnClick): google.apps.card.v1.OnClick; + + /** + * Encodes the specified OnClick message. Does not implicitly {@link google.apps.card.v1.OnClick.verify|verify} messages. + * @param message OnClick message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IOnClick, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OnClick message, length delimited. Does not implicitly {@link google.apps.card.v1.OnClick.verify|verify} messages. + * @param message OnClick message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IOnClick, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OnClick message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnClick + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.OnClick; + + /** + * Decodes an OnClick message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnClick + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.OnClick; + + /** + * Verifies an OnClick message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OnClick message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnClick + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.OnClick; + + /** + * Creates a plain object from an OnClick message. Also converts values to other types if specified. + * @param message OnClick + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.OnClick, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OnClick to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnClick + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenLink. */ + interface IOpenLink { + + /** OpenLink url */ + url?: (string|null); + + /** OpenLink openAs */ + openAs?: (google.apps.card.v1.OpenLink.OpenAs|keyof typeof google.apps.card.v1.OpenLink.OpenAs|null); + + /** OpenLink onClose */ + onClose?: (google.apps.card.v1.OpenLink.OnClose|keyof typeof google.apps.card.v1.OpenLink.OnClose|null); + } + + /** Represents an OpenLink. */ + class OpenLink implements IOpenLink { + + /** + * Constructs a new OpenLink. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IOpenLink); + + /** OpenLink url. */ + public url: string; + + /** OpenLink openAs. */ + public openAs: (google.apps.card.v1.OpenLink.OpenAs|keyof typeof google.apps.card.v1.OpenLink.OpenAs); + + /** OpenLink onClose. */ + public onClose: (google.apps.card.v1.OpenLink.OnClose|keyof typeof google.apps.card.v1.OpenLink.OnClose); + + /** + * Creates a new OpenLink instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenLink instance + */ + public static create(properties?: google.apps.card.v1.IOpenLink): google.apps.card.v1.OpenLink; + + /** + * Encodes the specified OpenLink message. Does not implicitly {@link google.apps.card.v1.OpenLink.verify|verify} messages. + * @param message OpenLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IOpenLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenLink message, length delimited. Does not implicitly {@link google.apps.card.v1.OpenLink.verify|verify} messages. + * @param message OpenLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IOpenLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenLink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.OpenLink; + + /** + * Decodes an OpenLink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.OpenLink; + + /** + * Verifies an OpenLink message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OpenLink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenLink + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.OpenLink; + + /** + * Creates a plain object from an OpenLink message. Also converts values to other types if specified. + * @param message OpenLink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.OpenLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenLink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenLink + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OpenLink { + + /** OpenAs enum. */ + enum OpenAs { + FULL_SIZE = 0, + OVERLAY = 1 + } + + /** OnClose enum. */ + enum OnClose { + NOTHING = 0, + RELOAD = 1 + } + } + + /** Properties of an Action. */ + interface IAction { + + /** Action function */ + "function"?: (string|null); + + /** Action parameters */ + parameters?: (google.apps.card.v1.Action.IActionParameter[]|null); + + /** Action loadIndicator */ + loadIndicator?: (google.apps.card.v1.Action.LoadIndicator|keyof typeof google.apps.card.v1.Action.LoadIndicator|null); + + /** Action persistValues */ + persistValues?: (boolean|null); + + /** Action interaction */ + interaction?: (google.apps.card.v1.Action.Interaction|keyof typeof google.apps.card.v1.Action.Interaction|null); + } + + /** Represents an Action. */ + class Action implements IAction { + + /** + * Constructs a new Action. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.IAction); + + /** Action function. */ + public function: string; + + /** Action parameters. */ + public parameters: google.apps.card.v1.Action.IActionParameter[]; + + /** Action loadIndicator. */ + public loadIndicator: (google.apps.card.v1.Action.LoadIndicator|keyof typeof google.apps.card.v1.Action.LoadIndicator); + + /** Action persistValues. */ + public persistValues: boolean; + + /** Action interaction. */ + public interaction: (google.apps.card.v1.Action.Interaction|keyof typeof google.apps.card.v1.Action.Interaction); + + /** + * Creates a new Action instance using the specified properties. + * @param [properties] Properties to set + * @returns Action instance + */ + public static create(properties?: google.apps.card.v1.IAction): google.apps.card.v1.Action; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.apps.card.v1.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.apps.card.v1.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Action message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Action; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Action; + + /** + * Verifies an Action message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Action + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Action; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @param message Action + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Action to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Action + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Action { + + /** Properties of an ActionParameter. */ + interface IActionParameter { + + /** ActionParameter key */ + key?: (string|null); + + /** ActionParameter value */ + value?: (string|null); + } + + /** Represents an ActionParameter. */ + class ActionParameter implements IActionParameter { + + /** + * Constructs a new ActionParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.card.v1.Action.IActionParameter); + + /** ActionParameter key. */ + public key: string; + + /** ActionParameter value. */ + public value: string; + + /** + * Creates a new ActionParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns ActionParameter instance + */ + public static create(properties?: google.apps.card.v1.Action.IActionParameter): google.apps.card.v1.Action.ActionParameter; + + /** + * Encodes the specified ActionParameter message. Does not implicitly {@link google.apps.card.v1.Action.ActionParameter.verify|verify} messages. + * @param message ActionParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.card.v1.Action.IActionParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActionParameter message, length delimited. Does not implicitly {@link google.apps.card.v1.Action.ActionParameter.verify|verify} messages. + * @param message ActionParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.card.v1.Action.IActionParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActionParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActionParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.card.v1.Action.ActionParameter; + + /** + * Decodes an ActionParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActionParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.card.v1.Action.ActionParameter; + + /** + * Verifies an ActionParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActionParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActionParameter + */ + public static fromObject(object: { [k: string]: any }): google.apps.card.v1.Action.ActionParameter; + + /** + * Creates a plain object from an ActionParameter message. Also converts values to other types if specified. + * @param message ActionParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.card.v1.Action.ActionParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActionParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActionParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LoadIndicator enum. */ + enum LoadIndicator { + SPINNER = 0, + NONE = 1 + } + + /** Interaction enum. */ + enum Interaction { + INTERACTION_UNSPECIFIED = 0, + OPEN_DIALOG = 1 + } + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Color. */ + interface IColor { + + /** Color red */ + red?: (number|null); + + /** Color green */ + green?: (number|null); + + /** Color blue */ + blue?: (number|null); + + /** Color alpha */ + alpha?: (google.protobuf.IFloatValue|null); + } + + /** Represents a Color. */ + class Color implements IColor { + + /** + * Constructs a new Color. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IColor); + + /** Color red. */ + public red: number; + + /** Color green. */ + public green: number; + + /** Color blue. */ + public blue: number; + + /** Color alpha. */ + public alpha?: (google.protobuf.IFloatValue|null); + + /** + * Creates a new Color instance using the specified properties. + * @param [properties] Properties to set + * @returns Color instance + */ + public static create(properties?: google.type.IColor): google.type.Color; + + /** + * Encodes the specified Color message. Does not implicitly {@link google.type.Color.verify|verify} messages. + * @param message Color message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Color message, length delimited. Does not implicitly {@link google.type.Color.verify|verify} messages. + * @param message Color message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Color message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Color; + + /** + * Decodes a Color message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Color; + + /** + * Verifies a Color message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Color message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Color + */ + public static fromObject(object: { [k: string]: any }): google.type.Color; + + /** + * Creates a plain object from a Color message. Also converts values to other types if specified. + * @param message Color + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Color, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Color to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Color + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace chat. */ + namespace chat { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an ActionStatus. */ + interface IActionStatus { + + /** ActionStatus statusCode */ + statusCode?: (google.rpc.Code|keyof typeof google.rpc.Code|null); + + /** ActionStatus userFacingMessage */ + userFacingMessage?: (string|null); + } + + /** Represents an ActionStatus. */ + class ActionStatus implements IActionStatus { + + /** + * Constructs a new ActionStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IActionStatus); + + /** ActionStatus statusCode. */ + public statusCode: (google.rpc.Code|keyof typeof google.rpc.Code); + + /** ActionStatus userFacingMessage. */ + public userFacingMessage: string; + + /** + * Creates a new ActionStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ActionStatus instance + */ + public static create(properties?: google.chat.v1.IActionStatus): google.chat.v1.ActionStatus; + + /** + * Encodes the specified ActionStatus message. Does not implicitly {@link google.chat.v1.ActionStatus.verify|verify} messages. + * @param message ActionStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IActionStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActionStatus message, length delimited. Does not implicitly {@link google.chat.v1.ActionStatus.verify|verify} messages. + * @param message ActionStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IActionStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActionStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ActionStatus; + + /** + * Decodes an ActionStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ActionStatus; + + /** + * Verifies an ActionStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActionStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActionStatus + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ActionStatus; + + /** + * Creates a plain object from an ActionStatus message. Also converts values to other types if specified. + * @param message ActionStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ActionStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActionStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActionStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation type */ + type?: (google.chat.v1.AnnotationType|keyof typeof google.chat.v1.AnnotationType|null); + + /** Annotation startIndex */ + startIndex?: (number|null); + + /** Annotation length */ + length?: (number|null); + + /** Annotation userMention */ + userMention?: (google.chat.v1.IUserMentionMetadata|null); + + /** Annotation slashCommand */ + slashCommand?: (google.chat.v1.ISlashCommandMetadata|null); + + /** Annotation richLinkMetadata */ + richLinkMetadata?: (google.chat.v1.IRichLinkMetadata|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IAnnotation); + + /** Annotation type. */ + public type: (google.chat.v1.AnnotationType|keyof typeof google.chat.v1.AnnotationType); + + /** Annotation startIndex. */ + public startIndex?: (number|null); + + /** Annotation length. */ + public length: number; + + /** Annotation userMention. */ + public userMention?: (google.chat.v1.IUserMentionMetadata|null); + + /** Annotation slashCommand. */ + public slashCommand?: (google.chat.v1.ISlashCommandMetadata|null); + + /** Annotation richLinkMetadata. */ + public richLinkMetadata?: (google.chat.v1.IRichLinkMetadata|null); + + /** Annotation _startIndex. */ + public _startIndex?: "startIndex"; + + /** Annotation metadata. */ + public metadata?: ("userMention"|"slashCommand"|"richLinkMetadata"); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.chat.v1.IAnnotation): google.chat.v1.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.chat.v1.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.chat.v1.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.chat.v1.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.chat.v1.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.chat.v1.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.chat.v1.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.chat.v1.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.chat.v1.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; + } + + /** Properties of a UserMentionMetadata. */ + interface IUserMentionMetadata { + + /** UserMentionMetadata user */ + user?: (google.chat.v1.IUser|null); + + /** UserMentionMetadata type */ + type?: (google.chat.v1.UserMentionMetadata.Type|keyof typeof google.chat.v1.UserMentionMetadata.Type|null); + } + + /** Represents a UserMentionMetadata. */ + class UserMentionMetadata implements IUserMentionMetadata { + + /** + * Constructs a new UserMentionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IUserMentionMetadata); + + /** UserMentionMetadata user. */ + public user?: (google.chat.v1.IUser|null); + + /** UserMentionMetadata type. */ + public type: (google.chat.v1.UserMentionMetadata.Type|keyof typeof google.chat.v1.UserMentionMetadata.Type); + + /** + * Creates a new UserMentionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UserMentionMetadata instance + */ + public static create(properties?: google.chat.v1.IUserMentionMetadata): google.chat.v1.UserMentionMetadata; + + /** + * Encodes the specified UserMentionMetadata message. Does not implicitly {@link google.chat.v1.UserMentionMetadata.verify|verify} messages. + * @param message UserMentionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IUserMentionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserMentionMetadata message, length delimited. Does not implicitly {@link google.chat.v1.UserMentionMetadata.verify|verify} messages. + * @param message UserMentionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IUserMentionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserMentionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserMentionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.UserMentionMetadata; + + /** + * Decodes a UserMentionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserMentionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.UserMentionMetadata; + + /** + * Verifies a UserMentionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserMentionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserMentionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.UserMentionMetadata; + + /** + * Creates a plain object from a UserMentionMetadata message. Also converts values to other types if specified. + * @param message UserMentionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.UserMentionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserMentionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserMentionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UserMentionMetadata { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ADD = 1, + MENTION = 2 + } + } + + /** Properties of a SlashCommandMetadata. */ + interface ISlashCommandMetadata { + + /** SlashCommandMetadata bot */ + bot?: (google.chat.v1.IUser|null); + + /** SlashCommandMetadata type */ + type?: (google.chat.v1.SlashCommandMetadata.Type|keyof typeof google.chat.v1.SlashCommandMetadata.Type|null); + + /** SlashCommandMetadata commandName */ + commandName?: (string|null); + + /** SlashCommandMetadata commandId */ + commandId?: (number|Long|string|null); + + /** SlashCommandMetadata triggersDialog */ + triggersDialog?: (boolean|null); + } + + /** Represents a SlashCommandMetadata. */ + class SlashCommandMetadata implements ISlashCommandMetadata { + + /** + * Constructs a new SlashCommandMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ISlashCommandMetadata); + + /** SlashCommandMetadata bot. */ + public bot?: (google.chat.v1.IUser|null); + + /** SlashCommandMetadata type. */ + public type: (google.chat.v1.SlashCommandMetadata.Type|keyof typeof google.chat.v1.SlashCommandMetadata.Type); + + /** SlashCommandMetadata commandName. */ + public commandName: string; + + /** SlashCommandMetadata commandId. */ + public commandId: (number|Long|string); + + /** SlashCommandMetadata triggersDialog. */ + public triggersDialog: boolean; + + /** + * Creates a new SlashCommandMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns SlashCommandMetadata instance + */ + public static create(properties?: google.chat.v1.ISlashCommandMetadata): google.chat.v1.SlashCommandMetadata; + + /** + * Encodes the specified SlashCommandMetadata message. Does not implicitly {@link google.chat.v1.SlashCommandMetadata.verify|verify} messages. + * @param message SlashCommandMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ISlashCommandMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SlashCommandMetadata message, length delimited. Does not implicitly {@link google.chat.v1.SlashCommandMetadata.verify|verify} messages. + * @param message SlashCommandMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ISlashCommandMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SlashCommandMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SlashCommandMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.SlashCommandMetadata; + + /** + * Decodes a SlashCommandMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SlashCommandMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.SlashCommandMetadata; + + /** + * Verifies a SlashCommandMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SlashCommandMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SlashCommandMetadata + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.SlashCommandMetadata; + + /** + * Creates a plain object from a SlashCommandMetadata message. Also converts values to other types if specified. + * @param message SlashCommandMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.SlashCommandMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SlashCommandMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SlashCommandMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SlashCommandMetadata { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ADD = 1, + INVOKE = 2 + } + } + + /** Properties of a RichLinkMetadata. */ + interface IRichLinkMetadata { + + /** RichLinkMetadata uri */ + uri?: (string|null); + + /** RichLinkMetadata richLinkType */ + richLinkType?: (google.chat.v1.RichLinkMetadata.RichLinkType|keyof typeof google.chat.v1.RichLinkMetadata.RichLinkType|null); + + /** RichLinkMetadata driveLinkData */ + driveLinkData?: (google.chat.v1.IDriveLinkData|null); + + /** RichLinkMetadata chatSpaceLinkData */ + chatSpaceLinkData?: (google.chat.v1.IChatSpaceLinkData|null); + } + + /** Represents a RichLinkMetadata. */ + class RichLinkMetadata implements IRichLinkMetadata { + + /** + * Constructs a new RichLinkMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IRichLinkMetadata); + + /** RichLinkMetadata uri. */ + public uri: string; + + /** RichLinkMetadata richLinkType. */ + public richLinkType: (google.chat.v1.RichLinkMetadata.RichLinkType|keyof typeof google.chat.v1.RichLinkMetadata.RichLinkType); + + /** RichLinkMetadata driveLinkData. */ + public driveLinkData?: (google.chat.v1.IDriveLinkData|null); + + /** RichLinkMetadata chatSpaceLinkData. */ + public chatSpaceLinkData?: (google.chat.v1.IChatSpaceLinkData|null); + + /** RichLinkMetadata data. */ + public data?: ("driveLinkData"|"chatSpaceLinkData"); + + /** + * Creates a new RichLinkMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RichLinkMetadata instance + */ + public static create(properties?: google.chat.v1.IRichLinkMetadata): google.chat.v1.RichLinkMetadata; + + /** + * Encodes the specified RichLinkMetadata message. Does not implicitly {@link google.chat.v1.RichLinkMetadata.verify|verify} messages. + * @param message RichLinkMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IRichLinkMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RichLinkMetadata message, length delimited. Does not implicitly {@link google.chat.v1.RichLinkMetadata.verify|verify} messages. + * @param message RichLinkMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IRichLinkMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RichLinkMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RichLinkMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.RichLinkMetadata; + + /** + * Decodes a RichLinkMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RichLinkMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.RichLinkMetadata; + + /** + * Verifies a RichLinkMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RichLinkMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RichLinkMetadata + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.RichLinkMetadata; + + /** + * Creates a plain object from a RichLinkMetadata message. Also converts values to other types if specified. + * @param message RichLinkMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.RichLinkMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RichLinkMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RichLinkMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RichLinkMetadata { + + /** RichLinkType enum. */ + enum RichLinkType { + RICH_LINK_TYPE_UNSPECIFIED = 0, + DRIVE_FILE = 1, + CHAT_SPACE = 2 + } + } + + /** Properties of a DriveLinkData. */ + interface IDriveLinkData { + + /** DriveLinkData driveDataRef */ + driveDataRef?: (google.chat.v1.IDriveDataRef|null); + + /** DriveLinkData mimeType */ + mimeType?: (string|null); + } + + /** Represents a DriveLinkData. */ + class DriveLinkData implements IDriveLinkData { + + /** + * Constructs a new DriveLinkData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IDriveLinkData); + + /** DriveLinkData driveDataRef. */ + public driveDataRef?: (google.chat.v1.IDriveDataRef|null); + + /** DriveLinkData mimeType. */ + public mimeType: string; + + /** + * Creates a new DriveLinkData instance using the specified properties. + * @param [properties] Properties to set + * @returns DriveLinkData instance + */ + public static create(properties?: google.chat.v1.IDriveLinkData): google.chat.v1.DriveLinkData; + + /** + * Encodes the specified DriveLinkData message. Does not implicitly {@link google.chat.v1.DriveLinkData.verify|verify} messages. + * @param message DriveLinkData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IDriveLinkData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DriveLinkData message, length delimited. Does not implicitly {@link google.chat.v1.DriveLinkData.verify|verify} messages. + * @param message DriveLinkData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IDriveLinkData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DriveLinkData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DriveLinkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DriveLinkData; + + /** + * Decodes a DriveLinkData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DriveLinkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DriveLinkData; + + /** + * Verifies a DriveLinkData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DriveLinkData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DriveLinkData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.DriveLinkData; + + /** + * Creates a plain object from a DriveLinkData message. Also converts values to other types if specified. + * @param message DriveLinkData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.DriveLinkData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DriveLinkData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DriveLinkData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChatSpaceLinkData. */ + interface IChatSpaceLinkData { + + /** ChatSpaceLinkData space */ + space?: (string|null); + + /** ChatSpaceLinkData thread */ + thread?: (string|null); + + /** ChatSpaceLinkData message */ + message?: (string|null); + } + + /** Represents a ChatSpaceLinkData. */ + class ChatSpaceLinkData implements IChatSpaceLinkData { + + /** + * Constructs a new ChatSpaceLinkData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IChatSpaceLinkData); + + /** ChatSpaceLinkData space. */ + public space: string; + + /** ChatSpaceLinkData thread. */ + public thread: string; + + /** ChatSpaceLinkData message. */ + public message: string; + + /** + * Creates a new ChatSpaceLinkData instance using the specified properties. + * @param [properties] Properties to set + * @returns ChatSpaceLinkData instance + */ + public static create(properties?: google.chat.v1.IChatSpaceLinkData): google.chat.v1.ChatSpaceLinkData; + + /** + * Encodes the specified ChatSpaceLinkData message. Does not implicitly {@link google.chat.v1.ChatSpaceLinkData.verify|verify} messages. + * @param message ChatSpaceLinkData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IChatSpaceLinkData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChatSpaceLinkData message, length delimited. Does not implicitly {@link google.chat.v1.ChatSpaceLinkData.verify|verify} messages. + * @param message ChatSpaceLinkData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IChatSpaceLinkData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChatSpaceLinkData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChatSpaceLinkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ChatSpaceLinkData; + + /** + * Decodes a ChatSpaceLinkData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChatSpaceLinkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ChatSpaceLinkData; + + /** + * Verifies a ChatSpaceLinkData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChatSpaceLinkData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChatSpaceLinkData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ChatSpaceLinkData; + + /** + * Creates a plain object from a ChatSpaceLinkData message. Also converts values to other types if specified. + * @param message ChatSpaceLinkData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ChatSpaceLinkData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChatSpaceLinkData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChatSpaceLinkData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** AnnotationType enum. */ + enum AnnotationType { + ANNOTATION_TYPE_UNSPECIFIED = 0, + USER_MENTION = 1, + SLASH_COMMAND = 2, + RICH_LINK = 3 + } + + /** Properties of an Attachment. */ + interface IAttachment { + + /** Attachment name */ + name?: (string|null); + + /** Attachment contentName */ + contentName?: (string|null); + + /** Attachment contentType */ + contentType?: (string|null); + + /** Attachment attachmentDataRef */ + attachmentDataRef?: (google.chat.v1.IAttachmentDataRef|null); + + /** Attachment driveDataRef */ + driveDataRef?: (google.chat.v1.IDriveDataRef|null); + + /** Attachment thumbnailUri */ + thumbnailUri?: (string|null); + + /** Attachment downloadUri */ + downloadUri?: (string|null); + + /** Attachment source */ + source?: (google.chat.v1.Attachment.Source|keyof typeof google.chat.v1.Attachment.Source|null); + } + + /** Represents an Attachment. */ + class Attachment implements IAttachment { + + /** + * Constructs a new Attachment. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IAttachment); + + /** Attachment name. */ + public name: string; + + /** Attachment contentName. */ + public contentName: string; + + /** Attachment contentType. */ + public contentType: string; + + /** Attachment attachmentDataRef. */ + public attachmentDataRef?: (google.chat.v1.IAttachmentDataRef|null); + + /** Attachment driveDataRef. */ + public driveDataRef?: (google.chat.v1.IDriveDataRef|null); + + /** Attachment thumbnailUri. */ + public thumbnailUri: string; + + /** Attachment downloadUri. */ + public downloadUri: string; + + /** Attachment source. */ + public source: (google.chat.v1.Attachment.Source|keyof typeof google.chat.v1.Attachment.Source); + + /** Attachment dataRef. */ + public dataRef?: ("attachmentDataRef"|"driveDataRef"); + + /** + * Creates a new Attachment instance using the specified properties. + * @param [properties] Properties to set + * @returns Attachment instance + */ + public static create(properties?: google.chat.v1.IAttachment): google.chat.v1.Attachment; + + /** + * Encodes the specified Attachment message. Does not implicitly {@link google.chat.v1.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.chat.v1.IAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.chat.v1.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.chat.v1.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.chat.v1.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.chat.v1.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.chat.v1.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.chat.v1.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; + } + + namespace Attachment { + + /** Source enum. */ + enum Source { + SOURCE_UNSPECIFIED = 0, + DRIVE_FILE = 1, + UPLOADED_CONTENT = 2 + } + } + + /** Properties of a DriveDataRef. */ + interface IDriveDataRef { + + /** DriveDataRef driveFileId */ + driveFileId?: (string|null); + } + + /** Represents a DriveDataRef. */ + class DriveDataRef implements IDriveDataRef { + + /** + * Constructs a new DriveDataRef. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IDriveDataRef); + + /** DriveDataRef driveFileId. */ + public driveFileId: string; + + /** + * Creates a new DriveDataRef instance using the specified properties. + * @param [properties] Properties to set + * @returns DriveDataRef instance + */ + public static create(properties?: google.chat.v1.IDriveDataRef): google.chat.v1.DriveDataRef; + + /** + * Encodes the specified DriveDataRef message. Does not implicitly {@link google.chat.v1.DriveDataRef.verify|verify} messages. + * @param message DriveDataRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IDriveDataRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DriveDataRef message, length delimited. Does not implicitly {@link google.chat.v1.DriveDataRef.verify|verify} messages. + * @param message DriveDataRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IDriveDataRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DriveDataRef message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DriveDataRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DriveDataRef; + + /** + * Decodes a DriveDataRef message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DriveDataRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DriveDataRef; + + /** + * Verifies a DriveDataRef message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DriveDataRef message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DriveDataRef + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.DriveDataRef; + + /** + * Creates a plain object from a DriveDataRef message. Also converts values to other types if specified. + * @param message DriveDataRef + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.DriveDataRef, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DriveDataRef to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DriveDataRef + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttachmentDataRef. */ + interface IAttachmentDataRef { + + /** AttachmentDataRef resourceName */ + resourceName?: (string|null); + + /** AttachmentDataRef attachmentUploadToken */ + attachmentUploadToken?: (string|null); + } + + /** Represents an AttachmentDataRef. */ + class AttachmentDataRef implements IAttachmentDataRef { + + /** + * Constructs a new AttachmentDataRef. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IAttachmentDataRef); + + /** AttachmentDataRef resourceName. */ + public resourceName: string; + + /** AttachmentDataRef attachmentUploadToken. */ + public attachmentUploadToken: string; + + /** + * Creates a new AttachmentDataRef instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachmentDataRef instance + */ + public static create(properties?: google.chat.v1.IAttachmentDataRef): google.chat.v1.AttachmentDataRef; + + /** + * Encodes the specified AttachmentDataRef message. Does not implicitly {@link google.chat.v1.AttachmentDataRef.verify|verify} messages. + * @param message AttachmentDataRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IAttachmentDataRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachmentDataRef message, length delimited. Does not implicitly {@link google.chat.v1.AttachmentDataRef.verify|verify} messages. + * @param message AttachmentDataRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IAttachmentDataRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachmentDataRef message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachmentDataRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.AttachmentDataRef; + + /** + * Decodes an AttachmentDataRef message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachmentDataRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.AttachmentDataRef; + + /** + * Verifies an AttachmentDataRef message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachmentDataRef message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachmentDataRef + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.AttachmentDataRef; + + /** + * Creates a plain object from an AttachmentDataRef message. Also converts values to other types if specified. + * @param message AttachmentDataRef + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.AttachmentDataRef, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachmentDataRef to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttachmentDataRef + * @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.chat.v1.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.chat.v1.IGetAttachmentRequest): google.chat.v1.GetAttachmentRequest; + + /** + * Encodes the specified GetAttachmentRequest message. Does not implicitly {@link google.chat.v1.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.chat.v1.IGetAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAttachmentRequest message, length delimited. Does not implicitly {@link google.chat.v1.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.chat.v1.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.chat.v1.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.chat.v1.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.chat.v1.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.chat.v1.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 an UploadAttachmentRequest. */ + interface IUploadAttachmentRequest { + + /** UploadAttachmentRequest parent */ + parent?: (string|null); + + /** UploadAttachmentRequest filename */ + filename?: (string|null); + } + + /** Represents an UploadAttachmentRequest. */ + class UploadAttachmentRequest implements IUploadAttachmentRequest { + + /** + * Constructs a new UploadAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IUploadAttachmentRequest); + + /** UploadAttachmentRequest parent. */ + public parent: string; + + /** UploadAttachmentRequest filename. */ + public filename: string; + + /** + * Creates a new UploadAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UploadAttachmentRequest instance + */ + public static create(properties?: google.chat.v1.IUploadAttachmentRequest): google.chat.v1.UploadAttachmentRequest; + + /** + * Encodes the specified UploadAttachmentRequest message. Does not implicitly {@link google.chat.v1.UploadAttachmentRequest.verify|verify} messages. + * @param message UploadAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IUploadAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UploadAttachmentRequest message, length delimited. Does not implicitly {@link google.chat.v1.UploadAttachmentRequest.verify|verify} messages. + * @param message UploadAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IUploadAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UploadAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UploadAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.UploadAttachmentRequest; + + /** + * Decodes an UploadAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UploadAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.UploadAttachmentRequest; + + /** + * Verifies an UploadAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UploadAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UploadAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.UploadAttachmentRequest; + + /** + * Creates a plain object from an UploadAttachmentRequest message. Also converts values to other types if specified. + * @param message UploadAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.UploadAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UploadAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UploadAttachmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UploadAttachmentResponse. */ + interface IUploadAttachmentResponse { + + /** UploadAttachmentResponse attachmentDataRef */ + attachmentDataRef?: (google.chat.v1.IAttachmentDataRef|null); + } + + /** Represents an UploadAttachmentResponse. */ + class UploadAttachmentResponse implements IUploadAttachmentResponse { + + /** + * Constructs a new UploadAttachmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IUploadAttachmentResponse); + + /** UploadAttachmentResponse attachmentDataRef. */ + public attachmentDataRef?: (google.chat.v1.IAttachmentDataRef|null); + + /** + * Creates a new UploadAttachmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UploadAttachmentResponse instance + */ + public static create(properties?: google.chat.v1.IUploadAttachmentResponse): google.chat.v1.UploadAttachmentResponse; + + /** + * Encodes the specified UploadAttachmentResponse message. Does not implicitly {@link google.chat.v1.UploadAttachmentResponse.verify|verify} messages. + * @param message UploadAttachmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IUploadAttachmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UploadAttachmentResponse message, length delimited. Does not implicitly {@link google.chat.v1.UploadAttachmentResponse.verify|verify} messages. + * @param message UploadAttachmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IUploadAttachmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UploadAttachmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UploadAttachmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.UploadAttachmentResponse; + + /** + * Decodes an UploadAttachmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UploadAttachmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.UploadAttachmentResponse; + + /** + * Verifies an UploadAttachmentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UploadAttachmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UploadAttachmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.UploadAttachmentResponse; + + /** + * Creates a plain object from an UploadAttachmentResponse message. Also converts values to other types if specified. + * @param message UploadAttachmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.UploadAttachmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UploadAttachmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UploadAttachmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a User. */ + interface IUser { + + /** User name */ + name?: (string|null); + + /** User displayName */ + displayName?: (string|null); + + /** User domainId */ + domainId?: (string|null); + + /** User type */ + type?: (google.chat.v1.User.Type|keyof typeof google.chat.v1.User.Type|null); + + /** User isAnonymous */ + isAnonymous?: (boolean|null); + } + + /** Represents a User. */ + class User implements IUser { + + /** + * Constructs a new User. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IUser); + + /** User name. */ + public name: string; + + /** User displayName. */ + public displayName: string; + + /** User domainId. */ + public domainId: string; + + /** User type. */ + public type: (google.chat.v1.User.Type|keyof typeof google.chat.v1.User.Type); + + /** User isAnonymous. */ + public isAnonymous: boolean; + + /** + * Creates a new User instance using the specified properties. + * @param [properties] Properties to set + * @returns User instance + */ + public static create(properties?: google.chat.v1.IUser): google.chat.v1.User; + + /** + * Encodes the specified User message. Does not implicitly {@link google.chat.v1.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.chat.v1.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a User message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.User; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.User; + + /** + * Verifies a User message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns User + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.User; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this User to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for User + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace User { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + HUMAN = 1, + BOT = 2 + } + } + + /** Represents a ChatService */ + class ChatService extends $protobuf.rpc.Service { + + /** + * Constructs a new ChatService 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 ChatService 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): ChatService; + + /** + * Calls CreateMessage. + * @param request CreateMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Message + */ + public createMessage(request: google.chat.v1.ICreateMessageRequest, callback: google.chat.v1.ChatService.CreateMessageCallback): void; + + /** + * Calls CreateMessage. + * @param request CreateMessageRequest message or plain object + * @returns Promise + */ + public createMessage(request: google.chat.v1.ICreateMessageRequest): Promise; + + /** + * Calls ListMessages. + * @param request ListMessagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMessagesResponse + */ + public listMessages(request: google.chat.v1.IListMessagesRequest, callback: google.chat.v1.ChatService.ListMessagesCallback): void; + + /** + * Calls ListMessages. + * @param request ListMessagesRequest message or plain object + * @returns Promise + */ + public listMessages(request: google.chat.v1.IListMessagesRequest): Promise; + + /** + * Calls ListMemberships. + * @param request ListMembershipsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMembershipsResponse + */ + public listMemberships(request: google.chat.v1.IListMembershipsRequest, callback: google.chat.v1.ChatService.ListMembershipsCallback): void; + + /** + * Calls ListMemberships. + * @param request ListMembershipsRequest message or plain object + * @returns Promise + */ + public listMemberships(request: google.chat.v1.IListMembershipsRequest): Promise; + + /** + * Calls GetMembership. + * @param request GetMembershipRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Membership + */ + public getMembership(request: google.chat.v1.IGetMembershipRequest, callback: google.chat.v1.ChatService.GetMembershipCallback): void; + + /** + * Calls GetMembership. + * @param request GetMembershipRequest message or plain object + * @returns Promise + */ + public getMembership(request: google.chat.v1.IGetMembershipRequest): Promise; + + /** + * Calls GetMessage. + * @param request GetMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Message + */ + public getMessage(request: google.chat.v1.IGetMessageRequest, callback: google.chat.v1.ChatService.GetMessageCallback): void; + + /** + * Calls GetMessage. + * @param request GetMessageRequest message or plain object + * @returns Promise + */ + public getMessage(request: google.chat.v1.IGetMessageRequest): Promise; + + /** + * Calls UpdateMessage. + * @param request UpdateMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Message + */ + public updateMessage(request: google.chat.v1.IUpdateMessageRequest, callback: google.chat.v1.ChatService.UpdateMessageCallback): void; + + /** + * Calls UpdateMessage. + * @param request UpdateMessageRequest message or plain object + * @returns Promise + */ + public updateMessage(request: google.chat.v1.IUpdateMessageRequest): Promise; + + /** + * Calls DeleteMessage. + * @param request DeleteMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteMessage(request: google.chat.v1.IDeleteMessageRequest, callback: google.chat.v1.ChatService.DeleteMessageCallback): void; + + /** + * Calls DeleteMessage. + * @param request DeleteMessageRequest message or plain object + * @returns Promise + */ + public deleteMessage(request: google.chat.v1.IDeleteMessageRequest): 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.chat.v1.IGetAttachmentRequest, callback: google.chat.v1.ChatService.GetAttachmentCallback): void; + + /** + * Calls GetAttachment. + * @param request GetAttachmentRequest message or plain object + * @returns Promise + */ + public getAttachment(request: google.chat.v1.IGetAttachmentRequest): Promise; + + /** + * Calls UploadAttachment. + * @param request UploadAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UploadAttachmentResponse + */ + public uploadAttachment(request: google.chat.v1.IUploadAttachmentRequest, callback: google.chat.v1.ChatService.UploadAttachmentCallback): void; + + /** + * Calls UploadAttachment. + * @param request UploadAttachmentRequest message or plain object + * @returns Promise + */ + public uploadAttachment(request: google.chat.v1.IUploadAttachmentRequest): Promise; + + /** + * Calls ListSpaces. + * @param request ListSpacesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSpacesResponse + */ + public listSpaces(request: google.chat.v1.IListSpacesRequest, callback: google.chat.v1.ChatService.ListSpacesCallback): void; + + /** + * Calls ListSpaces. + * @param request ListSpacesRequest message or plain object + * @returns Promise + */ + public listSpaces(request: google.chat.v1.IListSpacesRequest): Promise; + + /** + * Calls SearchSpaces. + * @param request SearchSpacesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchSpacesResponse + */ + public searchSpaces(request: google.chat.v1.ISearchSpacesRequest, callback: google.chat.v1.ChatService.SearchSpacesCallback): void; + + /** + * Calls SearchSpaces. + * @param request SearchSpacesRequest message or plain object + * @returns Promise + */ + public searchSpaces(request: google.chat.v1.ISearchSpacesRequest): Promise; + + /** + * Calls GetSpace. + * @param request GetSpaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Space + */ + public getSpace(request: google.chat.v1.IGetSpaceRequest, callback: google.chat.v1.ChatService.GetSpaceCallback): void; + + /** + * Calls GetSpace. + * @param request GetSpaceRequest message or plain object + * @returns Promise + */ + public getSpace(request: google.chat.v1.IGetSpaceRequest): Promise; + + /** + * Calls CreateSpace. + * @param request CreateSpaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Space + */ + public createSpace(request: google.chat.v1.ICreateSpaceRequest, callback: google.chat.v1.ChatService.CreateSpaceCallback): void; + + /** + * Calls CreateSpace. + * @param request CreateSpaceRequest message or plain object + * @returns Promise + */ + public createSpace(request: google.chat.v1.ICreateSpaceRequest): Promise; + + /** + * Calls SetUpSpace. + * @param request SetUpSpaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Space + */ + public setUpSpace(request: google.chat.v1.ISetUpSpaceRequest, callback: google.chat.v1.ChatService.SetUpSpaceCallback): void; + + /** + * Calls SetUpSpace. + * @param request SetUpSpaceRequest message or plain object + * @returns Promise + */ + public setUpSpace(request: google.chat.v1.ISetUpSpaceRequest): Promise; + + /** + * Calls UpdateSpace. + * @param request UpdateSpaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Space + */ + public updateSpace(request: google.chat.v1.IUpdateSpaceRequest, callback: google.chat.v1.ChatService.UpdateSpaceCallback): void; + + /** + * Calls UpdateSpace. + * @param request UpdateSpaceRequest message or plain object + * @returns Promise + */ + public updateSpace(request: google.chat.v1.IUpdateSpaceRequest): Promise; + + /** + * Calls DeleteSpace. + * @param request DeleteSpaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSpace(request: google.chat.v1.IDeleteSpaceRequest, callback: google.chat.v1.ChatService.DeleteSpaceCallback): void; + + /** + * Calls DeleteSpace. + * @param request DeleteSpaceRequest message or plain object + * @returns Promise + */ + public deleteSpace(request: google.chat.v1.IDeleteSpaceRequest): Promise; + + /** + * Calls CompleteImportSpace. + * @param request CompleteImportSpaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompleteImportSpaceResponse + */ + public completeImportSpace(request: google.chat.v1.ICompleteImportSpaceRequest, callback: google.chat.v1.ChatService.CompleteImportSpaceCallback): void; + + /** + * Calls CompleteImportSpace. + * @param request CompleteImportSpaceRequest message or plain object + * @returns Promise + */ + public completeImportSpace(request: google.chat.v1.ICompleteImportSpaceRequest): Promise; + + /** + * Calls FindDirectMessage. + * @param request FindDirectMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Space + */ + public findDirectMessage(request: google.chat.v1.IFindDirectMessageRequest, callback: google.chat.v1.ChatService.FindDirectMessageCallback): void; + + /** + * Calls FindDirectMessage. + * @param request FindDirectMessageRequest message or plain object + * @returns Promise + */ + public findDirectMessage(request: google.chat.v1.IFindDirectMessageRequest): Promise; + + /** + * Calls CreateMembership. + * @param request CreateMembershipRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Membership + */ + public createMembership(request: google.chat.v1.ICreateMembershipRequest, callback: google.chat.v1.ChatService.CreateMembershipCallback): void; + + /** + * Calls CreateMembership. + * @param request CreateMembershipRequest message or plain object + * @returns Promise + */ + public createMembership(request: google.chat.v1.ICreateMembershipRequest): Promise; + + /** + * Calls UpdateMembership. + * @param request UpdateMembershipRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Membership + */ + public updateMembership(request: google.chat.v1.IUpdateMembershipRequest, callback: google.chat.v1.ChatService.UpdateMembershipCallback): void; + + /** + * Calls UpdateMembership. + * @param request UpdateMembershipRequest message or plain object + * @returns Promise + */ + public updateMembership(request: google.chat.v1.IUpdateMembershipRequest): Promise; + + /** + * Calls DeleteMembership. + * @param request DeleteMembershipRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Membership + */ + public deleteMembership(request: google.chat.v1.IDeleteMembershipRequest, callback: google.chat.v1.ChatService.DeleteMembershipCallback): void; + + /** + * Calls DeleteMembership. + * @param request DeleteMembershipRequest message or plain object + * @returns Promise + */ + public deleteMembership(request: google.chat.v1.IDeleteMembershipRequest): Promise; + + /** + * Calls CreateReaction. + * @param request CreateReactionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Reaction + */ + public createReaction(request: google.chat.v1.ICreateReactionRequest, callback: google.chat.v1.ChatService.CreateReactionCallback): void; + + /** + * Calls CreateReaction. + * @param request CreateReactionRequest message or plain object + * @returns Promise + */ + public createReaction(request: google.chat.v1.ICreateReactionRequest): Promise; + + /** + * Calls ListReactions. + * @param request ListReactionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReactionsResponse + */ + public listReactions(request: google.chat.v1.IListReactionsRequest, callback: google.chat.v1.ChatService.ListReactionsCallback): void; + + /** + * Calls ListReactions. + * @param request ListReactionsRequest message or plain object + * @returns Promise + */ + public listReactions(request: google.chat.v1.IListReactionsRequest): Promise; + + /** + * Calls DeleteReaction. + * @param request DeleteReactionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteReaction(request: google.chat.v1.IDeleteReactionRequest, callback: google.chat.v1.ChatService.DeleteReactionCallback): void; + + /** + * Calls DeleteReaction. + * @param request DeleteReactionRequest message or plain object + * @returns Promise + */ + public deleteReaction(request: google.chat.v1.IDeleteReactionRequest): Promise; + + /** + * Calls GetSpaceReadState. + * @param request GetSpaceReadStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpaceReadState + */ + public getSpaceReadState(request: google.chat.v1.IGetSpaceReadStateRequest, callback: google.chat.v1.ChatService.GetSpaceReadStateCallback): void; + + /** + * Calls GetSpaceReadState. + * @param request GetSpaceReadStateRequest message or plain object + * @returns Promise + */ + public getSpaceReadState(request: google.chat.v1.IGetSpaceReadStateRequest): Promise; + + /** + * Calls UpdateSpaceReadState. + * @param request UpdateSpaceReadStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpaceReadState + */ + public updateSpaceReadState(request: google.chat.v1.IUpdateSpaceReadStateRequest, callback: google.chat.v1.ChatService.UpdateSpaceReadStateCallback): void; + + /** + * Calls UpdateSpaceReadState. + * @param request UpdateSpaceReadStateRequest message or plain object + * @returns Promise + */ + public updateSpaceReadState(request: google.chat.v1.IUpdateSpaceReadStateRequest): Promise; + + /** + * Calls GetThreadReadState. + * @param request GetThreadReadStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ThreadReadState + */ + public getThreadReadState(request: google.chat.v1.IGetThreadReadStateRequest, callback: google.chat.v1.ChatService.GetThreadReadStateCallback): void; + + /** + * Calls GetThreadReadState. + * @param request GetThreadReadStateRequest message or plain object + * @returns Promise + */ + public getThreadReadState(request: google.chat.v1.IGetThreadReadStateRequest): Promise; + + /** + * Calls GetSpaceEvent. + * @param request GetSpaceEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpaceEvent + */ + public getSpaceEvent(request: google.chat.v1.IGetSpaceEventRequest, callback: google.chat.v1.ChatService.GetSpaceEventCallback): void; + + /** + * Calls GetSpaceEvent. + * @param request GetSpaceEventRequest message or plain object + * @returns Promise + */ + public getSpaceEvent(request: google.chat.v1.IGetSpaceEventRequest): Promise; + + /** + * Calls ListSpaceEvents. + * @param request ListSpaceEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSpaceEventsResponse + */ + public listSpaceEvents(request: google.chat.v1.IListSpaceEventsRequest, callback: google.chat.v1.ChatService.ListSpaceEventsCallback): void; + + /** + * Calls ListSpaceEvents. + * @param request ListSpaceEventsRequest message or plain object + * @returns Promise + */ + public listSpaceEvents(request: google.chat.v1.IListSpaceEventsRequest): Promise; + } + + namespace ChatService { + + /** + * Callback as used by {@link google.chat.v1.ChatService|createMessage}. + * @param error Error, if any + * @param [response] Message + */ + type CreateMessageCallback = (error: (Error|null), response?: google.chat.v1.Message) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|listMessages}. + * @param error Error, if any + * @param [response] ListMessagesResponse + */ + type ListMessagesCallback = (error: (Error|null), response?: google.chat.v1.ListMessagesResponse) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|listMemberships}. + * @param error Error, if any + * @param [response] ListMembershipsResponse + */ + type ListMembershipsCallback = (error: (Error|null), response?: google.chat.v1.ListMembershipsResponse) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|getMembership}. + * @param error Error, if any + * @param [response] Membership + */ + type GetMembershipCallback = (error: (Error|null), response?: google.chat.v1.Membership) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|getMessage}. + * @param error Error, if any + * @param [response] Message + */ + type GetMessageCallback = (error: (Error|null), response?: google.chat.v1.Message) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|updateMessage}. + * @param error Error, if any + * @param [response] Message + */ + type UpdateMessageCallback = (error: (Error|null), response?: google.chat.v1.Message) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|deleteMessage}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteMessageCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|getAttachment}. + * @param error Error, if any + * @param [response] Attachment + */ + type GetAttachmentCallback = (error: (Error|null), response?: google.chat.v1.Attachment) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|uploadAttachment}. + * @param error Error, if any + * @param [response] UploadAttachmentResponse + */ + type UploadAttachmentCallback = (error: (Error|null), response?: google.chat.v1.UploadAttachmentResponse) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|listSpaces}. + * @param error Error, if any + * @param [response] ListSpacesResponse + */ + type ListSpacesCallback = (error: (Error|null), response?: google.chat.v1.ListSpacesResponse) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|searchSpaces}. + * @param error Error, if any + * @param [response] SearchSpacesResponse + */ + type SearchSpacesCallback = (error: (Error|null), response?: google.chat.v1.SearchSpacesResponse) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|getSpace}. + * @param error Error, if any + * @param [response] Space + */ + type GetSpaceCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|createSpace}. + * @param error Error, if any + * @param [response] Space + */ + type CreateSpaceCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|setUpSpace}. + * @param error Error, if any + * @param [response] Space + */ + type SetUpSpaceCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|updateSpace}. + * @param error Error, if any + * @param [response] Space + */ + type UpdateSpaceCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|deleteSpace}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSpaceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|completeImportSpace}. + * @param error Error, if any + * @param [response] CompleteImportSpaceResponse + */ + type CompleteImportSpaceCallback = (error: (Error|null), response?: google.chat.v1.CompleteImportSpaceResponse) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|findDirectMessage}. + * @param error Error, if any + * @param [response] Space + */ + type FindDirectMessageCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|createMembership}. + * @param error Error, if any + * @param [response] Membership + */ + type CreateMembershipCallback = (error: (Error|null), response?: google.chat.v1.Membership) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|updateMembership}. + * @param error Error, if any + * @param [response] Membership + */ + type UpdateMembershipCallback = (error: (Error|null), response?: google.chat.v1.Membership) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|deleteMembership}. + * @param error Error, if any + * @param [response] Membership + */ + type DeleteMembershipCallback = (error: (Error|null), response?: google.chat.v1.Membership) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|createReaction}. + * @param error Error, if any + * @param [response] Reaction + */ + type CreateReactionCallback = (error: (Error|null), response?: google.chat.v1.Reaction) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|listReactions}. + * @param error Error, if any + * @param [response] ListReactionsResponse + */ + type ListReactionsCallback = (error: (Error|null), response?: google.chat.v1.ListReactionsResponse) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|deleteReaction}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteReactionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|getSpaceReadState}. + * @param error Error, if any + * @param [response] SpaceReadState + */ + type GetSpaceReadStateCallback = (error: (Error|null), response?: google.chat.v1.SpaceReadState) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|updateSpaceReadState}. + * @param error Error, if any + * @param [response] SpaceReadState + */ + type UpdateSpaceReadStateCallback = (error: (Error|null), response?: google.chat.v1.SpaceReadState) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|getThreadReadState}. + * @param error Error, if any + * @param [response] ThreadReadState + */ + type GetThreadReadStateCallback = (error: (Error|null), response?: google.chat.v1.ThreadReadState) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|getSpaceEvent}. + * @param error Error, if any + * @param [response] SpaceEvent + */ + type GetSpaceEventCallback = (error: (Error|null), response?: google.chat.v1.SpaceEvent) => void; + + /** + * Callback as used by {@link google.chat.v1.ChatService|listSpaceEvents}. + * @param error Error, if any + * @param [response] ListSpaceEventsResponse + */ + type ListSpaceEventsCallback = (error: (Error|null), response?: google.chat.v1.ListSpaceEventsResponse) => void; + } + + /** Properties of a Membership. */ + interface IMembership { + + /** Membership name */ + name?: (string|null); + + /** Membership state */ + state?: (google.chat.v1.Membership.MembershipState|keyof typeof google.chat.v1.Membership.MembershipState|null); + + /** Membership role */ + role?: (google.chat.v1.Membership.MembershipRole|keyof typeof google.chat.v1.Membership.MembershipRole|null); + + /** Membership member */ + member?: (google.chat.v1.IUser|null); + + /** Membership groupMember */ + groupMember?: (google.chat.v1.IGroup|null); + + /** Membership createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Membership deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Membership. */ + class Membership implements IMembership { + + /** + * Constructs a new Membership. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMembership); + + /** Membership name. */ + public name: string; + + /** Membership state. */ + public state: (google.chat.v1.Membership.MembershipState|keyof typeof google.chat.v1.Membership.MembershipState); + + /** Membership role. */ + public role: (google.chat.v1.Membership.MembershipRole|keyof typeof google.chat.v1.Membership.MembershipRole); + + /** Membership member. */ + public member?: (google.chat.v1.IUser|null); + + /** Membership groupMember. */ + public groupMember?: (google.chat.v1.IGroup|null); + + /** Membership createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Membership deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Membership memberType. */ + public memberType?: ("member"|"groupMember"); + + /** + * Creates a new Membership instance using the specified properties. + * @param [properties] Properties to set + * @returns Membership instance + */ + public static create(properties?: google.chat.v1.IMembership): google.chat.v1.Membership; + + /** + * Encodes the specified Membership message. Does not implicitly {@link google.chat.v1.Membership.verify|verify} messages. + * @param message Membership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Membership message, length delimited. Does not implicitly {@link google.chat.v1.Membership.verify|verify} messages. + * @param message Membership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Membership message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Membership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Membership; + + /** + * Decodes a Membership message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Membership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Membership; + + /** + * Verifies a Membership message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Membership message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Membership + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.Membership; + + /** + * Creates a plain object from a Membership message. Also converts values to other types if specified. + * @param message Membership + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.Membership, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Membership to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Membership + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Membership { + + /** MembershipState enum. */ + enum MembershipState { + MEMBERSHIP_STATE_UNSPECIFIED = 0, + JOINED = 1, + INVITED = 2, + NOT_A_MEMBER = 3 + } + + /** MembershipRole enum. */ + enum MembershipRole { + MEMBERSHIP_ROLE_UNSPECIFIED = 0, + ROLE_MEMBER = 1, + ROLE_MANAGER = 2 + } + } + + /** Properties of a CreateMembershipRequest. */ + interface ICreateMembershipRequest { + + /** CreateMembershipRequest parent */ + parent?: (string|null); + + /** CreateMembershipRequest membership */ + membership?: (google.chat.v1.IMembership|null); + + /** CreateMembershipRequest useAdminAccess */ + useAdminAccess?: (boolean|null); + } + + /** Represents a CreateMembershipRequest. */ + class CreateMembershipRequest implements ICreateMembershipRequest { + + /** + * Constructs a new CreateMembershipRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ICreateMembershipRequest); + + /** CreateMembershipRequest parent. */ + public parent: string; + + /** CreateMembershipRequest membership. */ + public membership?: (google.chat.v1.IMembership|null); + + /** CreateMembershipRequest useAdminAccess. */ + public useAdminAccess: boolean; + + /** + * Creates a new CreateMembershipRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMembershipRequest instance + */ + public static create(properties?: google.chat.v1.ICreateMembershipRequest): google.chat.v1.CreateMembershipRequest; + + /** + * Encodes the specified CreateMembershipRequest message. Does not implicitly {@link google.chat.v1.CreateMembershipRequest.verify|verify} messages. + * @param message CreateMembershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ICreateMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateMembershipRequest.verify|verify} messages. + * @param message CreateMembershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ICreateMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMembershipRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CreateMembershipRequest; + + /** + * Decodes a CreateMembershipRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CreateMembershipRequest; + + /** + * Verifies a CreateMembershipRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMembershipRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMembershipRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.CreateMembershipRequest; + + /** + * Creates a plain object from a CreateMembershipRequest message. Also converts values to other types if specified. + * @param message CreateMembershipRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.CreateMembershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMembershipRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMembershipRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMembershipRequest. */ + interface IUpdateMembershipRequest { + + /** UpdateMembershipRequest membership */ + membership?: (google.chat.v1.IMembership|null); + + /** UpdateMembershipRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMembershipRequest useAdminAccess */ + useAdminAccess?: (boolean|null); + } + + /** Represents an UpdateMembershipRequest. */ + class UpdateMembershipRequest implements IUpdateMembershipRequest { + + /** + * Constructs a new UpdateMembershipRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IUpdateMembershipRequest); + + /** UpdateMembershipRequest membership. */ + public membership?: (google.chat.v1.IMembership|null); + + /** UpdateMembershipRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMembershipRequest useAdminAccess. */ + public useAdminAccess: boolean; + + /** + * Creates a new UpdateMembershipRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMembershipRequest instance + */ + public static create(properties?: google.chat.v1.IUpdateMembershipRequest): google.chat.v1.UpdateMembershipRequest; + + /** + * Encodes the specified UpdateMembershipRequest message. Does not implicitly {@link google.chat.v1.UpdateMembershipRequest.verify|verify} messages. + * @param message UpdateMembershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IUpdateMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateMembershipRequest.verify|verify} messages. + * @param message UpdateMembershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IUpdateMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMembershipRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.UpdateMembershipRequest; + + /** + * Decodes an UpdateMembershipRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.UpdateMembershipRequest; + + /** + * Verifies an UpdateMembershipRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateMembershipRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMembershipRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.UpdateMembershipRequest; + + /** + * Creates a plain object from an UpdateMembershipRequest message. Also converts values to other types if specified. + * @param message UpdateMembershipRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.UpdateMembershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMembershipRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMembershipRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMembershipsRequest. */ + interface IListMembershipsRequest { + + /** ListMembershipsRequest parent */ + parent?: (string|null); + + /** ListMembershipsRequest pageSize */ + pageSize?: (number|null); + + /** ListMembershipsRequest pageToken */ + pageToken?: (string|null); + + /** ListMembershipsRequest filter */ + filter?: (string|null); + + /** ListMembershipsRequest showGroups */ + showGroups?: (boolean|null); + + /** ListMembershipsRequest showInvited */ + showInvited?: (boolean|null); + + /** ListMembershipsRequest useAdminAccess */ + useAdminAccess?: (boolean|null); + } + + /** Represents a ListMembershipsRequest. */ + class ListMembershipsRequest implements IListMembershipsRequest { + + /** + * Constructs a new ListMembershipsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IListMembershipsRequest); + + /** ListMembershipsRequest parent. */ + public parent: string; + + /** ListMembershipsRequest pageSize. */ + public pageSize: number; + + /** ListMembershipsRequest pageToken. */ + public pageToken: string; + + /** ListMembershipsRequest filter. */ + public filter: string; + + /** ListMembershipsRequest showGroups. */ + public showGroups: boolean; + + /** ListMembershipsRequest showInvited. */ + public showInvited: boolean; + + /** ListMembershipsRequest useAdminAccess. */ + public useAdminAccess: boolean; + + /** + * Creates a new ListMembershipsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMembershipsRequest instance + */ + public static create(properties?: google.chat.v1.IListMembershipsRequest): google.chat.v1.ListMembershipsRequest; + + /** + * Encodes the specified ListMembershipsRequest message. Does not implicitly {@link google.chat.v1.ListMembershipsRequest.verify|verify} messages. + * @param message ListMembershipsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IListMembershipsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMembershipsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListMembershipsRequest.verify|verify} messages. + * @param message ListMembershipsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IListMembershipsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMembershipsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMembershipsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListMembershipsRequest; + + /** + * Decodes a ListMembershipsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMembershipsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListMembershipsRequest; + + /** + * Verifies a ListMembershipsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMembershipsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMembershipsRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListMembershipsRequest; + + /** + * Creates a plain object from a ListMembershipsRequest message. Also converts values to other types if specified. + * @param message ListMembershipsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ListMembershipsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMembershipsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMembershipsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMembershipsResponse. */ + interface IListMembershipsResponse { + + /** ListMembershipsResponse memberships */ + memberships?: (google.chat.v1.IMembership[]|null); + + /** ListMembershipsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMembershipsResponse. */ + class ListMembershipsResponse implements IListMembershipsResponse { + + /** + * Constructs a new ListMembershipsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IListMembershipsResponse); + + /** ListMembershipsResponse memberships. */ + public memberships: google.chat.v1.IMembership[]; + + /** ListMembershipsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMembershipsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMembershipsResponse instance + */ + public static create(properties?: google.chat.v1.IListMembershipsResponse): google.chat.v1.ListMembershipsResponse; + + /** + * Encodes the specified ListMembershipsResponse message. Does not implicitly {@link google.chat.v1.ListMembershipsResponse.verify|verify} messages. + * @param message ListMembershipsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IListMembershipsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMembershipsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListMembershipsResponse.verify|verify} messages. + * @param message ListMembershipsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IListMembershipsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMembershipsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMembershipsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListMembershipsResponse; + + /** + * Decodes a ListMembershipsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMembershipsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListMembershipsResponse; + + /** + * Verifies a ListMembershipsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMembershipsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMembershipsResponse + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListMembershipsResponse; + + /** + * Creates a plain object from a ListMembershipsResponse message. Also converts values to other types if specified. + * @param message ListMembershipsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ListMembershipsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMembershipsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMembershipsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMembershipRequest. */ + interface IGetMembershipRequest { + + /** GetMembershipRequest name */ + name?: (string|null); + + /** GetMembershipRequest useAdminAccess */ + useAdminAccess?: (boolean|null); + } + + /** Represents a GetMembershipRequest. */ + class GetMembershipRequest implements IGetMembershipRequest { + + /** + * Constructs a new GetMembershipRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IGetMembershipRequest); + + /** GetMembershipRequest name. */ + public name: string; + + /** GetMembershipRequest useAdminAccess. */ + public useAdminAccess: boolean; + + /** + * Creates a new GetMembershipRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMembershipRequest instance + */ + public static create(properties?: google.chat.v1.IGetMembershipRequest): google.chat.v1.GetMembershipRequest; + + /** + * Encodes the specified GetMembershipRequest message. Does not implicitly {@link google.chat.v1.GetMembershipRequest.verify|verify} messages. + * @param message GetMembershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IGetMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetMembershipRequest.verify|verify} messages. + * @param message GetMembershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IGetMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMembershipRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.GetMembershipRequest; + + /** + * Decodes a GetMembershipRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.GetMembershipRequest; + + /** + * Verifies a GetMembershipRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMembershipRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMembershipRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.GetMembershipRequest; + + /** + * Creates a plain object from a GetMembershipRequest message. Also converts values to other types if specified. + * @param message GetMembershipRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.GetMembershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMembershipRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMembershipRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMembershipRequest. */ + interface IDeleteMembershipRequest { + + /** DeleteMembershipRequest name */ + name?: (string|null); + + /** DeleteMembershipRequest useAdminAccess */ + useAdminAccess?: (boolean|null); + } + + /** Represents a DeleteMembershipRequest. */ + class DeleteMembershipRequest implements IDeleteMembershipRequest { + + /** + * Constructs a new DeleteMembershipRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IDeleteMembershipRequest); + + /** DeleteMembershipRequest name. */ + public name: string; + + /** DeleteMembershipRequest useAdminAccess. */ + public useAdminAccess: boolean; + + /** + * Creates a new DeleteMembershipRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMembershipRequest instance + */ + public static create(properties?: google.chat.v1.IDeleteMembershipRequest): google.chat.v1.DeleteMembershipRequest; + + /** + * Encodes the specified DeleteMembershipRequest message. Does not implicitly {@link google.chat.v1.DeleteMembershipRequest.verify|verify} messages. + * @param message DeleteMembershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IDeleteMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteMembershipRequest.verify|verify} messages. + * @param message DeleteMembershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IDeleteMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMembershipRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeleteMembershipRequest; + + /** + * Decodes a DeleteMembershipRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeleteMembershipRequest; + + /** + * Verifies a DeleteMembershipRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMembershipRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMembershipRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.DeleteMembershipRequest; + + /** + * Creates a plain object from a DeleteMembershipRequest message. Also converts values to other types if specified. + * @param message DeleteMembershipRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.DeleteMembershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMembershipRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMembershipRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Group. */ + interface IGroup { + + /** Group name */ + name?: (string|null); + } + + /** Represents a Group. */ + class Group implements IGroup { + + /** + * Constructs a new Group. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IGroup); + + /** Group name. */ + public name: string; + + /** + * Creates a new Group instance using the specified properties. + * @param [properties] Properties to set + * @returns Group instance + */ + public static create(properties?: google.chat.v1.IGroup): google.chat.v1.Group; + + /** + * Encodes the specified Group message. Does not implicitly {@link google.chat.v1.Group.verify|verify} messages. + * @param message Group message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.chat.v1.Group.verify|verify} messages. + * @param message Group message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Group message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Group; + + /** + * Decodes a Group message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Group; + + /** + * Verifies a Group message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Group message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Group + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.Group; + + /** + * Creates a plain object from a Group message. Also converts values to other types if specified. + * @param message Group + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.Group, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Group to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Group + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Message. */ + interface IMessage { + + /** Message name */ + name?: (string|null); + + /** Message sender */ + sender?: (google.chat.v1.IUser|null); + + /** Message createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Message lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Message deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Message text */ + text?: (string|null); + + /** Message formattedText */ + formattedText?: (string|null); + + /** Message cards */ + cards?: (google.chat.v1.ContextualAddOnMarkup.ICard[]|null); + + /** Message cardsV2 */ + cardsV2?: (google.chat.v1.ICardWithId[]|null); + + /** Message annotations */ + annotations?: (google.chat.v1.IAnnotation[]|null); + + /** Message thread */ + thread?: (google.chat.v1.IThread|null); + + /** Message space */ + space?: (google.chat.v1.ISpace|null); + + /** Message fallbackText */ + fallbackText?: (string|null); + + /** Message actionResponse */ + actionResponse?: (google.chat.v1.IActionResponse|null); + + /** Message argumentText */ + argumentText?: (string|null); + + /** Message slashCommand */ + slashCommand?: (google.chat.v1.ISlashCommand|null); + + /** Message attachment */ + attachment?: (google.chat.v1.IAttachment[]|null); + + /** Message matchedUrl */ + matchedUrl?: (google.chat.v1.IMatchedUrl|null); + + /** Message threadReply */ + threadReply?: (boolean|null); + + /** Message clientAssignedMessageId */ + clientAssignedMessageId?: (string|null); + + /** Message emojiReactionSummaries */ + emojiReactionSummaries?: (google.chat.v1.IEmojiReactionSummary[]|null); + + /** Message privateMessageViewer */ + privateMessageViewer?: (google.chat.v1.IUser|null); + + /** Message deletionMetadata */ + deletionMetadata?: (google.chat.v1.IDeletionMetadata|null); + + /** Message quotedMessageMetadata */ + quotedMessageMetadata?: (google.chat.v1.IQuotedMessageMetadata|null); + + /** Message attachedGifs */ + attachedGifs?: (google.chat.v1.IAttachedGif[]|null); + + /** Message accessoryWidgets */ + accessoryWidgets?: (google.chat.v1.IAccessoryWidget[]|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMessage); + + /** Message name. */ + public name: string; + + /** Message sender. */ + public sender?: (google.chat.v1.IUser|null); + + /** Message createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Message lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Message deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Message text. */ + public text: string; + + /** Message formattedText. */ + public formattedText: string; + + /** Message cards. */ + public cards: google.chat.v1.ContextualAddOnMarkup.ICard[]; + + /** Message cardsV2. */ + public cardsV2: google.chat.v1.ICardWithId[]; + + /** Message annotations. */ + public annotations: google.chat.v1.IAnnotation[]; + + /** Message thread. */ + public thread?: (google.chat.v1.IThread|null); + + /** Message space. */ + public space?: (google.chat.v1.ISpace|null); + + /** Message fallbackText. */ + public fallbackText: string; + + /** Message actionResponse. */ + public actionResponse?: (google.chat.v1.IActionResponse|null); + + /** Message argumentText. */ + public argumentText: string; + + /** Message slashCommand. */ + public slashCommand?: (google.chat.v1.ISlashCommand|null); + + /** Message attachment. */ + public attachment: google.chat.v1.IAttachment[]; + + /** Message matchedUrl. */ + public matchedUrl?: (google.chat.v1.IMatchedUrl|null); + + /** Message threadReply. */ + public threadReply: boolean; + + /** Message clientAssignedMessageId. */ + public clientAssignedMessageId: string; + + /** Message emojiReactionSummaries. */ + public emojiReactionSummaries: google.chat.v1.IEmojiReactionSummary[]; + + /** Message privateMessageViewer. */ + public privateMessageViewer?: (google.chat.v1.IUser|null); + + /** Message deletionMetadata. */ + public deletionMetadata?: (google.chat.v1.IDeletionMetadata|null); + + /** Message quotedMessageMetadata. */ + public quotedMessageMetadata?: (google.chat.v1.IQuotedMessageMetadata|null); + + /** Message attachedGifs. */ + public attachedGifs: google.chat.v1.IAttachedGif[]; + + /** Message accessoryWidgets. */ + public accessoryWidgets: google.chat.v1.IAccessoryWidget[]; + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.chat.v1.IMessage): google.chat.v1.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.chat.v1.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.chat.v1.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Message + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttachedGif. */ + interface IAttachedGif { + + /** AttachedGif uri */ + uri?: (string|null); + } + + /** Represents an AttachedGif. */ + class AttachedGif implements IAttachedGif { + + /** + * Constructs a new AttachedGif. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IAttachedGif); + + /** AttachedGif uri. */ + public uri: string; + + /** + * Creates a new AttachedGif instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachedGif instance + */ + public static create(properties?: google.chat.v1.IAttachedGif): google.chat.v1.AttachedGif; + + /** + * Encodes the specified AttachedGif message. Does not implicitly {@link google.chat.v1.AttachedGif.verify|verify} messages. + * @param message AttachedGif message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IAttachedGif, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachedGif message, length delimited. Does not implicitly {@link google.chat.v1.AttachedGif.verify|verify} messages. + * @param message AttachedGif message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IAttachedGif, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachedGif message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachedGif + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.AttachedGif; + + /** + * Decodes an AttachedGif message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachedGif + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.AttachedGif; + + /** + * Verifies an AttachedGif message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachedGif message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachedGif + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.AttachedGif; + + /** + * Creates a plain object from an AttachedGif message. Also converts values to other types if specified. + * @param message AttachedGif + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.AttachedGif, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachedGif to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttachedGif + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QuotedMessageMetadata. */ + interface IQuotedMessageMetadata { + + /** QuotedMessageMetadata name */ + name?: (string|null); + + /** QuotedMessageMetadata lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a QuotedMessageMetadata. */ + class QuotedMessageMetadata implements IQuotedMessageMetadata { + + /** + * Constructs a new QuotedMessageMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IQuotedMessageMetadata); + + /** QuotedMessageMetadata name. */ + public name: string; + + /** QuotedMessageMetadata lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new QuotedMessageMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns QuotedMessageMetadata instance + */ + public static create(properties?: google.chat.v1.IQuotedMessageMetadata): google.chat.v1.QuotedMessageMetadata; + + /** + * Encodes the specified QuotedMessageMetadata message. Does not implicitly {@link google.chat.v1.QuotedMessageMetadata.verify|verify} messages. + * @param message QuotedMessageMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IQuotedMessageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuotedMessageMetadata message, length delimited. Does not implicitly {@link google.chat.v1.QuotedMessageMetadata.verify|verify} messages. + * @param message QuotedMessageMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IQuotedMessageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuotedMessageMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuotedMessageMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.QuotedMessageMetadata; + + /** + * Decodes a QuotedMessageMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuotedMessageMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.QuotedMessageMetadata; + + /** + * Verifies a QuotedMessageMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuotedMessageMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuotedMessageMetadata + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.QuotedMessageMetadata; + + /** + * Creates a plain object from a QuotedMessageMetadata message. Also converts values to other types if specified. + * @param message QuotedMessageMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.QuotedMessageMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuotedMessageMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuotedMessageMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Thread. */ + interface IThread { + + /** Thread name */ + name?: (string|null); + + /** Thread threadKey */ + threadKey?: (string|null); + } + + /** Represents a Thread. */ + class Thread implements IThread { + + /** + * Constructs a new Thread. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IThread); + + /** Thread name. */ + public name: string; + + /** Thread threadKey. */ + public threadKey: string; + + /** + * Creates a new Thread instance using the specified properties. + * @param [properties] Properties to set + * @returns Thread instance + */ + public static create(properties?: google.chat.v1.IThread): google.chat.v1.Thread; + + /** + * Encodes the specified Thread message. Does not implicitly {@link google.chat.v1.Thread.verify|verify} messages. + * @param message Thread message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IThread, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Thread message, length delimited. Does not implicitly {@link google.chat.v1.Thread.verify|verify} messages. + * @param message Thread message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IThread, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Thread message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Thread + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Thread; + + /** + * Decodes a Thread message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Thread + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Thread; + + /** + * Verifies a Thread message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Thread message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Thread + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.Thread; + + /** + * Creates a plain object from a Thread message. Also converts values to other types if specified. + * @param message Thread + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.Thread, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Thread to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Thread + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ActionResponse. */ + interface IActionResponse { + + /** ActionResponse type */ + type?: (google.chat.v1.ActionResponse.ResponseType|keyof typeof google.chat.v1.ActionResponse.ResponseType|null); + + /** ActionResponse url */ + url?: (string|null); + + /** ActionResponse dialogAction */ + dialogAction?: (google.chat.v1.IDialogAction|null); + + /** ActionResponse updatedWidget */ + updatedWidget?: (google.chat.v1.ActionResponse.IUpdatedWidget|null); + } + + /** Represents an ActionResponse. */ + class ActionResponse implements IActionResponse { + + /** + * Constructs a new ActionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IActionResponse); + + /** ActionResponse type. */ + public type: (google.chat.v1.ActionResponse.ResponseType|keyof typeof google.chat.v1.ActionResponse.ResponseType); + + /** ActionResponse url. */ + public url: string; + + /** ActionResponse dialogAction. */ + public dialogAction?: (google.chat.v1.IDialogAction|null); + + /** ActionResponse updatedWidget. */ + public updatedWidget?: (google.chat.v1.ActionResponse.IUpdatedWidget|null); + + /** + * Creates a new ActionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ActionResponse instance + */ + public static create(properties?: google.chat.v1.IActionResponse): google.chat.v1.ActionResponse; + + /** + * Encodes the specified ActionResponse message. Does not implicitly {@link google.chat.v1.ActionResponse.verify|verify} messages. + * @param message ActionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IActionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActionResponse message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.verify|verify} messages. + * @param message ActionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IActionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ActionResponse; + + /** + * Decodes an ActionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ActionResponse; + + /** + * Verifies an ActionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActionResponse + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ActionResponse; + + /** + * Creates a plain object from an ActionResponse message. Also converts values to other types if specified. + * @param message ActionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ActionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ActionResponse { + + /** ResponseType enum. */ + enum ResponseType { + TYPE_UNSPECIFIED = 0, + NEW_MESSAGE = 1, + UPDATE_MESSAGE = 2, + UPDATE_USER_MESSAGE_CARDS = 6, + REQUEST_CONFIG = 3, + DIALOG = 4, + UPDATE_WIDGET = 7 + } + + /** Properties of a SelectionItems. */ + interface ISelectionItems { + + /** SelectionItems items */ + items?: (google.apps.card.v1.SelectionInput.ISelectionItem[]|null); + } + + /** Represents a SelectionItems. */ + class SelectionItems implements ISelectionItems { + + /** + * Constructs a new SelectionItems. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ActionResponse.ISelectionItems); + + /** SelectionItems items. */ + public items: google.apps.card.v1.SelectionInput.ISelectionItem[]; + + /** + * Creates a new SelectionItems instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectionItems instance + */ + public static create(properties?: google.chat.v1.ActionResponse.ISelectionItems): google.chat.v1.ActionResponse.SelectionItems; + + /** + * Encodes the specified SelectionItems message. Does not implicitly {@link google.chat.v1.ActionResponse.SelectionItems.verify|verify} messages. + * @param message SelectionItems message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ActionResponse.ISelectionItems, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectionItems message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.SelectionItems.verify|verify} messages. + * @param message SelectionItems message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ActionResponse.ISelectionItems, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectionItems message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectionItems + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ActionResponse.SelectionItems; + + /** + * Decodes a SelectionItems message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectionItems + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ActionResponse.SelectionItems; + + /** + * Verifies a SelectionItems message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectionItems message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectionItems + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ActionResponse.SelectionItems; + + /** + * Creates a plain object from a SelectionItems message. Also converts values to other types if specified. + * @param message SelectionItems + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ActionResponse.SelectionItems, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectionItems to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectionItems + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatedWidget. */ + interface IUpdatedWidget { + + /** UpdatedWidget suggestions */ + suggestions?: (google.chat.v1.ActionResponse.ISelectionItems|null); + + /** UpdatedWidget widget */ + widget?: (string|null); + } + + /** Represents an UpdatedWidget. */ + class UpdatedWidget implements IUpdatedWidget { + + /** + * Constructs a new UpdatedWidget. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ActionResponse.IUpdatedWidget); + + /** UpdatedWidget suggestions. */ + public suggestions?: (google.chat.v1.ActionResponse.ISelectionItems|null); + + /** UpdatedWidget widget. */ + public widget: string; + + /** UpdatedWidget updatedWidget. */ + public updatedWidget?: "suggestions"; + + /** + * Creates a new UpdatedWidget instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatedWidget instance + */ + public static create(properties?: google.chat.v1.ActionResponse.IUpdatedWidget): google.chat.v1.ActionResponse.UpdatedWidget; + + /** + * Encodes the specified UpdatedWidget message. Does not implicitly {@link google.chat.v1.ActionResponse.UpdatedWidget.verify|verify} messages. + * @param message UpdatedWidget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ActionResponse.IUpdatedWidget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatedWidget message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.UpdatedWidget.verify|verify} messages. + * @param message UpdatedWidget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ActionResponse.IUpdatedWidget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatedWidget message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatedWidget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ActionResponse.UpdatedWidget; + + /** + * Decodes an UpdatedWidget message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatedWidget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ActionResponse.UpdatedWidget; + + /** + * Verifies an UpdatedWidget message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatedWidget message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatedWidget + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ActionResponse.UpdatedWidget; + + /** + * Creates a plain object from an UpdatedWidget message. Also converts values to other types if specified. + * @param message UpdatedWidget + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ActionResponse.UpdatedWidget, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatedWidget to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatedWidget + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AccessoryWidget. */ + interface IAccessoryWidget { + + /** AccessoryWidget buttonList */ + buttonList?: (google.apps.card.v1.IButtonList|null); + } + + /** Represents an AccessoryWidget. */ + class AccessoryWidget implements IAccessoryWidget { + + /** + * Constructs a new AccessoryWidget. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IAccessoryWidget); + + /** AccessoryWidget buttonList. */ + public buttonList?: (google.apps.card.v1.IButtonList|null); + + /** AccessoryWidget action. */ + public action?: "buttonList"; + + /** + * Creates a new AccessoryWidget instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessoryWidget instance + */ + public static create(properties?: google.chat.v1.IAccessoryWidget): google.chat.v1.AccessoryWidget; + + /** + * Encodes the specified AccessoryWidget message. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages. + * @param message AccessoryWidget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IAccessoryWidget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessoryWidget message, length delimited. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages. + * @param message AccessoryWidget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IAccessoryWidget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessoryWidget message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessoryWidget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.AccessoryWidget; + + /** + * Decodes an AccessoryWidget message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessoryWidget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.AccessoryWidget; + + /** + * Verifies an AccessoryWidget message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessoryWidget message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessoryWidget + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.AccessoryWidget; + + /** + * Creates a plain object from an AccessoryWidget message. Also converts values to other types if specified. + * @param message AccessoryWidget + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.AccessoryWidget, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessoryWidget to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessoryWidget + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMessageRequest. */ + interface IGetMessageRequest { + + /** GetMessageRequest name */ + name?: (string|null); + } + + /** Represents a GetMessageRequest. */ + class GetMessageRequest implements IGetMessageRequest { + + /** + * Constructs a new GetMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IGetMessageRequest); + + /** GetMessageRequest name. */ + public name: string; + + /** + * Creates a new GetMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMessageRequest instance + */ + public static create(properties?: google.chat.v1.IGetMessageRequest): google.chat.v1.GetMessageRequest; + + /** + * Encodes the specified GetMessageRequest message. Does not implicitly {@link google.chat.v1.GetMessageRequest.verify|verify} messages. + * @param message GetMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IGetMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetMessageRequest.verify|verify} messages. + * @param message GetMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IGetMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.GetMessageRequest; + + /** + * Decodes a GetMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.GetMessageRequest; + + /** + * Verifies a GetMessageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.GetMessageRequest; + + /** + * Creates a plain object from a GetMessageRequest message. Also converts values to other types if specified. + * @param message GetMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.GetMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMessageRequest. */ + interface IDeleteMessageRequest { + + /** DeleteMessageRequest name */ + name?: (string|null); + + /** DeleteMessageRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteMessageRequest. */ + class DeleteMessageRequest implements IDeleteMessageRequest { + + /** + * Constructs a new DeleteMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IDeleteMessageRequest); + + /** DeleteMessageRequest name. */ + public name: string; + + /** DeleteMessageRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMessageRequest instance + */ + public static create(properties?: google.chat.v1.IDeleteMessageRequest): google.chat.v1.DeleteMessageRequest; + + /** + * Encodes the specified DeleteMessageRequest message. Does not implicitly {@link google.chat.v1.DeleteMessageRequest.verify|verify} messages. + * @param message DeleteMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IDeleteMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteMessageRequest.verify|verify} messages. + * @param message DeleteMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IDeleteMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeleteMessageRequest; + + /** + * Decodes a DeleteMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeleteMessageRequest; + + /** + * Verifies a DeleteMessageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.DeleteMessageRequest; + + /** + * Creates a plain object from a DeleteMessageRequest message. Also converts values to other types if specified. + * @param message DeleteMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.DeleteMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMessageRequest. */ + interface IUpdateMessageRequest { + + /** UpdateMessageRequest message */ + message?: (google.chat.v1.IMessage|null); + + /** UpdateMessageRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMessageRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateMessageRequest. */ + class UpdateMessageRequest implements IUpdateMessageRequest { + + /** + * Constructs a new UpdateMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IUpdateMessageRequest); + + /** UpdateMessageRequest message. */ + public message?: (google.chat.v1.IMessage|null); + + /** UpdateMessageRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMessageRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMessageRequest instance + */ + public static create(properties?: google.chat.v1.IUpdateMessageRequest): google.chat.v1.UpdateMessageRequest; + + /** + * Encodes the specified UpdateMessageRequest message. Does not implicitly {@link google.chat.v1.UpdateMessageRequest.verify|verify} messages. + * @param message UpdateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IUpdateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateMessageRequest.verify|verify} messages. + * @param message UpdateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IUpdateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.UpdateMessageRequest; + + /** + * Decodes an UpdateMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.UpdateMessageRequest; + + /** + * Verifies an UpdateMessageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.UpdateMessageRequest; + + /** + * Creates a plain object from an UpdateMessageRequest message. Also converts values to other types if specified. + * @param message UpdateMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.UpdateMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMessageRequest. */ + interface ICreateMessageRequest { + + /** CreateMessageRequest parent */ + parent?: (string|null); + + /** CreateMessageRequest message */ + message?: (google.chat.v1.IMessage|null); + + /** CreateMessageRequest threadKey */ + threadKey?: (string|null); + + /** CreateMessageRequest requestId */ + requestId?: (string|null); + + /** CreateMessageRequest messageReplyOption */ + messageReplyOption?: (google.chat.v1.CreateMessageRequest.MessageReplyOption|keyof typeof google.chat.v1.CreateMessageRequest.MessageReplyOption|null); + + /** CreateMessageRequest messageId */ + messageId?: (string|null); + } + + /** Represents a CreateMessageRequest. */ + class CreateMessageRequest implements ICreateMessageRequest { + + /** + * Constructs a new CreateMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ICreateMessageRequest); + + /** CreateMessageRequest parent. */ + public parent: string; + + /** CreateMessageRequest message. */ + public message?: (google.chat.v1.IMessage|null); + + /** CreateMessageRequest threadKey. */ + public threadKey: string; + + /** CreateMessageRequest requestId. */ + public requestId: string; + + /** CreateMessageRequest messageReplyOption. */ + public messageReplyOption: (google.chat.v1.CreateMessageRequest.MessageReplyOption|keyof typeof google.chat.v1.CreateMessageRequest.MessageReplyOption); + + /** CreateMessageRequest messageId. */ + public messageId: string; + + /** + * Creates a new CreateMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMessageRequest instance + */ + public static create(properties?: google.chat.v1.ICreateMessageRequest): google.chat.v1.CreateMessageRequest; + + /** + * Encodes the specified CreateMessageRequest message. Does not implicitly {@link google.chat.v1.CreateMessageRequest.verify|verify} messages. + * @param message CreateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ICreateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateMessageRequest.verify|verify} messages. + * @param message CreateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ICreateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CreateMessageRequest; + + /** + * Decodes a CreateMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CreateMessageRequest; + + /** + * Verifies a CreateMessageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.CreateMessageRequest; + + /** + * Creates a plain object from a CreateMessageRequest message. Also converts values to other types if specified. + * @param message CreateMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.CreateMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CreateMessageRequest { + + /** MessageReplyOption enum. */ + enum MessageReplyOption { + MESSAGE_REPLY_OPTION_UNSPECIFIED = 0, + REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD = 1, + REPLY_MESSAGE_OR_FAIL = 2 + } + } + + /** Properties of a ListMessagesRequest. */ + interface IListMessagesRequest { + + /** ListMessagesRequest parent */ + parent?: (string|null); + + /** ListMessagesRequest pageSize */ + pageSize?: (number|null); + + /** ListMessagesRequest pageToken */ + pageToken?: (string|null); + + /** ListMessagesRequest filter */ + filter?: (string|null); + + /** ListMessagesRequest orderBy */ + orderBy?: (string|null); + + /** ListMessagesRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListMessagesRequest. */ + class ListMessagesRequest implements IListMessagesRequest { + + /** + * Constructs a new ListMessagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IListMessagesRequest); + + /** ListMessagesRequest parent. */ + public parent: string; + + /** ListMessagesRequest pageSize. */ + public pageSize: number; + + /** ListMessagesRequest pageToken. */ + public pageToken: string; + + /** ListMessagesRequest filter. */ + public filter: string; + + /** ListMessagesRequest orderBy. */ + public orderBy: string; + + /** ListMessagesRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListMessagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMessagesRequest instance + */ + public static create(properties?: google.chat.v1.IListMessagesRequest): google.chat.v1.ListMessagesRequest; + + /** + * Encodes the specified ListMessagesRequest message. Does not implicitly {@link google.chat.v1.ListMessagesRequest.verify|verify} messages. + * @param message ListMessagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IListMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMessagesRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListMessagesRequest.verify|verify} messages. + * @param message ListMessagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IListMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListMessagesRequest; + + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListMessagesRequest; + + /** + * Verifies a ListMessagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMessagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMessagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListMessagesRequest; + + /** + * Creates a plain object from a ListMessagesRequest message. Also converts values to other types if specified. + * @param message ListMessagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ListMessagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMessagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMessagesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMessagesResponse. */ + interface IListMessagesResponse { + + /** ListMessagesResponse messages */ + messages?: (google.chat.v1.IMessage[]|null); + + /** ListMessagesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMessagesResponse. */ + class ListMessagesResponse implements IListMessagesResponse { + + /** + * Constructs a new ListMessagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IListMessagesResponse); + + /** ListMessagesResponse messages. */ + public messages: google.chat.v1.IMessage[]; + + /** ListMessagesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMessagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMessagesResponse instance + */ + public static create(properties?: google.chat.v1.IListMessagesResponse): google.chat.v1.ListMessagesResponse; + + /** + * Encodes the specified ListMessagesResponse message. Does not implicitly {@link google.chat.v1.ListMessagesResponse.verify|verify} messages. + * @param message ListMessagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IListMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMessagesResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListMessagesResponse.verify|verify} messages. + * @param message ListMessagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IListMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListMessagesResponse; + + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListMessagesResponse; + + /** + * Verifies a ListMessagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMessagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMessagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListMessagesResponse; + + /** + * Creates a plain object from a ListMessagesResponse message. Also converts values to other types if specified. + * @param message ListMessagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ListMessagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMessagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMessagesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DialogAction. */ + interface IDialogAction { + + /** DialogAction dialog */ + dialog?: (google.chat.v1.IDialog|null); + + /** DialogAction actionStatus */ + actionStatus?: (google.chat.v1.IActionStatus|null); + } + + /** Represents a DialogAction. */ + class DialogAction implements IDialogAction { + + /** + * Constructs a new DialogAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IDialogAction); + + /** DialogAction dialog. */ + public dialog?: (google.chat.v1.IDialog|null); + + /** DialogAction actionStatus. */ + public actionStatus?: (google.chat.v1.IActionStatus|null); + + /** DialogAction action. */ + public action?: "dialog"; + + /** + * Creates a new DialogAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DialogAction instance + */ + public static create(properties?: google.chat.v1.IDialogAction): google.chat.v1.DialogAction; + + /** + * Encodes the specified DialogAction message. Does not implicitly {@link google.chat.v1.DialogAction.verify|verify} messages. + * @param message DialogAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IDialogAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DialogAction message, length delimited. Does not implicitly {@link google.chat.v1.DialogAction.verify|verify} messages. + * @param message DialogAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IDialogAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DialogAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DialogAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DialogAction; + + /** + * Decodes a DialogAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DialogAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DialogAction; + + /** + * Verifies a DialogAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DialogAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DialogAction + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.DialogAction; + + /** + * Creates a plain object from a DialogAction message. Also converts values to other types if specified. + * @param message DialogAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.DialogAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DialogAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DialogAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Dialog. */ + interface IDialog { + + /** Dialog body */ + body?: (google.apps.card.v1.ICard|null); + } + + /** Represents a Dialog. */ + class Dialog implements IDialog { + + /** + * Constructs a new Dialog. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IDialog); + + /** Dialog body. */ + public body?: (google.apps.card.v1.ICard|null); + + /** + * Creates a new Dialog instance using the specified properties. + * @param [properties] Properties to set + * @returns Dialog instance + */ + public static create(properties?: google.chat.v1.IDialog): google.chat.v1.Dialog; + + /** + * Encodes the specified Dialog message. Does not implicitly {@link google.chat.v1.Dialog.verify|verify} messages. + * @param message Dialog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IDialog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dialog message, length delimited. Does not implicitly {@link google.chat.v1.Dialog.verify|verify} messages. + * @param message Dialog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IDialog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dialog message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dialog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Dialog; + + /** + * Decodes a Dialog message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dialog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Dialog; + + /** + * Verifies a Dialog message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dialog message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dialog + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.Dialog; + + /** + * Creates a plain object from a Dialog message. Also converts values to other types if specified. + * @param message Dialog + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.Dialog, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dialog to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dialog + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CardWithId. */ + interface ICardWithId { + + /** CardWithId cardId */ + cardId?: (string|null); + + /** CardWithId card */ + card?: (google.apps.card.v1.ICard|null); + } + + /** Represents a CardWithId. */ + class CardWithId implements ICardWithId { + + /** + * Constructs a new CardWithId. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ICardWithId); + + /** CardWithId cardId. */ + public cardId: string; + + /** CardWithId card. */ + public card?: (google.apps.card.v1.ICard|null); + + /** + * Creates a new CardWithId instance using the specified properties. + * @param [properties] Properties to set + * @returns CardWithId instance + */ + public static create(properties?: google.chat.v1.ICardWithId): google.chat.v1.CardWithId; + + /** + * Encodes the specified CardWithId message. Does not implicitly {@link google.chat.v1.CardWithId.verify|verify} messages. + * @param message CardWithId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ICardWithId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CardWithId message, length delimited. Does not implicitly {@link google.chat.v1.CardWithId.verify|verify} messages. + * @param message CardWithId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ICardWithId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CardWithId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CardWithId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CardWithId; + + /** + * Decodes a CardWithId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CardWithId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CardWithId; + + /** + * Verifies a CardWithId message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CardWithId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CardWithId + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.CardWithId; + + /** + * Creates a plain object from a CardWithId message. Also converts values to other types if specified. + * @param message CardWithId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.CardWithId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CardWithId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CardWithId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContextualAddOnMarkup. */ + interface IContextualAddOnMarkup { + } + + /** Represents a ContextualAddOnMarkup. */ + class ContextualAddOnMarkup implements IContextualAddOnMarkup { + + /** + * Constructs a new ContextualAddOnMarkup. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IContextualAddOnMarkup); + + /** + * Creates a new ContextualAddOnMarkup instance using the specified properties. + * @param [properties] Properties to set + * @returns ContextualAddOnMarkup instance + */ + public static create(properties?: google.chat.v1.IContextualAddOnMarkup): google.chat.v1.ContextualAddOnMarkup; + + /** + * Encodes the specified ContextualAddOnMarkup message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.verify|verify} messages. + * @param message ContextualAddOnMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IContextualAddOnMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContextualAddOnMarkup message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.verify|verify} messages. + * @param message ContextualAddOnMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IContextualAddOnMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContextualAddOnMarkup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContextualAddOnMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup; + + /** + * Decodes a ContextualAddOnMarkup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContextualAddOnMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup; + + /** + * Verifies a ContextualAddOnMarkup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContextualAddOnMarkup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContextualAddOnMarkup + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup; + + /** + * Creates a plain object from a ContextualAddOnMarkup message. Also converts values to other types if specified. + * @param message ContextualAddOnMarkup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ContextualAddOnMarkup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContextualAddOnMarkup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContextualAddOnMarkup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ContextualAddOnMarkup { + + /** Properties of a Card. */ + interface ICard { + + /** Card header */ + header?: (google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader|null); + + /** Card sections */ + sections?: (google.chat.v1.ContextualAddOnMarkup.Card.ISection[]|null); + + /** Card cardActions */ + cardActions?: (google.chat.v1.ContextualAddOnMarkup.Card.ICardAction[]|null); + + /** Card name */ + name?: (string|null); + } + + /** Represents a Card. */ + class Card implements ICard { + + /** + * Constructs a new Card. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ContextualAddOnMarkup.ICard); + + /** Card header. */ + public header?: (google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader|null); + + /** Card sections. */ + public sections: google.chat.v1.ContextualAddOnMarkup.Card.ISection[]; + + /** Card cardActions. */ + public cardActions: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction[]; + + /** Card name. */ + public name: string; + + /** + * Creates a new Card instance using the specified properties. + * @param [properties] Properties to set + * @returns Card instance + */ + public static create(properties?: google.chat.v1.ContextualAddOnMarkup.ICard): google.chat.v1.ContextualAddOnMarkup.Card; + + /** + * Encodes the specified Card message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.verify|verify} messages. + * @param message Card message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ContextualAddOnMarkup.ICard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Card message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.verify|verify} messages. + * @param message Card message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ContextualAddOnMarkup.ICard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Card message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup.Card; + + /** + * Decodes a Card message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup.Card; + + /** + * Verifies a Card message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Card message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Card + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup.Card; + + /** + * Creates a plain object from a Card message. Also converts values to other types if specified. + * @param message Card + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ContextualAddOnMarkup.Card, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Card to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Card + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Card { + + /** Properties of a CardHeader. */ + interface ICardHeader { + + /** CardHeader title */ + title?: (string|null); + + /** CardHeader subtitle */ + subtitle?: (string|null); + + /** CardHeader imageStyle */ + imageStyle?: (google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle|keyof typeof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle|null); + + /** CardHeader imageUrl */ + imageUrl?: (string|null); + } + + /** Represents a CardHeader. */ + class CardHeader implements ICardHeader { + + /** + * Constructs a new CardHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader); + + /** CardHeader title. */ + public title: string; + + /** CardHeader subtitle. */ + public subtitle: string; + + /** CardHeader imageStyle. */ + public imageStyle: (google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle|keyof typeof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle); + + /** CardHeader imageUrl. */ + public imageUrl: string; + + /** + * Creates a new CardHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns CardHeader instance + */ + public static create(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader): google.chat.v1.ContextualAddOnMarkup.Card.CardHeader; + + /** + * Encodes the specified CardHeader message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify|verify} messages. + * @param message CardHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CardHeader message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify|verify} messages. + * @param message CardHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CardHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CardHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup.Card.CardHeader; + + /** + * Decodes a CardHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CardHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup.Card.CardHeader; + + /** + * Verifies a CardHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CardHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CardHeader + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup.Card.CardHeader; + + /** + * Creates a plain object from a CardHeader message. Also converts values to other types if specified. + * @param message CardHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ContextualAddOnMarkup.Card.CardHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CardHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CardHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CardHeader { + + /** ImageStyle enum. */ + enum ImageStyle { + IMAGE_STYLE_UNSPECIFIED = 0, + IMAGE = 1, + AVATAR = 2 + } + } + + /** Properties of a Section. */ + interface ISection { + + /** Section header */ + header?: (string|null); + + /** Section widgets */ + widgets?: (google.chat.v1.IWidgetMarkup[]|null); + } + + /** Represents a Section. */ + class Section implements ISection { + + /** + * Constructs a new Section. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ISection); + + /** Section header. */ + public header: string; + + /** Section widgets. */ + public widgets: google.chat.v1.IWidgetMarkup[]; + + /** + * Creates a new Section instance using the specified properties. + * @param [properties] Properties to set + * @returns Section instance + */ + public static create(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ISection): google.chat.v1.ContextualAddOnMarkup.Card.Section; + + /** + * Encodes the specified Section message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.Section.verify|verify} messages. + * @param message Section message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ContextualAddOnMarkup.Card.ISection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Section message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.Section.verify|verify} messages. + * @param message Section message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ContextualAddOnMarkup.Card.ISection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Section message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Section + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup.Card.Section; + + /** + * Decodes a Section message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Section + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup.Card.Section; + + /** + * Verifies a Section message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Section message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Section + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup.Card.Section; + + /** + * Creates a plain object from a Section message. Also converts values to other types if specified. + * @param message Section + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ContextualAddOnMarkup.Card.Section, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Section to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Section + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CardAction. */ + interface ICardAction { + + /** CardAction actionLabel */ + actionLabel?: (string|null); + + /** CardAction onClick */ + onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + } + + /** Represents a CardAction. */ + class CardAction implements ICardAction { + + /** + * Constructs a new CardAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction); + + /** CardAction actionLabel. */ + public actionLabel: string; + + /** CardAction onClick. */ + public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + + /** + * Creates a new CardAction instance using the specified properties. + * @param [properties] Properties to set + * @returns CardAction instance + */ + public static create(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction): google.chat.v1.ContextualAddOnMarkup.Card.CardAction; + + /** + * Encodes the specified CardAction message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify|verify} messages. + * @param message CardAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CardAction message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify|verify} messages. + * @param message CardAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CardAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CardAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup.Card.CardAction; + + /** + * Decodes a CardAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CardAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup.Card.CardAction; + + /** + * Verifies a CardAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CardAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CardAction + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup.Card.CardAction; + + /** + * Creates a plain object from a CardAction message. Also converts values to other types if specified. + * @param message CardAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ContextualAddOnMarkup.Card.CardAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CardAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CardAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a WidgetMarkup. */ + interface IWidgetMarkup { + + /** WidgetMarkup textParagraph */ + textParagraph?: (google.chat.v1.WidgetMarkup.ITextParagraph|null); + + /** WidgetMarkup image */ + image?: (google.chat.v1.WidgetMarkup.IImage|null); + + /** WidgetMarkup keyValue */ + keyValue?: (google.chat.v1.WidgetMarkup.IKeyValue|null); + + /** WidgetMarkup buttons */ + buttons?: (google.chat.v1.WidgetMarkup.IButton[]|null); + } + + /** Represents a WidgetMarkup. */ + class WidgetMarkup implements IWidgetMarkup { + + /** + * Constructs a new WidgetMarkup. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IWidgetMarkup); + + /** WidgetMarkup textParagraph. */ + public textParagraph?: (google.chat.v1.WidgetMarkup.ITextParagraph|null); + + /** WidgetMarkup image. */ + public image?: (google.chat.v1.WidgetMarkup.IImage|null); + + /** WidgetMarkup keyValue. */ + public keyValue?: (google.chat.v1.WidgetMarkup.IKeyValue|null); + + /** WidgetMarkup buttons. */ + public buttons: google.chat.v1.WidgetMarkup.IButton[]; + + /** WidgetMarkup data. */ + public data?: ("textParagraph"|"image"|"keyValue"); + + /** + * Creates a new WidgetMarkup instance using the specified properties. + * @param [properties] Properties to set + * @returns WidgetMarkup instance + */ + public static create(properties?: google.chat.v1.IWidgetMarkup): google.chat.v1.WidgetMarkup; + + /** + * Encodes the specified WidgetMarkup message. Does not implicitly {@link google.chat.v1.WidgetMarkup.verify|verify} messages. + * @param message WidgetMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IWidgetMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WidgetMarkup message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.verify|verify} messages. + * @param message WidgetMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IWidgetMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WidgetMarkup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WidgetMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup; + + /** + * Decodes a WidgetMarkup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WidgetMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup; + + /** + * Verifies a WidgetMarkup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WidgetMarkup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WidgetMarkup + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup; + + /** + * Creates a plain object from a WidgetMarkup message. Also converts values to other types if specified. + * @param message WidgetMarkup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WidgetMarkup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WidgetMarkup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WidgetMarkup { + + /** Properties of a TextParagraph. */ + interface ITextParagraph { + + /** TextParagraph text */ + text?: (string|null); + } + + /** Represents a TextParagraph. */ + class TextParagraph implements ITextParagraph { + + /** + * Constructs a new TextParagraph. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.ITextParagraph); + + /** TextParagraph text. */ + public text: string; + + /** + * Creates a new TextParagraph instance using the specified properties. + * @param [properties] Properties to set + * @returns TextParagraph instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.ITextParagraph): google.chat.v1.WidgetMarkup.TextParagraph; + + /** + * Encodes the specified TextParagraph message. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextParagraph.verify|verify} messages. + * @param message TextParagraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.ITextParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextParagraph message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextParagraph.verify|verify} messages. + * @param message TextParagraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.ITextParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextParagraph message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextParagraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.TextParagraph; + + /** + * Decodes a TextParagraph message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextParagraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.TextParagraph; + + /** + * Verifies a TextParagraph message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextParagraph message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextParagraph + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.TextParagraph; + + /** + * Creates a plain object from a TextParagraph message. Also converts values to other types if specified. + * @param message TextParagraph + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.TextParagraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextParagraph to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextParagraph + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Icon enum. */ + enum Icon { + ICON_UNSPECIFIED = 0, + AIRPLANE = 1, + BOOKMARK = 26, + BUS = 25, + CAR = 9, + CLOCK = 2, + CONFIRMATION_NUMBER_ICON = 12, + DOLLAR = 14, + DESCRIPTION = 27, + EMAIL = 10, + EVENT_PERFORMER = 20, + EVENT_SEAT = 21, + FLIGHT_ARRIVAL = 16, + FLIGHT_DEPARTURE = 15, + HOTEL = 6, + HOTEL_ROOM_TYPE = 17, + INVITE = 19, + MAP_PIN = 3, + MEMBERSHIP = 24, + MULTIPLE_PEOPLE = 18, + OFFER = 30, + PERSON = 11, + PHONE = 13, + RESTAURANT_ICON = 7, + SHOPPING_CART = 8, + STAR = 5, + STORE = 22, + TICKET = 4, + TRAIN = 23, + VIDEO_CAMERA = 28, + VIDEO_PLAY = 29 + } + + /** Properties of a Button. */ + interface IButton { + + /** Button textButton */ + textButton?: (google.chat.v1.WidgetMarkup.ITextButton|null); + + /** Button imageButton */ + imageButton?: (google.chat.v1.WidgetMarkup.IImageButton|null); + } + + /** Represents a Button. */ + class Button implements IButton { + + /** + * Constructs a new Button. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IButton); + + /** Button textButton. */ + public textButton?: (google.chat.v1.WidgetMarkup.ITextButton|null); + + /** Button imageButton. */ + public imageButton?: (google.chat.v1.WidgetMarkup.IImageButton|null); + + /** Button type. */ + public type?: ("textButton"|"imageButton"); + + /** + * Creates a new Button instance using the specified properties. + * @param [properties] Properties to set + * @returns Button instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IButton): google.chat.v1.WidgetMarkup.Button; + + /** + * Encodes the specified Button message. Does not implicitly {@link google.chat.v1.WidgetMarkup.Button.verify|verify} messages. + * @param message Button message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.Button.verify|verify} messages. + * @param message Button message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Button message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.Button; + + /** + * Decodes a Button message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.Button; + + /** + * Verifies a Button message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Button message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Button + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.Button; + + /** + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @param message Button + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Button to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Button + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextButton. */ + interface ITextButton { + + /** TextButton text */ + text?: (string|null); + + /** TextButton onClick */ + onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + } + + /** Represents a TextButton. */ + class TextButton implements ITextButton { + + /** + * Constructs a new TextButton. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.ITextButton); + + /** TextButton text. */ + public text: string; + + /** TextButton onClick. */ + public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + + /** + * Creates a new TextButton instance using the specified properties. + * @param [properties] Properties to set + * @returns TextButton instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.ITextButton): google.chat.v1.WidgetMarkup.TextButton; + + /** + * Encodes the specified TextButton message. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextButton.verify|verify} messages. + * @param message TextButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.ITextButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextButton message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextButton.verify|verify} messages. + * @param message TextButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.ITextButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.TextButton; + + /** + * Decodes a TextButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.TextButton; + + /** + * Verifies a TextButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextButton + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.TextButton; + + /** + * Creates a plain object from a TextButton message. Also converts values to other types if specified. + * @param message TextButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.TextButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextButton + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyValue. */ + interface IKeyValue { + + /** KeyValue icon */ + icon?: (google.chat.v1.WidgetMarkup.Icon|keyof typeof google.chat.v1.WidgetMarkup.Icon|null); + + /** KeyValue iconUrl */ + iconUrl?: (string|null); + + /** KeyValue topLabel */ + topLabel?: (string|null); + + /** KeyValue content */ + content?: (string|null); + + /** KeyValue contentMultiline */ + contentMultiline?: (boolean|null); + + /** KeyValue bottomLabel */ + bottomLabel?: (string|null); + + /** KeyValue onClick */ + onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + + /** KeyValue button */ + button?: (google.chat.v1.WidgetMarkup.IButton|null); + } + + /** Represents a KeyValue. */ + class KeyValue implements IKeyValue { + + /** + * Constructs a new KeyValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IKeyValue); + + /** KeyValue icon. */ + public icon?: (google.chat.v1.WidgetMarkup.Icon|keyof typeof google.chat.v1.WidgetMarkup.Icon|null); + + /** KeyValue iconUrl. */ + public iconUrl?: (string|null); + + /** KeyValue topLabel. */ + public topLabel: string; + + /** KeyValue content. */ + public content: string; + + /** KeyValue contentMultiline. */ + public contentMultiline: boolean; + + /** KeyValue bottomLabel. */ + public bottomLabel: string; + + /** KeyValue onClick. */ + public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + + /** KeyValue button. */ + public button?: (google.chat.v1.WidgetMarkup.IButton|null); + + /** KeyValue icons. */ + public icons?: ("icon"|"iconUrl"); + + /** KeyValue control. */ + public control?: "button"; + + /** + * Creates a new KeyValue instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyValue instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IKeyValue): google.chat.v1.WidgetMarkup.KeyValue; + + /** + * Encodes the specified KeyValue message. Does not implicitly {@link google.chat.v1.WidgetMarkup.KeyValue.verify|verify} messages. + * @param message KeyValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.IKeyValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.KeyValue.verify|verify} messages. + * @param message KeyValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IKeyValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.KeyValue; + + /** + * Decodes a KeyValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.KeyValue; + + /** + * Verifies a KeyValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyValue + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.KeyValue; + + /** + * Creates a plain object from a KeyValue message. Also converts values to other types if specified. + * @param message KeyValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.KeyValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image imageUrl */ + imageUrl?: (string|null); + + /** Image onClick */ + onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + + /** Image aspectRatio */ + aspectRatio?: (number|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IImage); + + /** Image imageUrl. */ + public imageUrl: string; + + /** Image onClick. */ + public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + + /** Image aspectRatio. */ + public aspectRatio: number; + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IImage): google.chat.v1.WidgetMarkup.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.chat.v1.WidgetMarkup.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.Image; + + /** + * Verifies an Image message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Image + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageButton. */ + interface IImageButton { + + /** ImageButton icon */ + icon?: (google.chat.v1.WidgetMarkup.Icon|keyof typeof google.chat.v1.WidgetMarkup.Icon|null); + + /** ImageButton iconUrl */ + iconUrl?: (string|null); + + /** ImageButton onClick */ + onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + + /** ImageButton name */ + name?: (string|null); + } + + /** Represents an ImageButton. */ + class ImageButton implements IImageButton { + + /** + * Constructs a new ImageButton. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IImageButton); + + /** ImageButton icon. */ + public icon?: (google.chat.v1.WidgetMarkup.Icon|keyof typeof google.chat.v1.WidgetMarkup.Icon|null); + + /** ImageButton iconUrl. */ + public iconUrl?: (string|null); + + /** ImageButton onClick. */ + public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + + /** ImageButton name. */ + public name: string; + + /** ImageButton icons. */ + public icons?: ("icon"|"iconUrl"); + + /** + * Creates a new ImageButton instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageButton instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IImageButton): google.chat.v1.WidgetMarkup.ImageButton; + + /** + * Encodes the specified ImageButton message. Does not implicitly {@link google.chat.v1.WidgetMarkup.ImageButton.verify|verify} messages. + * @param message ImageButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.IImageButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageButton message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.ImageButton.verify|verify} messages. + * @param message ImageButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IImageButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.ImageButton; + + /** + * Decodes an ImageButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.ImageButton; + + /** + * Verifies an ImageButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImageButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageButton + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.ImageButton; + + /** + * Creates a plain object from an ImageButton message. Also converts values to other types if specified. + * @param message ImageButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.ImageButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageButton + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OnClick. */ + interface IOnClick { + + /** OnClick action */ + action?: (google.chat.v1.WidgetMarkup.IFormAction|null); + + /** OnClick openLink */ + openLink?: (google.chat.v1.WidgetMarkup.IOpenLink|null); + } + + /** Represents an OnClick. */ + class OnClick implements IOnClick { + + /** + * Constructs a new OnClick. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IOnClick); + + /** OnClick action. */ + public action?: (google.chat.v1.WidgetMarkup.IFormAction|null); + + /** OnClick openLink. */ + public openLink?: (google.chat.v1.WidgetMarkup.IOpenLink|null); + + /** OnClick data. */ + public data?: ("action"|"openLink"); + + /** + * Creates a new OnClick instance using the specified properties. + * @param [properties] Properties to set + * @returns OnClick instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IOnClick): google.chat.v1.WidgetMarkup.OnClick; + + /** + * Encodes the specified OnClick message. Does not implicitly {@link google.chat.v1.WidgetMarkup.OnClick.verify|verify} messages. + * @param message OnClick message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.IOnClick, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OnClick message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.OnClick.verify|verify} messages. + * @param message OnClick message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IOnClick, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OnClick message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnClick + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.OnClick; + + /** + * Decodes an OnClick message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnClick + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.OnClick; + + /** + * Verifies an OnClick message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OnClick message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnClick + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.OnClick; + + /** + * Creates a plain object from an OnClick message. Also converts values to other types if specified. + * @param message OnClick + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.OnClick, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OnClick to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnClick + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenLink. */ + interface IOpenLink { + + /** OpenLink url */ + url?: (string|null); + } + + /** Represents an OpenLink. */ + class OpenLink implements IOpenLink { + + /** + * Constructs a new OpenLink. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IOpenLink); + + /** OpenLink url. */ + public url: string; + + /** + * Creates a new OpenLink instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenLink instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IOpenLink): google.chat.v1.WidgetMarkup.OpenLink; + + /** + * Encodes the specified OpenLink message. Does not implicitly {@link google.chat.v1.WidgetMarkup.OpenLink.verify|verify} messages. + * @param message OpenLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.IOpenLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenLink message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.OpenLink.verify|verify} messages. + * @param message OpenLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IOpenLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenLink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.OpenLink; + + /** + * Decodes an OpenLink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.OpenLink; + + /** + * Verifies an OpenLink message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OpenLink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenLink + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.OpenLink; + + /** + * Creates a plain object from an OpenLink message. Also converts values to other types if specified. + * @param message OpenLink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.OpenLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenLink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenLink + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FormAction. */ + interface IFormAction { + + /** FormAction actionMethodName */ + actionMethodName?: (string|null); + + /** FormAction parameters */ + parameters?: (google.chat.v1.WidgetMarkup.FormAction.IActionParameter[]|null); + } + + /** Represents a FormAction. */ + class FormAction implements IFormAction { + + /** + * Constructs a new FormAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IFormAction); + + /** FormAction actionMethodName. */ + public actionMethodName: string; + + /** FormAction parameters. */ + public parameters: google.chat.v1.WidgetMarkup.FormAction.IActionParameter[]; + + /** + * Creates a new FormAction instance using the specified properties. + * @param [properties] Properties to set + * @returns FormAction instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IFormAction): google.chat.v1.WidgetMarkup.FormAction; + + /** + * Encodes the specified FormAction message. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.verify|verify} messages. + * @param message FormAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.IFormAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FormAction message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.verify|verify} messages. + * @param message FormAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IFormAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FormAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FormAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.FormAction; + + /** + * Decodes a FormAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FormAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.FormAction; + + /** + * Verifies a FormAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FormAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FormAction + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.FormAction; + + /** + * Creates a plain object from a FormAction message. Also converts values to other types if specified. + * @param message FormAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.FormAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FormAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FormAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FormAction { + + /** Properties of an ActionParameter. */ + interface IActionParameter { + + /** ActionParameter key */ + key?: (string|null); + + /** ActionParameter value */ + value?: (string|null); + } + + /** Represents an ActionParameter. */ + class ActionParameter implements IActionParameter { + + /** + * Constructs a new ActionParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.FormAction.IActionParameter); + + /** ActionParameter key. */ + public key: string; + + /** ActionParameter value. */ + public value: string; + + /** + * Creates a new ActionParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns ActionParameter instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.FormAction.IActionParameter): google.chat.v1.WidgetMarkup.FormAction.ActionParameter; + + /** + * Encodes the specified ActionParameter message. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.ActionParameter.verify|verify} messages. + * @param message ActionParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.FormAction.IActionParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActionParameter message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.ActionParameter.verify|verify} messages. + * @param message ActionParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.FormAction.IActionParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActionParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActionParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.FormAction.ActionParameter; + + /** + * Decodes an ActionParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActionParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.FormAction.ActionParameter; + + /** + * Verifies an ActionParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActionParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActionParameter + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.FormAction.ActionParameter; + + /** + * Creates a plain object from an ActionParameter message. Also converts values to other types if specified. + * @param message ActionParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.FormAction.ActionParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActionParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActionParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a DeletionMetadata. */ + interface IDeletionMetadata { + + /** DeletionMetadata deletionType */ + deletionType?: (google.chat.v1.DeletionMetadata.DeletionType|keyof typeof google.chat.v1.DeletionMetadata.DeletionType|null); + } + + /** Represents a DeletionMetadata. */ + class DeletionMetadata implements IDeletionMetadata { + + /** + * Constructs a new DeletionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IDeletionMetadata); + + /** DeletionMetadata deletionType. */ + public deletionType: (google.chat.v1.DeletionMetadata.DeletionType|keyof typeof google.chat.v1.DeletionMetadata.DeletionType); + + /** + * Creates a new DeletionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletionMetadata instance + */ + public static create(properties?: google.chat.v1.IDeletionMetadata): google.chat.v1.DeletionMetadata; + + /** + * Encodes the specified DeletionMetadata message. Does not implicitly {@link google.chat.v1.DeletionMetadata.verify|verify} messages. + * @param message DeletionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IDeletionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletionMetadata message, length delimited. Does not implicitly {@link google.chat.v1.DeletionMetadata.verify|verify} messages. + * @param message DeletionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IDeletionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeletionMetadata; + + /** + * Decodes a DeletionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeletionMetadata; + + /** + * Verifies a DeletionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.DeletionMetadata; + + /** + * Creates a plain object from a DeletionMetadata message. Also converts values to other types if specified. + * @param message DeletionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.DeletionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DeletionMetadata { + + /** DeletionType enum. */ + enum DeletionType { + DELETION_TYPE_UNSPECIFIED = 0, + CREATOR = 1, + SPACE_OWNER = 2, + ADMIN = 3, + APP_MESSAGE_EXPIRY = 4, + CREATOR_VIA_APP = 5, + SPACE_OWNER_VIA_APP = 6 + } + } + + /** Properties of a MatchedUrl. */ + interface IMatchedUrl { + + /** MatchedUrl url */ + url?: (string|null); + } + + /** Represents a MatchedUrl. */ + class MatchedUrl implements IMatchedUrl { + + /** + * Constructs a new MatchedUrl. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMatchedUrl); + + /** MatchedUrl url. */ + public url: string; + + /** + * Creates a new MatchedUrl instance using the specified properties. + * @param [properties] Properties to set + * @returns MatchedUrl instance + */ + public static create(properties?: google.chat.v1.IMatchedUrl): google.chat.v1.MatchedUrl; + + /** + * Encodes the specified MatchedUrl message. Does not implicitly {@link google.chat.v1.MatchedUrl.verify|verify} messages. + * @param message MatchedUrl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMatchedUrl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MatchedUrl message, length delimited. Does not implicitly {@link google.chat.v1.MatchedUrl.verify|verify} messages. + * @param message MatchedUrl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMatchedUrl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MatchedUrl message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MatchedUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MatchedUrl; + + /** + * Decodes a MatchedUrl message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MatchedUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MatchedUrl; + + /** + * Verifies a MatchedUrl message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MatchedUrl message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MatchedUrl + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MatchedUrl; + + /** + * Creates a plain object from a MatchedUrl message. Also converts values to other types if specified. + * @param message MatchedUrl + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MatchedUrl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MatchedUrl to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MatchedUrl + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Reaction. */ + interface IReaction { + + /** Reaction name */ + name?: (string|null); + + /** Reaction user */ + user?: (google.chat.v1.IUser|null); + + /** Reaction emoji */ + emoji?: (google.chat.v1.IEmoji|null); + } + + /** Represents a Reaction. */ + class Reaction implements IReaction { + + /** + * Constructs a new Reaction. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IReaction); + + /** Reaction name. */ + public name: string; + + /** Reaction user. */ + public user?: (google.chat.v1.IUser|null); + + /** Reaction emoji. */ + public emoji?: (google.chat.v1.IEmoji|null); + + /** + * Creates a new Reaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Reaction instance + */ + public static create(properties?: google.chat.v1.IReaction): google.chat.v1.Reaction; + + /** + * Encodes the specified Reaction message. Does not implicitly {@link google.chat.v1.Reaction.verify|verify} messages. + * @param message Reaction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IReaction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Reaction message, length delimited. Does not implicitly {@link google.chat.v1.Reaction.verify|verify} messages. + * @param message Reaction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IReaction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Reaction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Reaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Reaction; + + /** + * Decodes a Reaction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Reaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Reaction; + + /** + * Verifies a Reaction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Reaction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Reaction + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.Reaction; + + /** + * Creates a plain object from a Reaction message. Also converts values to other types if specified. + * @param message Reaction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.Reaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Reaction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Reaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Emoji. */ + interface IEmoji { + + /** Emoji unicode */ + unicode?: (string|null); + + /** Emoji customEmoji */ + customEmoji?: (google.chat.v1.ICustomEmoji|null); + } + + /** Represents an Emoji. */ + class Emoji implements IEmoji { + + /** + * Constructs a new Emoji. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IEmoji); + + /** Emoji unicode. */ + public unicode?: (string|null); + + /** Emoji customEmoji. */ + public customEmoji?: (google.chat.v1.ICustomEmoji|null); + + /** Emoji content. */ + public content?: ("unicode"|"customEmoji"); + + /** + * Creates a new Emoji instance using the specified properties. + * @param [properties] Properties to set + * @returns Emoji instance + */ + public static create(properties?: google.chat.v1.IEmoji): google.chat.v1.Emoji; + + /** + * Encodes the specified Emoji message. Does not implicitly {@link google.chat.v1.Emoji.verify|verify} messages. + * @param message Emoji message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IEmoji, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Emoji message, length delimited. Does not implicitly {@link google.chat.v1.Emoji.verify|verify} messages. + * @param message Emoji message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IEmoji, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Emoji message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Emoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Emoji; + + /** + * Decodes an Emoji message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Emoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Emoji; + + /** + * Verifies an Emoji message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Emoji message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Emoji + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.Emoji; + + /** + * Creates a plain object from an Emoji message. Also converts values to other types if specified. + * @param message Emoji + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.Emoji, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Emoji to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Emoji + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomEmoji. */ + interface ICustomEmoji { + + /** CustomEmoji uid */ + uid?: (string|null); + } + + /** Represents a CustomEmoji. */ + class CustomEmoji implements ICustomEmoji { + + /** + * Constructs a new CustomEmoji. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ICustomEmoji); + + /** CustomEmoji uid. */ + public uid: string; + + /** + * Creates a new CustomEmoji instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomEmoji instance + */ + public static create(properties?: google.chat.v1.ICustomEmoji): google.chat.v1.CustomEmoji; + + /** + * Encodes the specified CustomEmoji message. Does not implicitly {@link google.chat.v1.CustomEmoji.verify|verify} messages. + * @param message CustomEmoji message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ICustomEmoji, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomEmoji message, length delimited. Does not implicitly {@link google.chat.v1.CustomEmoji.verify|verify} messages. + * @param message CustomEmoji message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ICustomEmoji, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomEmoji message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomEmoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CustomEmoji; + + /** + * Decodes a CustomEmoji message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomEmoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CustomEmoji; + + /** + * Verifies a CustomEmoji message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomEmoji message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomEmoji + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.CustomEmoji; + + /** + * Creates a plain object from a CustomEmoji message. Also converts values to other types if specified. + * @param message CustomEmoji + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.CustomEmoji, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomEmoji to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomEmoji + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EmojiReactionSummary. */ + interface IEmojiReactionSummary { + + /** EmojiReactionSummary emoji */ + emoji?: (google.chat.v1.IEmoji|null); + + /** EmojiReactionSummary reactionCount */ + reactionCount?: (number|null); + } + + /** Represents an EmojiReactionSummary. */ + class EmojiReactionSummary implements IEmojiReactionSummary { + + /** + * Constructs a new EmojiReactionSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IEmojiReactionSummary); + + /** EmojiReactionSummary emoji. */ + public emoji?: (google.chat.v1.IEmoji|null); + + /** EmojiReactionSummary reactionCount. */ + public reactionCount?: (number|null); + + /** EmojiReactionSummary _reactionCount. */ + public _reactionCount?: "reactionCount"; + + /** + * Creates a new EmojiReactionSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns EmojiReactionSummary instance + */ + public static create(properties?: google.chat.v1.IEmojiReactionSummary): google.chat.v1.EmojiReactionSummary; + + /** + * Encodes the specified EmojiReactionSummary message. Does not implicitly {@link google.chat.v1.EmojiReactionSummary.verify|verify} messages. + * @param message EmojiReactionSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IEmojiReactionSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmojiReactionSummary message, length delimited. Does not implicitly {@link google.chat.v1.EmojiReactionSummary.verify|verify} messages. + * @param message EmojiReactionSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IEmojiReactionSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmojiReactionSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmojiReactionSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.EmojiReactionSummary; + + /** + * Decodes an EmojiReactionSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmojiReactionSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.EmojiReactionSummary; + + /** + * Verifies an EmojiReactionSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EmojiReactionSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmojiReactionSummary + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.EmojiReactionSummary; + + /** + * Creates a plain object from an EmojiReactionSummary message. Also converts values to other types if specified. + * @param message EmojiReactionSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.EmojiReactionSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmojiReactionSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmojiReactionSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateReactionRequest. */ + interface ICreateReactionRequest { + + /** CreateReactionRequest parent */ + parent?: (string|null); + + /** CreateReactionRequest reaction */ + reaction?: (google.chat.v1.IReaction|null); + } + + /** Represents a CreateReactionRequest. */ + class CreateReactionRequest implements ICreateReactionRequest { + + /** + * Constructs a new CreateReactionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ICreateReactionRequest); + + /** CreateReactionRequest parent. */ + public parent: string; + + /** CreateReactionRequest reaction. */ + public reaction?: (google.chat.v1.IReaction|null); + + /** + * Creates a new CreateReactionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReactionRequest instance + */ + public static create(properties?: google.chat.v1.ICreateReactionRequest): google.chat.v1.CreateReactionRequest; + + /** + * Encodes the specified CreateReactionRequest message. Does not implicitly {@link google.chat.v1.CreateReactionRequest.verify|verify} messages. + * @param message CreateReactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ICreateReactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateReactionRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateReactionRequest.verify|verify} messages. + * @param message CreateReactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ICreateReactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateReactionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CreateReactionRequest; + + /** + * Decodes a CreateReactionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CreateReactionRequest; + + /** + * Verifies a CreateReactionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateReactionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReactionRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.CreateReactionRequest; + + /** + * Creates a plain object from a CreateReactionRequest message. Also converts values to other types if specified. + * @param message CreateReactionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.CreateReactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateReactionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateReactionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReactionsRequest. */ + interface IListReactionsRequest { + + /** ListReactionsRequest parent */ + parent?: (string|null); + + /** ListReactionsRequest pageSize */ + pageSize?: (number|null); + + /** ListReactionsRequest pageToken */ + pageToken?: (string|null); + + /** ListReactionsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListReactionsRequest. */ + class ListReactionsRequest implements IListReactionsRequest { + + /** + * Constructs a new ListReactionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IListReactionsRequest); + + /** ListReactionsRequest parent. */ + public parent: string; + + /** ListReactionsRequest pageSize. */ + public pageSize: number; + + /** ListReactionsRequest pageToken. */ + public pageToken: string; + + /** ListReactionsRequest filter. */ + public filter: string; + + /** + * Creates a new ListReactionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReactionsRequest instance + */ + public static create(properties?: google.chat.v1.IListReactionsRequest): google.chat.v1.ListReactionsRequest; + + /** + * Encodes the specified ListReactionsRequest message. Does not implicitly {@link google.chat.v1.ListReactionsRequest.verify|verify} messages. + * @param message ListReactionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IListReactionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReactionsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListReactionsRequest.verify|verify} messages. + * @param message ListReactionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IListReactionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReactionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReactionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListReactionsRequest; + + /** + * Decodes a ListReactionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReactionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListReactionsRequest; + + /** + * Verifies a ListReactionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReactionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReactionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListReactionsRequest; + + /** + * Creates a plain object from a ListReactionsRequest message. Also converts values to other types if specified. + * @param message ListReactionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ListReactionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReactionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReactionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReactionsResponse. */ + interface IListReactionsResponse { + + /** ListReactionsResponse reactions */ + reactions?: (google.chat.v1.IReaction[]|null); + + /** ListReactionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListReactionsResponse. */ + class ListReactionsResponse implements IListReactionsResponse { + + /** + * Constructs a new ListReactionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IListReactionsResponse); + + /** ListReactionsResponse reactions. */ + public reactions: google.chat.v1.IReaction[]; + + /** ListReactionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListReactionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReactionsResponse instance + */ + public static create(properties?: google.chat.v1.IListReactionsResponse): google.chat.v1.ListReactionsResponse; + + /** + * Encodes the specified ListReactionsResponse message. Does not implicitly {@link google.chat.v1.ListReactionsResponse.verify|verify} messages. + * @param message ListReactionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IListReactionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReactionsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListReactionsResponse.verify|verify} messages. + * @param message ListReactionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IListReactionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReactionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReactionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListReactionsResponse; + + /** + * Decodes a ListReactionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReactionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListReactionsResponse; + + /** + * Verifies a ListReactionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReactionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReactionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListReactionsResponse; + + /** + * Creates a plain object from a ListReactionsResponse message. Also converts values to other types if specified. + * @param message ListReactionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ListReactionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReactionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReactionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteReactionRequest. */ + interface IDeleteReactionRequest { + + /** DeleteReactionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteReactionRequest. */ + class DeleteReactionRequest implements IDeleteReactionRequest { + + /** + * Constructs a new DeleteReactionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IDeleteReactionRequest); + + /** DeleteReactionRequest name. */ + public name: string; + + /** + * Creates a new DeleteReactionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteReactionRequest instance + */ + public static create(properties?: google.chat.v1.IDeleteReactionRequest): google.chat.v1.DeleteReactionRequest; + + /** + * Encodes the specified DeleteReactionRequest message. Does not implicitly {@link google.chat.v1.DeleteReactionRequest.verify|verify} messages. + * @param message DeleteReactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IDeleteReactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteReactionRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteReactionRequest.verify|verify} messages. + * @param message DeleteReactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IDeleteReactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteReactionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeleteReactionRequest; + + /** + * Decodes a DeleteReactionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeleteReactionRequest; + + /** + * Verifies a DeleteReactionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteReactionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteReactionRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.DeleteReactionRequest; + + /** + * Creates a plain object from a DeleteReactionRequest message. Also converts values to other types if specified. + * @param message DeleteReactionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.DeleteReactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteReactionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteReactionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SlashCommand. */ + interface ISlashCommand { + + /** SlashCommand commandId */ + commandId?: (number|Long|string|null); + } + + /** Represents a SlashCommand. */ + class SlashCommand implements ISlashCommand { + + /** + * Constructs a new SlashCommand. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ISlashCommand); + + /** SlashCommand commandId. */ + public commandId: (number|Long|string); + + /** + * Creates a new SlashCommand instance using the specified properties. + * @param [properties] Properties to set + * @returns SlashCommand instance + */ + public static create(properties?: google.chat.v1.ISlashCommand): google.chat.v1.SlashCommand; + + /** + * Encodes the specified SlashCommand message. Does not implicitly {@link google.chat.v1.SlashCommand.verify|verify} messages. + * @param message SlashCommand message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ISlashCommand, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SlashCommand message, length delimited. Does not implicitly {@link google.chat.v1.SlashCommand.verify|verify} messages. + * @param message SlashCommand message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ISlashCommand, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SlashCommand message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SlashCommand + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.SlashCommand; + + /** + * Decodes a SlashCommand message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SlashCommand + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.SlashCommand; + + /** + * Verifies a SlashCommand message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SlashCommand message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SlashCommand + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.SlashCommand; + + /** + * Creates a plain object from a SlashCommand message. Also converts values to other types if specified. + * @param message SlashCommand + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.SlashCommand, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SlashCommand to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SlashCommand + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Space. */ + interface ISpace { + + /** Space name */ + name?: (string|null); + + /** Space type */ + type?: (google.chat.v1.Space.Type|keyof typeof google.chat.v1.Space.Type|null); + + /** Space spaceType */ + spaceType?: (google.chat.v1.Space.SpaceType|keyof typeof google.chat.v1.Space.SpaceType|null); + + /** Space singleUserBotDm */ + singleUserBotDm?: (boolean|null); + + /** Space threaded */ + threaded?: (boolean|null); + + /** Space displayName */ + displayName?: (string|null); + + /** Space externalUserAllowed */ + externalUserAllowed?: (boolean|null); + + /** Space spaceThreadingState */ + spaceThreadingState?: (google.chat.v1.Space.SpaceThreadingState|keyof typeof google.chat.v1.Space.SpaceThreadingState|null); + + /** Space spaceDetails */ + spaceDetails?: (google.chat.v1.Space.ISpaceDetails|null); + + /** Space spaceHistoryState */ + spaceHistoryState?: (google.chat.v1.HistoryState|keyof typeof google.chat.v1.HistoryState|null); + + /** Space importMode */ + importMode?: (boolean|null); + + /** Space createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Space lastActiveTime */ + lastActiveTime?: (google.protobuf.ITimestamp|null); + + /** Space adminInstalled */ + adminInstalled?: (boolean|null); + + /** Space membershipCount */ + membershipCount?: (google.chat.v1.Space.IMembershipCount|null); + + /** Space accessSettings */ + accessSettings?: (google.chat.v1.Space.IAccessSettings|null); + + /** Space spaceUri */ + spaceUri?: (string|null); + } + + /** Represents a Space. */ + class Space implements ISpace { + + /** + * Constructs a new Space. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ISpace); + + /** Space name. */ + public name: string; + + /** Space type. */ + public type: (google.chat.v1.Space.Type|keyof typeof google.chat.v1.Space.Type); + + /** Space spaceType. */ + public spaceType: (google.chat.v1.Space.SpaceType|keyof typeof google.chat.v1.Space.SpaceType); + + /** Space singleUserBotDm. */ + public singleUserBotDm: boolean; + + /** Space threaded. */ + public threaded: boolean; + + /** Space displayName. */ + public displayName: string; + + /** Space externalUserAllowed. */ + public externalUserAllowed: boolean; + + /** Space spaceThreadingState. */ + public spaceThreadingState: (google.chat.v1.Space.SpaceThreadingState|keyof typeof google.chat.v1.Space.SpaceThreadingState); + + /** Space spaceDetails. */ + public spaceDetails?: (google.chat.v1.Space.ISpaceDetails|null); + + /** Space spaceHistoryState. */ + public spaceHistoryState: (google.chat.v1.HistoryState|keyof typeof google.chat.v1.HistoryState); + + /** Space importMode. */ + public importMode: boolean; + + /** Space createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Space lastActiveTime. */ + public lastActiveTime?: (google.protobuf.ITimestamp|null); + + /** Space adminInstalled. */ + public adminInstalled: boolean; + + /** Space membershipCount. */ + public membershipCount?: (google.chat.v1.Space.IMembershipCount|null); + + /** Space accessSettings. */ + public accessSettings?: (google.chat.v1.Space.IAccessSettings|null); + + /** Space spaceUri. */ + public spaceUri: string; + + /** + * Creates a new Space instance using the specified properties. + * @param [properties] Properties to set + * @returns Space instance + */ + public static create(properties?: google.chat.v1.ISpace): google.chat.v1.Space; + + /** + * Encodes the specified Space message. Does not implicitly {@link google.chat.v1.Space.verify|verify} messages. + * @param message Space message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ISpace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Space message, length delimited. Does not implicitly {@link google.chat.v1.Space.verify|verify} messages. + * @param message Space message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ISpace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Space message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Space + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Space; + + /** + * Decodes a Space message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Space + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Space; + + /** + * Verifies a Space message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Space message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Space + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.Space; + + /** + * Creates a plain object from a Space message. Also converts values to other types if specified. + * @param message Space + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.Space, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Space to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Space + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Space { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ROOM = 1, + DM = 2 + } + + /** SpaceType enum. */ + enum SpaceType { + SPACE_TYPE_UNSPECIFIED = 0, + SPACE = 1, + GROUP_CHAT = 2, + DIRECT_MESSAGE = 3 + } + + /** SpaceThreadingState enum. */ + enum SpaceThreadingState { + SPACE_THREADING_STATE_UNSPECIFIED = 0, + THREADED_MESSAGES = 2, + GROUPED_MESSAGES = 3, + UNTHREADED_MESSAGES = 4 + } + + /** Properties of a SpaceDetails. */ + interface ISpaceDetails { + + /** SpaceDetails description */ + description?: (string|null); + + /** SpaceDetails guidelines */ + guidelines?: (string|null); + } + + /** Represents a SpaceDetails. */ + class SpaceDetails implements ISpaceDetails { + + /** + * Constructs a new SpaceDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.Space.ISpaceDetails); + + /** SpaceDetails description. */ + public description: string; + + /** SpaceDetails guidelines. */ + public guidelines: string; + + /** + * Creates a new SpaceDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns SpaceDetails instance + */ + public static create(properties?: google.chat.v1.Space.ISpaceDetails): google.chat.v1.Space.SpaceDetails; + + /** + * Encodes the specified SpaceDetails message. Does not implicitly {@link google.chat.v1.Space.SpaceDetails.verify|verify} messages. + * @param message SpaceDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.Space.ISpaceDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpaceDetails message, length delimited. Does not implicitly {@link google.chat.v1.Space.SpaceDetails.verify|verify} messages. + * @param message SpaceDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.Space.ISpaceDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpaceDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpaceDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Space.SpaceDetails; + + /** + * Decodes a SpaceDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpaceDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Space.SpaceDetails; + + /** + * Verifies a SpaceDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpaceDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpaceDetails + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.Space.SpaceDetails; + + /** + * Creates a plain object from a SpaceDetails message. Also converts values to other types if specified. + * @param message SpaceDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.Space.SpaceDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpaceDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpaceDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MembershipCount. */ + interface IMembershipCount { + + /** MembershipCount joinedDirectHumanUserCount */ + joinedDirectHumanUserCount?: (number|null); + + /** MembershipCount joinedGroupCount */ + joinedGroupCount?: (number|null); + } + + /** Represents a MembershipCount. */ + class MembershipCount implements IMembershipCount { + + /** + * Constructs a new MembershipCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.Space.IMembershipCount); + + /** MembershipCount joinedDirectHumanUserCount. */ + public joinedDirectHumanUserCount: number; + + /** MembershipCount joinedGroupCount. */ + public joinedGroupCount: number; + + /** + * Creates a new MembershipCount instance using the specified properties. + * @param [properties] Properties to set + * @returns MembershipCount instance + */ + public static create(properties?: google.chat.v1.Space.IMembershipCount): google.chat.v1.Space.MembershipCount; + + /** + * Encodes the specified MembershipCount message. Does not implicitly {@link google.chat.v1.Space.MembershipCount.verify|verify} messages. + * @param message MembershipCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.Space.IMembershipCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MembershipCount message, length delimited. Does not implicitly {@link google.chat.v1.Space.MembershipCount.verify|verify} messages. + * @param message MembershipCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.Space.IMembershipCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MembershipCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MembershipCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Space.MembershipCount; + + /** + * Decodes a MembershipCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MembershipCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Space.MembershipCount; + + /** + * Verifies a MembershipCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MembershipCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MembershipCount + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.Space.MembershipCount; + + /** + * Creates a plain object from a MembershipCount message. Also converts values to other types if specified. + * @param message MembershipCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.Space.MembershipCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MembershipCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MembershipCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessSettings. */ + interface IAccessSettings { + + /** AccessSettings accessState */ + accessState?: (google.chat.v1.Space.AccessSettings.AccessState|keyof typeof google.chat.v1.Space.AccessSettings.AccessState|null); + + /** AccessSettings audience */ + audience?: (string|null); + } + + /** Represents an AccessSettings. */ + class AccessSettings implements IAccessSettings { + + /** + * Constructs a new AccessSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.Space.IAccessSettings); + + /** AccessSettings accessState. */ + public accessState: (google.chat.v1.Space.AccessSettings.AccessState|keyof typeof google.chat.v1.Space.AccessSettings.AccessState); + + /** AccessSettings audience. */ + public audience: string; + + /** + * Creates a new AccessSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessSettings instance + */ + public static create(properties?: google.chat.v1.Space.IAccessSettings): google.chat.v1.Space.AccessSettings; + + /** + * Encodes the specified AccessSettings message. Does not implicitly {@link google.chat.v1.Space.AccessSettings.verify|verify} messages. + * @param message AccessSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.Space.IAccessSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessSettings message, length delimited. Does not implicitly {@link google.chat.v1.Space.AccessSettings.verify|verify} messages. + * @param message AccessSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.Space.IAccessSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Space.AccessSettings; + + /** + * Decodes an AccessSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Space.AccessSettings; + + /** + * Verifies an AccessSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessSettings + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.Space.AccessSettings; + + /** + * Creates a plain object from an AccessSettings message. Also converts values to other types if specified. + * @param message AccessSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.Space.AccessSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AccessSettings { + + /** AccessState enum. */ + enum AccessState { + ACCESS_STATE_UNSPECIFIED = 0, + PRIVATE = 1, + DISCOVERABLE = 2 + } + } + } + + /** Properties of a CreateSpaceRequest. */ + interface ICreateSpaceRequest { + + /** CreateSpaceRequest space */ + space?: (google.chat.v1.ISpace|null); + + /** CreateSpaceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateSpaceRequest. */ + class CreateSpaceRequest implements ICreateSpaceRequest { + + /** + * Constructs a new CreateSpaceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ICreateSpaceRequest); + + /** CreateSpaceRequest space. */ + public space?: (google.chat.v1.ISpace|null); + + /** CreateSpaceRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateSpaceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSpaceRequest instance + */ + public static create(properties?: google.chat.v1.ICreateSpaceRequest): google.chat.v1.CreateSpaceRequest; + + /** + * Encodes the specified CreateSpaceRequest message. Does not implicitly {@link google.chat.v1.CreateSpaceRequest.verify|verify} messages. + * @param message CreateSpaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ICreateSpaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateSpaceRequest.verify|verify} messages. + * @param message CreateSpaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ICreateSpaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSpaceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CreateSpaceRequest; + + /** + * Decodes a CreateSpaceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CreateSpaceRequest; + + /** + * Verifies a CreateSpaceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSpaceRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.CreateSpaceRequest; + + /** + * Creates a plain object from a CreateSpaceRequest message. Also converts values to other types if specified. + * @param message CreateSpaceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.CreateSpaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSpaceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSpaceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSpacesRequest. */ + interface IListSpacesRequest { + + /** ListSpacesRequest pageSize */ + pageSize?: (number|null); + + /** ListSpacesRequest pageToken */ + pageToken?: (string|null); + + /** ListSpacesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListSpacesRequest. */ + class ListSpacesRequest implements IListSpacesRequest { + + /** + * Constructs a new ListSpacesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IListSpacesRequest); + + /** ListSpacesRequest pageSize. */ + public pageSize: number; + + /** ListSpacesRequest pageToken. */ + public pageToken: string; + + /** ListSpacesRequest filter. */ + public filter: string; + + /** + * Creates a new ListSpacesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSpacesRequest instance + */ + public static create(properties?: google.chat.v1.IListSpacesRequest): google.chat.v1.ListSpacesRequest; + + /** + * Encodes the specified ListSpacesRequest message. Does not implicitly {@link google.chat.v1.ListSpacesRequest.verify|verify} messages. + * @param message ListSpacesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IListSpacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSpacesRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListSpacesRequest.verify|verify} messages. + * @param message ListSpacesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IListSpacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSpacesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSpacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListSpacesRequest; + + /** + * Decodes a ListSpacesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSpacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListSpacesRequest; + + /** + * Verifies a ListSpacesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSpacesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSpacesRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListSpacesRequest; + + /** + * Creates a plain object from a ListSpacesRequest message. Also converts values to other types if specified. + * @param message ListSpacesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ListSpacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSpacesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSpacesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSpacesResponse. */ + interface IListSpacesResponse { + + /** ListSpacesResponse spaces */ + spaces?: (google.chat.v1.ISpace[]|null); + + /** ListSpacesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSpacesResponse. */ + class ListSpacesResponse implements IListSpacesResponse { + + /** + * Constructs a new ListSpacesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IListSpacesResponse); + + /** ListSpacesResponse spaces. */ + public spaces: google.chat.v1.ISpace[]; + + /** ListSpacesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSpacesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSpacesResponse instance + */ + public static create(properties?: google.chat.v1.IListSpacesResponse): google.chat.v1.ListSpacesResponse; + + /** + * Encodes the specified ListSpacesResponse message. Does not implicitly {@link google.chat.v1.ListSpacesResponse.verify|verify} messages. + * @param message ListSpacesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IListSpacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSpacesResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListSpacesResponse.verify|verify} messages. + * @param message ListSpacesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IListSpacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSpacesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSpacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListSpacesResponse; + + /** + * Decodes a ListSpacesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSpacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListSpacesResponse; + + /** + * Verifies a ListSpacesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSpacesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSpacesResponse + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListSpacesResponse; + + /** + * Creates a plain object from a ListSpacesResponse message. Also converts values to other types if specified. + * @param message ListSpacesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ListSpacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSpacesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSpacesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSpaceRequest. */ + interface IGetSpaceRequest { + + /** GetSpaceRequest name */ + name?: (string|null); + + /** GetSpaceRequest useAdminAccess */ + useAdminAccess?: (boolean|null); + } + + /** Represents a GetSpaceRequest. */ + class GetSpaceRequest implements IGetSpaceRequest { + + /** + * Constructs a new GetSpaceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IGetSpaceRequest); + + /** GetSpaceRequest name. */ + public name: string; + + /** GetSpaceRequest useAdminAccess. */ + public useAdminAccess: boolean; + + /** + * Creates a new GetSpaceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSpaceRequest instance + */ + public static create(properties?: google.chat.v1.IGetSpaceRequest): google.chat.v1.GetSpaceRequest; + + /** + * Encodes the specified GetSpaceRequest message. Does not implicitly {@link google.chat.v1.GetSpaceRequest.verify|verify} messages. + * @param message GetSpaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IGetSpaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetSpaceRequest.verify|verify} messages. + * @param message GetSpaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IGetSpaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSpaceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.GetSpaceRequest; + + /** + * Decodes a GetSpaceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.GetSpaceRequest; + + /** + * Verifies a GetSpaceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSpaceRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.GetSpaceRequest; + + /** + * Creates a plain object from a GetSpaceRequest message. Also converts values to other types if specified. + * @param message GetSpaceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.GetSpaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSpaceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSpaceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FindDirectMessageRequest. */ + interface IFindDirectMessageRequest { + + /** FindDirectMessageRequest name */ + name?: (string|null); + } + + /** Represents a FindDirectMessageRequest. */ + class FindDirectMessageRequest implements IFindDirectMessageRequest { + + /** + * Constructs a new FindDirectMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IFindDirectMessageRequest); + + /** FindDirectMessageRequest name. */ + public name: string; + + /** + * Creates a new FindDirectMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FindDirectMessageRequest instance + */ + public static create(properties?: google.chat.v1.IFindDirectMessageRequest): google.chat.v1.FindDirectMessageRequest; + + /** + * Encodes the specified FindDirectMessageRequest message. Does not implicitly {@link google.chat.v1.FindDirectMessageRequest.verify|verify} messages. + * @param message FindDirectMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IFindDirectMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FindDirectMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.FindDirectMessageRequest.verify|verify} messages. + * @param message FindDirectMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IFindDirectMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FindDirectMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FindDirectMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.FindDirectMessageRequest; + + /** + * Decodes a FindDirectMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FindDirectMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.FindDirectMessageRequest; + + /** + * Verifies a FindDirectMessageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FindDirectMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FindDirectMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.FindDirectMessageRequest; + + /** + * Creates a plain object from a FindDirectMessageRequest message. Also converts values to other types if specified. + * @param message FindDirectMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.FindDirectMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FindDirectMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FindDirectMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSpaceRequest. */ + interface IUpdateSpaceRequest { + + /** UpdateSpaceRequest space */ + space?: (google.chat.v1.ISpace|null); + + /** UpdateSpaceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSpaceRequest useAdminAccess */ + useAdminAccess?: (boolean|null); + } + + /** Represents an UpdateSpaceRequest. */ + class UpdateSpaceRequest implements IUpdateSpaceRequest { + + /** + * Constructs a new UpdateSpaceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IUpdateSpaceRequest); + + /** UpdateSpaceRequest space. */ + public space?: (google.chat.v1.ISpace|null); + + /** UpdateSpaceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSpaceRequest useAdminAccess. */ + public useAdminAccess: boolean; + + /** + * Creates a new UpdateSpaceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSpaceRequest instance + */ + public static create(properties?: google.chat.v1.IUpdateSpaceRequest): google.chat.v1.UpdateSpaceRequest; + + /** + * Encodes the specified UpdateSpaceRequest message. Does not implicitly {@link google.chat.v1.UpdateSpaceRequest.verify|verify} messages. + * @param message UpdateSpaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IUpdateSpaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateSpaceRequest.verify|verify} messages. + * @param message UpdateSpaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IUpdateSpaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSpaceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.UpdateSpaceRequest; + + /** + * Decodes an UpdateSpaceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.UpdateSpaceRequest; + + /** + * Verifies an UpdateSpaceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSpaceRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.UpdateSpaceRequest; + + /** + * Creates a plain object from an UpdateSpaceRequest message. Also converts values to other types if specified. + * @param message UpdateSpaceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.UpdateSpaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSpaceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSpaceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchSpacesRequest. */ + interface ISearchSpacesRequest { + + /** SearchSpacesRequest useAdminAccess */ + useAdminAccess?: (boolean|null); + + /** SearchSpacesRequest pageSize */ + pageSize?: (number|null); + + /** SearchSpacesRequest pageToken */ + pageToken?: (string|null); + + /** SearchSpacesRequest query */ + query?: (string|null); + + /** SearchSpacesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a SearchSpacesRequest. */ + class SearchSpacesRequest implements ISearchSpacesRequest { + + /** + * Constructs a new SearchSpacesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ISearchSpacesRequest); + + /** SearchSpacesRequest useAdminAccess. */ + public useAdminAccess: boolean; + + /** SearchSpacesRequest pageSize. */ + public pageSize: number; + + /** SearchSpacesRequest pageToken. */ + public pageToken: string; + + /** SearchSpacesRequest query. */ + public query: string; + + /** SearchSpacesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new SearchSpacesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchSpacesRequest instance + */ + public static create(properties?: google.chat.v1.ISearchSpacesRequest): google.chat.v1.SearchSpacesRequest; + + /** + * Encodes the specified SearchSpacesRequest message. Does not implicitly {@link google.chat.v1.SearchSpacesRequest.verify|verify} messages. + * @param message SearchSpacesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ISearchSpacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchSpacesRequest message, length delimited. Does not implicitly {@link google.chat.v1.SearchSpacesRequest.verify|verify} messages. + * @param message SearchSpacesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ISearchSpacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchSpacesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchSpacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.SearchSpacesRequest; + + /** + * Decodes a SearchSpacesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchSpacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.SearchSpacesRequest; + + /** + * Verifies a SearchSpacesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchSpacesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchSpacesRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.SearchSpacesRequest; + + /** + * Creates a plain object from a SearchSpacesRequest message. Also converts values to other types if specified. + * @param message SearchSpacesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.SearchSpacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchSpacesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchSpacesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchSpacesResponse. */ + interface ISearchSpacesResponse { + + /** SearchSpacesResponse spaces */ + spaces?: (google.chat.v1.ISpace[]|null); + + /** SearchSpacesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** SearchSpacesResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a SearchSpacesResponse. */ + class SearchSpacesResponse implements ISearchSpacesResponse { + + /** + * Constructs a new SearchSpacesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ISearchSpacesResponse); + + /** SearchSpacesResponse spaces. */ + public spaces: google.chat.v1.ISpace[]; + + /** SearchSpacesResponse nextPageToken. */ + public nextPageToken: string; + + /** SearchSpacesResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new SearchSpacesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchSpacesResponse instance + */ + public static create(properties?: google.chat.v1.ISearchSpacesResponse): google.chat.v1.SearchSpacesResponse; + + /** + * Encodes the specified SearchSpacesResponse message. Does not implicitly {@link google.chat.v1.SearchSpacesResponse.verify|verify} messages. + * @param message SearchSpacesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ISearchSpacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchSpacesResponse message, length delimited. Does not implicitly {@link google.chat.v1.SearchSpacesResponse.verify|verify} messages. + * @param message SearchSpacesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ISearchSpacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchSpacesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchSpacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.SearchSpacesResponse; + + /** + * Decodes a SearchSpacesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchSpacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.SearchSpacesResponse; + + /** + * Verifies a SearchSpacesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchSpacesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchSpacesResponse + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.SearchSpacesResponse; + + /** + * Creates a plain object from a SearchSpacesResponse message. Also converts values to other types if specified. + * @param message SearchSpacesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.SearchSpacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchSpacesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchSpacesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSpaceRequest. */ + interface IDeleteSpaceRequest { + + /** DeleteSpaceRequest name */ + name?: (string|null); + + /** DeleteSpaceRequest useAdminAccess */ + useAdminAccess?: (boolean|null); + } + + /** Represents a DeleteSpaceRequest. */ + class DeleteSpaceRequest implements IDeleteSpaceRequest { + + /** + * Constructs a new DeleteSpaceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IDeleteSpaceRequest); + + /** DeleteSpaceRequest name. */ + public name: string; + + /** DeleteSpaceRequest useAdminAccess. */ + public useAdminAccess: boolean; + + /** + * Creates a new DeleteSpaceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSpaceRequest instance + */ + public static create(properties?: google.chat.v1.IDeleteSpaceRequest): google.chat.v1.DeleteSpaceRequest; + + /** + * Encodes the specified DeleteSpaceRequest message. Does not implicitly {@link google.chat.v1.DeleteSpaceRequest.verify|verify} messages. + * @param message DeleteSpaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IDeleteSpaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteSpaceRequest.verify|verify} messages. + * @param message DeleteSpaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IDeleteSpaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSpaceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeleteSpaceRequest; + + /** + * Decodes a DeleteSpaceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeleteSpaceRequest; + + /** + * Verifies a DeleteSpaceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSpaceRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.DeleteSpaceRequest; + + /** + * Creates a plain object from a DeleteSpaceRequest message. Also converts values to other types if specified. + * @param message DeleteSpaceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.DeleteSpaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSpaceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSpaceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CompleteImportSpaceRequest. */ + interface ICompleteImportSpaceRequest { + + /** CompleteImportSpaceRequest name */ + name?: (string|null); + } + + /** Represents a CompleteImportSpaceRequest. */ + class CompleteImportSpaceRequest implements ICompleteImportSpaceRequest { + + /** + * Constructs a new CompleteImportSpaceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ICompleteImportSpaceRequest); + + /** CompleteImportSpaceRequest name. */ + public name: string; + + /** + * Creates a new CompleteImportSpaceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CompleteImportSpaceRequest instance + */ + public static create(properties?: google.chat.v1.ICompleteImportSpaceRequest): google.chat.v1.CompleteImportSpaceRequest; + + /** + * Encodes the specified CompleteImportSpaceRequest message. Does not implicitly {@link google.chat.v1.CompleteImportSpaceRequest.verify|verify} messages. + * @param message CompleteImportSpaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ICompleteImportSpaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompleteImportSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.CompleteImportSpaceRequest.verify|verify} messages. + * @param message CompleteImportSpaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ICompleteImportSpaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompleteImportSpaceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompleteImportSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CompleteImportSpaceRequest; + + /** + * Decodes a CompleteImportSpaceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompleteImportSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CompleteImportSpaceRequest; + + /** + * Verifies a CompleteImportSpaceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompleteImportSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompleteImportSpaceRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.CompleteImportSpaceRequest; + + /** + * Creates a plain object from a CompleteImportSpaceRequest message. Also converts values to other types if specified. + * @param message CompleteImportSpaceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.CompleteImportSpaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompleteImportSpaceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompleteImportSpaceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CompleteImportSpaceResponse. */ + interface ICompleteImportSpaceResponse { + + /** CompleteImportSpaceResponse space */ + space?: (google.chat.v1.ISpace|null); + } + + /** Represents a CompleteImportSpaceResponse. */ + class CompleteImportSpaceResponse implements ICompleteImportSpaceResponse { + + /** + * Constructs a new CompleteImportSpaceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ICompleteImportSpaceResponse); + + /** CompleteImportSpaceResponse space. */ + public space?: (google.chat.v1.ISpace|null); + + /** + * Creates a new CompleteImportSpaceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CompleteImportSpaceResponse instance + */ + public static create(properties?: google.chat.v1.ICompleteImportSpaceResponse): google.chat.v1.CompleteImportSpaceResponse; + + /** + * Encodes the specified CompleteImportSpaceResponse message. Does not implicitly {@link google.chat.v1.CompleteImportSpaceResponse.verify|verify} messages. + * @param message CompleteImportSpaceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ICompleteImportSpaceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompleteImportSpaceResponse message, length delimited. Does not implicitly {@link google.chat.v1.CompleteImportSpaceResponse.verify|verify} messages. + * @param message CompleteImportSpaceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ICompleteImportSpaceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompleteImportSpaceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompleteImportSpaceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CompleteImportSpaceResponse; + + /** + * Decodes a CompleteImportSpaceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompleteImportSpaceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CompleteImportSpaceResponse; + + /** + * Verifies a CompleteImportSpaceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompleteImportSpaceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompleteImportSpaceResponse + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.CompleteImportSpaceResponse; + + /** + * Creates a plain object from a CompleteImportSpaceResponse message. Also converts values to other types if specified. + * @param message CompleteImportSpaceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.CompleteImportSpaceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompleteImportSpaceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompleteImportSpaceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** HistoryState enum. */ + enum HistoryState { + HISTORY_STATE_UNSPECIFIED = 0, + HISTORY_OFF = 1, + HISTORY_ON = 2 + } + + /** Properties of a SpaceEvent. */ + interface ISpaceEvent { + + /** SpaceEvent name */ + name?: (string|null); + + /** SpaceEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** SpaceEvent eventType */ + eventType?: (string|null); + + /** SpaceEvent messageCreatedEventData */ + messageCreatedEventData?: (google.chat.v1.IMessageCreatedEventData|null); + + /** SpaceEvent messageUpdatedEventData */ + messageUpdatedEventData?: (google.chat.v1.IMessageUpdatedEventData|null); + + /** SpaceEvent messageDeletedEventData */ + messageDeletedEventData?: (google.chat.v1.IMessageDeletedEventData|null); + + /** SpaceEvent messageBatchCreatedEventData */ + messageBatchCreatedEventData?: (google.chat.v1.IMessageBatchCreatedEventData|null); + + /** SpaceEvent messageBatchUpdatedEventData */ + messageBatchUpdatedEventData?: (google.chat.v1.IMessageBatchUpdatedEventData|null); + + /** SpaceEvent messageBatchDeletedEventData */ + messageBatchDeletedEventData?: (google.chat.v1.IMessageBatchDeletedEventData|null); + + /** SpaceEvent spaceUpdatedEventData */ + spaceUpdatedEventData?: (google.chat.v1.ISpaceUpdatedEventData|null); + + /** SpaceEvent spaceBatchUpdatedEventData */ + spaceBatchUpdatedEventData?: (google.chat.v1.ISpaceBatchUpdatedEventData|null); + + /** SpaceEvent membershipCreatedEventData */ + membershipCreatedEventData?: (google.chat.v1.IMembershipCreatedEventData|null); + + /** SpaceEvent membershipUpdatedEventData */ + membershipUpdatedEventData?: (google.chat.v1.IMembershipUpdatedEventData|null); + + /** SpaceEvent membershipDeletedEventData */ + membershipDeletedEventData?: (google.chat.v1.IMembershipDeletedEventData|null); + + /** SpaceEvent membershipBatchCreatedEventData */ + membershipBatchCreatedEventData?: (google.chat.v1.IMembershipBatchCreatedEventData|null); + + /** SpaceEvent membershipBatchUpdatedEventData */ + membershipBatchUpdatedEventData?: (google.chat.v1.IMembershipBatchUpdatedEventData|null); + + /** SpaceEvent membershipBatchDeletedEventData */ + membershipBatchDeletedEventData?: (google.chat.v1.IMembershipBatchDeletedEventData|null); + + /** SpaceEvent reactionCreatedEventData */ + reactionCreatedEventData?: (google.chat.v1.IReactionCreatedEventData|null); + + /** SpaceEvent reactionDeletedEventData */ + reactionDeletedEventData?: (google.chat.v1.IReactionDeletedEventData|null); + + /** SpaceEvent reactionBatchCreatedEventData */ + reactionBatchCreatedEventData?: (google.chat.v1.IReactionBatchCreatedEventData|null); + + /** SpaceEvent reactionBatchDeletedEventData */ + reactionBatchDeletedEventData?: (google.chat.v1.IReactionBatchDeletedEventData|null); + } + + /** Represents a SpaceEvent. */ + class SpaceEvent implements ISpaceEvent { + + /** + * Constructs a new SpaceEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ISpaceEvent); + + /** SpaceEvent name. */ + public name: string; + + /** SpaceEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** SpaceEvent eventType. */ + public eventType: string; + + /** SpaceEvent messageCreatedEventData. */ + public messageCreatedEventData?: (google.chat.v1.IMessageCreatedEventData|null); + + /** SpaceEvent messageUpdatedEventData. */ + public messageUpdatedEventData?: (google.chat.v1.IMessageUpdatedEventData|null); + + /** SpaceEvent messageDeletedEventData. */ + public messageDeletedEventData?: (google.chat.v1.IMessageDeletedEventData|null); + + /** SpaceEvent messageBatchCreatedEventData. */ + public messageBatchCreatedEventData?: (google.chat.v1.IMessageBatchCreatedEventData|null); + + /** SpaceEvent messageBatchUpdatedEventData. */ + public messageBatchUpdatedEventData?: (google.chat.v1.IMessageBatchUpdatedEventData|null); + + /** SpaceEvent messageBatchDeletedEventData. */ + public messageBatchDeletedEventData?: (google.chat.v1.IMessageBatchDeletedEventData|null); + + /** SpaceEvent spaceUpdatedEventData. */ + public spaceUpdatedEventData?: (google.chat.v1.ISpaceUpdatedEventData|null); + + /** SpaceEvent spaceBatchUpdatedEventData. */ + public spaceBatchUpdatedEventData?: (google.chat.v1.ISpaceBatchUpdatedEventData|null); + + /** SpaceEvent membershipCreatedEventData. */ + public membershipCreatedEventData?: (google.chat.v1.IMembershipCreatedEventData|null); + + /** SpaceEvent membershipUpdatedEventData. */ + public membershipUpdatedEventData?: (google.chat.v1.IMembershipUpdatedEventData|null); + + /** SpaceEvent membershipDeletedEventData. */ + public membershipDeletedEventData?: (google.chat.v1.IMembershipDeletedEventData|null); + + /** SpaceEvent membershipBatchCreatedEventData. */ + public membershipBatchCreatedEventData?: (google.chat.v1.IMembershipBatchCreatedEventData|null); + + /** SpaceEvent membershipBatchUpdatedEventData. */ + public membershipBatchUpdatedEventData?: (google.chat.v1.IMembershipBatchUpdatedEventData|null); + + /** SpaceEvent membershipBatchDeletedEventData. */ + public membershipBatchDeletedEventData?: (google.chat.v1.IMembershipBatchDeletedEventData|null); + + /** SpaceEvent reactionCreatedEventData. */ + public reactionCreatedEventData?: (google.chat.v1.IReactionCreatedEventData|null); + + /** SpaceEvent reactionDeletedEventData. */ + public reactionDeletedEventData?: (google.chat.v1.IReactionDeletedEventData|null); + + /** SpaceEvent reactionBatchCreatedEventData. */ + public reactionBatchCreatedEventData?: (google.chat.v1.IReactionBatchCreatedEventData|null); + + /** SpaceEvent reactionBatchDeletedEventData. */ + public reactionBatchDeletedEventData?: (google.chat.v1.IReactionBatchDeletedEventData|null); + + /** SpaceEvent payload. */ + public payload?: ("messageCreatedEventData"|"messageUpdatedEventData"|"messageDeletedEventData"|"messageBatchCreatedEventData"|"messageBatchUpdatedEventData"|"messageBatchDeletedEventData"|"spaceUpdatedEventData"|"spaceBatchUpdatedEventData"|"membershipCreatedEventData"|"membershipUpdatedEventData"|"membershipDeletedEventData"|"membershipBatchCreatedEventData"|"membershipBatchUpdatedEventData"|"membershipBatchDeletedEventData"|"reactionCreatedEventData"|"reactionDeletedEventData"|"reactionBatchCreatedEventData"|"reactionBatchDeletedEventData"); + + /** + * Creates a new SpaceEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns SpaceEvent instance + */ + public static create(properties?: google.chat.v1.ISpaceEvent): google.chat.v1.SpaceEvent; + + /** + * Encodes the specified SpaceEvent message. Does not implicitly {@link google.chat.v1.SpaceEvent.verify|verify} messages. + * @param message SpaceEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ISpaceEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpaceEvent message, length delimited. Does not implicitly {@link google.chat.v1.SpaceEvent.verify|verify} messages. + * @param message SpaceEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ISpaceEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpaceEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpaceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.SpaceEvent; + + /** + * Decodes a SpaceEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpaceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.SpaceEvent; + + /** + * Verifies a SpaceEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpaceEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpaceEvent + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.SpaceEvent; + + /** + * Creates a plain object from a SpaceEvent message. Also converts values to other types if specified. + * @param message SpaceEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.SpaceEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpaceEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpaceEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSpaceEventRequest. */ + interface IGetSpaceEventRequest { + + /** GetSpaceEventRequest name */ + name?: (string|null); + } + + /** Represents a GetSpaceEventRequest. */ + class GetSpaceEventRequest implements IGetSpaceEventRequest { + + /** + * Constructs a new GetSpaceEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IGetSpaceEventRequest); + + /** GetSpaceEventRequest name. */ + public name: string; + + /** + * Creates a new GetSpaceEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSpaceEventRequest instance + */ + public static create(properties?: google.chat.v1.IGetSpaceEventRequest): google.chat.v1.GetSpaceEventRequest; + + /** + * Encodes the specified GetSpaceEventRequest message. Does not implicitly {@link google.chat.v1.GetSpaceEventRequest.verify|verify} messages. + * @param message GetSpaceEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IGetSpaceEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSpaceEventRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetSpaceEventRequest.verify|verify} messages. + * @param message GetSpaceEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IGetSpaceEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSpaceEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSpaceEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.GetSpaceEventRequest; + + /** + * Decodes a GetSpaceEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSpaceEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.GetSpaceEventRequest; + + /** + * Verifies a GetSpaceEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSpaceEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSpaceEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.GetSpaceEventRequest; + + /** + * Creates a plain object from a GetSpaceEventRequest message. Also converts values to other types if specified. + * @param message GetSpaceEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.GetSpaceEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSpaceEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSpaceEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSpaceEventsRequest. */ + interface IListSpaceEventsRequest { + + /** ListSpaceEventsRequest parent */ + parent?: (string|null); + + /** ListSpaceEventsRequest pageSize */ + pageSize?: (number|null); + + /** ListSpaceEventsRequest pageToken */ + pageToken?: (string|null); + + /** ListSpaceEventsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListSpaceEventsRequest. */ + class ListSpaceEventsRequest implements IListSpaceEventsRequest { + + /** + * Constructs a new ListSpaceEventsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IListSpaceEventsRequest); + + /** ListSpaceEventsRequest parent. */ + public parent: string; + + /** ListSpaceEventsRequest pageSize. */ + public pageSize: number; + + /** ListSpaceEventsRequest pageToken. */ + public pageToken: string; + + /** ListSpaceEventsRequest filter. */ + public filter: string; + + /** + * Creates a new ListSpaceEventsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSpaceEventsRequest instance + */ + public static create(properties?: google.chat.v1.IListSpaceEventsRequest): google.chat.v1.ListSpaceEventsRequest; + + /** + * Encodes the specified ListSpaceEventsRequest message. Does not implicitly {@link google.chat.v1.ListSpaceEventsRequest.verify|verify} messages. + * @param message ListSpaceEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IListSpaceEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSpaceEventsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListSpaceEventsRequest.verify|verify} messages. + * @param message ListSpaceEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IListSpaceEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSpaceEventsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSpaceEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListSpaceEventsRequest; + + /** + * Decodes a ListSpaceEventsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSpaceEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListSpaceEventsRequest; + + /** + * Verifies a ListSpaceEventsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSpaceEventsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSpaceEventsRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListSpaceEventsRequest; + + /** + * Creates a plain object from a ListSpaceEventsRequest message. Also converts values to other types if specified. + * @param message ListSpaceEventsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ListSpaceEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSpaceEventsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSpaceEventsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSpaceEventsResponse. */ + interface IListSpaceEventsResponse { + + /** ListSpaceEventsResponse spaceEvents */ + spaceEvents?: (google.chat.v1.ISpaceEvent[]|null); + + /** ListSpaceEventsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSpaceEventsResponse. */ + class ListSpaceEventsResponse implements IListSpaceEventsResponse { + + /** + * Constructs a new ListSpaceEventsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IListSpaceEventsResponse); + + /** ListSpaceEventsResponse spaceEvents. */ + public spaceEvents: google.chat.v1.ISpaceEvent[]; + + /** ListSpaceEventsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSpaceEventsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSpaceEventsResponse instance + */ + public static create(properties?: google.chat.v1.IListSpaceEventsResponse): google.chat.v1.ListSpaceEventsResponse; + + /** + * Encodes the specified ListSpaceEventsResponse message. Does not implicitly {@link google.chat.v1.ListSpaceEventsResponse.verify|verify} messages. + * @param message ListSpaceEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IListSpaceEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSpaceEventsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListSpaceEventsResponse.verify|verify} messages. + * @param message ListSpaceEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IListSpaceEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSpaceEventsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSpaceEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListSpaceEventsResponse; + + /** + * Decodes a ListSpaceEventsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSpaceEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListSpaceEventsResponse; + + /** + * Verifies a ListSpaceEventsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSpaceEventsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSpaceEventsResponse + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListSpaceEventsResponse; + + /** + * Creates a plain object from a ListSpaceEventsResponse message. Also converts values to other types if specified. + * @param message ListSpaceEventsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ListSpaceEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSpaceEventsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSpaceEventsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MembershipCreatedEventData. */ + interface IMembershipCreatedEventData { + + /** MembershipCreatedEventData membership */ + membership?: (google.chat.v1.IMembership|null); + } + + /** Represents a MembershipCreatedEventData. */ + class MembershipCreatedEventData implements IMembershipCreatedEventData { + + /** + * Constructs a new MembershipCreatedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMembershipCreatedEventData); + + /** MembershipCreatedEventData membership. */ + public membership?: (google.chat.v1.IMembership|null); + + /** + * Creates a new MembershipCreatedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns MembershipCreatedEventData instance + */ + public static create(properties?: google.chat.v1.IMembershipCreatedEventData): google.chat.v1.MembershipCreatedEventData; + + /** + * Encodes the specified MembershipCreatedEventData message. Does not implicitly {@link google.chat.v1.MembershipCreatedEventData.verify|verify} messages. + * @param message MembershipCreatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMembershipCreatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MembershipCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipCreatedEventData.verify|verify} messages. + * @param message MembershipCreatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMembershipCreatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MembershipCreatedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MembershipCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MembershipCreatedEventData; + + /** + * Decodes a MembershipCreatedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MembershipCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MembershipCreatedEventData; + + /** + * Verifies a MembershipCreatedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MembershipCreatedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MembershipCreatedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MembershipCreatedEventData; + + /** + * Creates a plain object from a MembershipCreatedEventData message. Also converts values to other types if specified. + * @param message MembershipCreatedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MembershipCreatedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MembershipCreatedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MembershipCreatedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MembershipDeletedEventData. */ + interface IMembershipDeletedEventData { + + /** MembershipDeletedEventData membership */ + membership?: (google.chat.v1.IMembership|null); + } + + /** Represents a MembershipDeletedEventData. */ + class MembershipDeletedEventData implements IMembershipDeletedEventData { + + /** + * Constructs a new MembershipDeletedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMembershipDeletedEventData); + + /** MembershipDeletedEventData membership. */ + public membership?: (google.chat.v1.IMembership|null); + + /** + * Creates a new MembershipDeletedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns MembershipDeletedEventData instance + */ + public static create(properties?: google.chat.v1.IMembershipDeletedEventData): google.chat.v1.MembershipDeletedEventData; + + /** + * Encodes the specified MembershipDeletedEventData message. Does not implicitly {@link google.chat.v1.MembershipDeletedEventData.verify|verify} messages. + * @param message MembershipDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMembershipDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MembershipDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipDeletedEventData.verify|verify} messages. + * @param message MembershipDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMembershipDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MembershipDeletedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MembershipDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MembershipDeletedEventData; + + /** + * Decodes a MembershipDeletedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MembershipDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MembershipDeletedEventData; + + /** + * Verifies a MembershipDeletedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MembershipDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MembershipDeletedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MembershipDeletedEventData; + + /** + * Creates a plain object from a MembershipDeletedEventData message. Also converts values to other types if specified. + * @param message MembershipDeletedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MembershipDeletedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MembershipDeletedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MembershipDeletedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MembershipUpdatedEventData. */ + interface IMembershipUpdatedEventData { + + /** MembershipUpdatedEventData membership */ + membership?: (google.chat.v1.IMembership|null); + } + + /** Represents a MembershipUpdatedEventData. */ + class MembershipUpdatedEventData implements IMembershipUpdatedEventData { + + /** + * Constructs a new MembershipUpdatedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMembershipUpdatedEventData); + + /** MembershipUpdatedEventData membership. */ + public membership?: (google.chat.v1.IMembership|null); + + /** + * Creates a new MembershipUpdatedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns MembershipUpdatedEventData instance + */ + public static create(properties?: google.chat.v1.IMembershipUpdatedEventData): google.chat.v1.MembershipUpdatedEventData; + + /** + * Encodes the specified MembershipUpdatedEventData message. Does not implicitly {@link google.chat.v1.MembershipUpdatedEventData.verify|verify} messages. + * @param message MembershipUpdatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMembershipUpdatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MembershipUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipUpdatedEventData.verify|verify} messages. + * @param message MembershipUpdatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMembershipUpdatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MembershipUpdatedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MembershipUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MembershipUpdatedEventData; + + /** + * Decodes a MembershipUpdatedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MembershipUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MembershipUpdatedEventData; + + /** + * Verifies a MembershipUpdatedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MembershipUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MembershipUpdatedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MembershipUpdatedEventData; + + /** + * Creates a plain object from a MembershipUpdatedEventData message. Also converts values to other types if specified. + * @param message MembershipUpdatedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MembershipUpdatedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MembershipUpdatedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MembershipUpdatedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MembershipBatchCreatedEventData. */ + interface IMembershipBatchCreatedEventData { + + /** MembershipBatchCreatedEventData memberships */ + memberships?: (google.chat.v1.IMembershipCreatedEventData[]|null); + } + + /** Represents a MembershipBatchCreatedEventData. */ + class MembershipBatchCreatedEventData implements IMembershipBatchCreatedEventData { + + /** + * Constructs a new MembershipBatchCreatedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMembershipBatchCreatedEventData); + + /** MembershipBatchCreatedEventData memberships. */ + public memberships: google.chat.v1.IMembershipCreatedEventData[]; + + /** + * Creates a new MembershipBatchCreatedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns MembershipBatchCreatedEventData instance + */ + public static create(properties?: google.chat.v1.IMembershipBatchCreatedEventData): google.chat.v1.MembershipBatchCreatedEventData; + + /** + * Encodes the specified MembershipBatchCreatedEventData message. Does not implicitly {@link google.chat.v1.MembershipBatchCreatedEventData.verify|verify} messages. + * @param message MembershipBatchCreatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMembershipBatchCreatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MembershipBatchCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipBatchCreatedEventData.verify|verify} messages. + * @param message MembershipBatchCreatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMembershipBatchCreatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MembershipBatchCreatedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MembershipBatchCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MembershipBatchCreatedEventData; + + /** + * Decodes a MembershipBatchCreatedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MembershipBatchCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MembershipBatchCreatedEventData; + + /** + * Verifies a MembershipBatchCreatedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MembershipBatchCreatedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MembershipBatchCreatedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MembershipBatchCreatedEventData; + + /** + * Creates a plain object from a MembershipBatchCreatedEventData message. Also converts values to other types if specified. + * @param message MembershipBatchCreatedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MembershipBatchCreatedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MembershipBatchCreatedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MembershipBatchCreatedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MembershipBatchUpdatedEventData. */ + interface IMembershipBatchUpdatedEventData { + + /** MembershipBatchUpdatedEventData memberships */ + memberships?: (google.chat.v1.IMembershipUpdatedEventData[]|null); + } + + /** Represents a MembershipBatchUpdatedEventData. */ + class MembershipBatchUpdatedEventData implements IMembershipBatchUpdatedEventData { + + /** + * Constructs a new MembershipBatchUpdatedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMembershipBatchUpdatedEventData); + + /** MembershipBatchUpdatedEventData memberships. */ + public memberships: google.chat.v1.IMembershipUpdatedEventData[]; + + /** + * Creates a new MembershipBatchUpdatedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns MembershipBatchUpdatedEventData instance + */ + public static create(properties?: google.chat.v1.IMembershipBatchUpdatedEventData): google.chat.v1.MembershipBatchUpdatedEventData; + + /** + * Encodes the specified MembershipBatchUpdatedEventData message. Does not implicitly {@link google.chat.v1.MembershipBatchUpdatedEventData.verify|verify} messages. + * @param message MembershipBatchUpdatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMembershipBatchUpdatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MembershipBatchUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipBatchUpdatedEventData.verify|verify} messages. + * @param message MembershipBatchUpdatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMembershipBatchUpdatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MembershipBatchUpdatedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MembershipBatchUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MembershipBatchUpdatedEventData; + + /** + * Decodes a MembershipBatchUpdatedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MembershipBatchUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MembershipBatchUpdatedEventData; + + /** + * Verifies a MembershipBatchUpdatedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MembershipBatchUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MembershipBatchUpdatedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MembershipBatchUpdatedEventData; + + /** + * Creates a plain object from a MembershipBatchUpdatedEventData message. Also converts values to other types if specified. + * @param message MembershipBatchUpdatedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MembershipBatchUpdatedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MembershipBatchUpdatedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MembershipBatchUpdatedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MembershipBatchDeletedEventData. */ + interface IMembershipBatchDeletedEventData { + + /** MembershipBatchDeletedEventData memberships */ + memberships?: (google.chat.v1.IMembershipDeletedEventData[]|null); + } + + /** Represents a MembershipBatchDeletedEventData. */ + class MembershipBatchDeletedEventData implements IMembershipBatchDeletedEventData { + + /** + * Constructs a new MembershipBatchDeletedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMembershipBatchDeletedEventData); + + /** MembershipBatchDeletedEventData memberships. */ + public memberships: google.chat.v1.IMembershipDeletedEventData[]; + + /** + * Creates a new MembershipBatchDeletedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns MembershipBatchDeletedEventData instance + */ + public static create(properties?: google.chat.v1.IMembershipBatchDeletedEventData): google.chat.v1.MembershipBatchDeletedEventData; + + /** + * Encodes the specified MembershipBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.MembershipBatchDeletedEventData.verify|verify} messages. + * @param message MembershipBatchDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMembershipBatchDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MembershipBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipBatchDeletedEventData.verify|verify} messages. + * @param message MembershipBatchDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMembershipBatchDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MembershipBatchDeletedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MembershipBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MembershipBatchDeletedEventData; + + /** + * Decodes a MembershipBatchDeletedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MembershipBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MembershipBatchDeletedEventData; + + /** + * Verifies a MembershipBatchDeletedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MembershipBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MembershipBatchDeletedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MembershipBatchDeletedEventData; + + /** + * Creates a plain object from a MembershipBatchDeletedEventData message. Also converts values to other types if specified. + * @param message MembershipBatchDeletedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MembershipBatchDeletedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MembershipBatchDeletedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MembershipBatchDeletedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MessageCreatedEventData. */ + interface IMessageCreatedEventData { + + /** MessageCreatedEventData message */ + message?: (google.chat.v1.IMessage|null); + } + + /** Represents a MessageCreatedEventData. */ + class MessageCreatedEventData implements IMessageCreatedEventData { + + /** + * Constructs a new MessageCreatedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMessageCreatedEventData); + + /** MessageCreatedEventData message. */ + public message?: (google.chat.v1.IMessage|null); + + /** + * Creates a new MessageCreatedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageCreatedEventData instance + */ + public static create(properties?: google.chat.v1.IMessageCreatedEventData): google.chat.v1.MessageCreatedEventData; + + /** + * Encodes the specified MessageCreatedEventData message. Does not implicitly {@link google.chat.v1.MessageCreatedEventData.verify|verify} messages. + * @param message MessageCreatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMessageCreatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageCreatedEventData.verify|verify} messages. + * @param message MessageCreatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMessageCreatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageCreatedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MessageCreatedEventData; + + /** + * Decodes a MessageCreatedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MessageCreatedEventData; + + /** + * Verifies a MessageCreatedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageCreatedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageCreatedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MessageCreatedEventData; + + /** + * Creates a plain object from a MessageCreatedEventData message. Also converts values to other types if specified. + * @param message MessageCreatedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MessageCreatedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageCreatedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageCreatedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MessageUpdatedEventData. */ + interface IMessageUpdatedEventData { + + /** MessageUpdatedEventData message */ + message?: (google.chat.v1.IMessage|null); + } + + /** Represents a MessageUpdatedEventData. */ + class MessageUpdatedEventData implements IMessageUpdatedEventData { + + /** + * Constructs a new MessageUpdatedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMessageUpdatedEventData); + + /** MessageUpdatedEventData message. */ + public message?: (google.chat.v1.IMessage|null); + + /** + * Creates a new MessageUpdatedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageUpdatedEventData instance + */ + public static create(properties?: google.chat.v1.IMessageUpdatedEventData): google.chat.v1.MessageUpdatedEventData; + + /** + * Encodes the specified MessageUpdatedEventData message. Does not implicitly {@link google.chat.v1.MessageUpdatedEventData.verify|verify} messages. + * @param message MessageUpdatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMessageUpdatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageUpdatedEventData.verify|verify} messages. + * @param message MessageUpdatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMessageUpdatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageUpdatedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MessageUpdatedEventData; + + /** + * Decodes a MessageUpdatedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MessageUpdatedEventData; + + /** + * Verifies a MessageUpdatedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageUpdatedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MessageUpdatedEventData; + + /** + * Creates a plain object from a MessageUpdatedEventData message. Also converts values to other types if specified. + * @param message MessageUpdatedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MessageUpdatedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageUpdatedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageUpdatedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MessageDeletedEventData. */ + interface IMessageDeletedEventData { + + /** MessageDeletedEventData message */ + message?: (google.chat.v1.IMessage|null); + } + + /** Represents a MessageDeletedEventData. */ + class MessageDeletedEventData implements IMessageDeletedEventData { + + /** + * Constructs a new MessageDeletedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMessageDeletedEventData); + + /** MessageDeletedEventData message. */ + public message?: (google.chat.v1.IMessage|null); + + /** + * Creates a new MessageDeletedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageDeletedEventData instance + */ + public static create(properties?: google.chat.v1.IMessageDeletedEventData): google.chat.v1.MessageDeletedEventData; + + /** + * Encodes the specified MessageDeletedEventData message. Does not implicitly {@link google.chat.v1.MessageDeletedEventData.verify|verify} messages. + * @param message MessageDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMessageDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageDeletedEventData.verify|verify} messages. + * @param message MessageDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMessageDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageDeletedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MessageDeletedEventData; + + /** + * Decodes a MessageDeletedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MessageDeletedEventData; + + /** + * Verifies a MessageDeletedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageDeletedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MessageDeletedEventData; + + /** + * Creates a plain object from a MessageDeletedEventData message. Also converts values to other types if specified. + * @param message MessageDeletedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MessageDeletedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageDeletedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageDeletedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MessageBatchCreatedEventData. */ + interface IMessageBatchCreatedEventData { + + /** MessageBatchCreatedEventData messages */ + messages?: (google.chat.v1.IMessageCreatedEventData[]|null); + } + + /** Represents a MessageBatchCreatedEventData. */ + class MessageBatchCreatedEventData implements IMessageBatchCreatedEventData { + + /** + * Constructs a new MessageBatchCreatedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMessageBatchCreatedEventData); + + /** MessageBatchCreatedEventData messages. */ + public messages: google.chat.v1.IMessageCreatedEventData[]; + + /** + * Creates a new MessageBatchCreatedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageBatchCreatedEventData instance + */ + public static create(properties?: google.chat.v1.IMessageBatchCreatedEventData): google.chat.v1.MessageBatchCreatedEventData; + + /** + * Encodes the specified MessageBatchCreatedEventData message. Does not implicitly {@link google.chat.v1.MessageBatchCreatedEventData.verify|verify} messages. + * @param message MessageBatchCreatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMessageBatchCreatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageBatchCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageBatchCreatedEventData.verify|verify} messages. + * @param message MessageBatchCreatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMessageBatchCreatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageBatchCreatedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageBatchCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MessageBatchCreatedEventData; + + /** + * Decodes a MessageBatchCreatedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageBatchCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MessageBatchCreatedEventData; + + /** + * Verifies a MessageBatchCreatedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageBatchCreatedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageBatchCreatedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MessageBatchCreatedEventData; + + /** + * Creates a plain object from a MessageBatchCreatedEventData message. Also converts values to other types if specified. + * @param message MessageBatchCreatedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MessageBatchCreatedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageBatchCreatedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageBatchCreatedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MessageBatchUpdatedEventData. */ + interface IMessageBatchUpdatedEventData { + + /** MessageBatchUpdatedEventData messages */ + messages?: (google.chat.v1.IMessageUpdatedEventData[]|null); + } + + /** Represents a MessageBatchUpdatedEventData. */ + class MessageBatchUpdatedEventData implements IMessageBatchUpdatedEventData { + + /** + * Constructs a new MessageBatchUpdatedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMessageBatchUpdatedEventData); + + /** MessageBatchUpdatedEventData messages. */ + public messages: google.chat.v1.IMessageUpdatedEventData[]; + + /** + * Creates a new MessageBatchUpdatedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageBatchUpdatedEventData instance + */ + public static create(properties?: google.chat.v1.IMessageBatchUpdatedEventData): google.chat.v1.MessageBatchUpdatedEventData; + + /** + * Encodes the specified MessageBatchUpdatedEventData message. Does not implicitly {@link google.chat.v1.MessageBatchUpdatedEventData.verify|verify} messages. + * @param message MessageBatchUpdatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMessageBatchUpdatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageBatchUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageBatchUpdatedEventData.verify|verify} messages. + * @param message MessageBatchUpdatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMessageBatchUpdatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageBatchUpdatedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageBatchUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MessageBatchUpdatedEventData; + + /** + * Decodes a MessageBatchUpdatedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageBatchUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MessageBatchUpdatedEventData; + + /** + * Verifies a MessageBatchUpdatedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageBatchUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageBatchUpdatedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MessageBatchUpdatedEventData; + + /** + * Creates a plain object from a MessageBatchUpdatedEventData message. Also converts values to other types if specified. + * @param message MessageBatchUpdatedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MessageBatchUpdatedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageBatchUpdatedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageBatchUpdatedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MessageBatchDeletedEventData. */ + interface IMessageBatchDeletedEventData { + + /** MessageBatchDeletedEventData messages */ + messages?: (google.chat.v1.IMessageDeletedEventData[]|null); + } + + /** Represents a MessageBatchDeletedEventData. */ + class MessageBatchDeletedEventData implements IMessageBatchDeletedEventData { + + /** + * Constructs a new MessageBatchDeletedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IMessageBatchDeletedEventData); + + /** MessageBatchDeletedEventData messages. */ + public messages: google.chat.v1.IMessageDeletedEventData[]; + + /** + * Creates a new MessageBatchDeletedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageBatchDeletedEventData instance + */ + public static create(properties?: google.chat.v1.IMessageBatchDeletedEventData): google.chat.v1.MessageBatchDeletedEventData; + + /** + * Encodes the specified MessageBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.MessageBatchDeletedEventData.verify|verify} messages. + * @param message MessageBatchDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IMessageBatchDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageBatchDeletedEventData.verify|verify} messages. + * @param message MessageBatchDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IMessageBatchDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageBatchDeletedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MessageBatchDeletedEventData; + + /** + * Decodes a MessageBatchDeletedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MessageBatchDeletedEventData; + + /** + * Verifies a MessageBatchDeletedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageBatchDeletedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.MessageBatchDeletedEventData; + + /** + * Creates a plain object from a MessageBatchDeletedEventData message. Also converts values to other types if specified. + * @param message MessageBatchDeletedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.MessageBatchDeletedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageBatchDeletedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageBatchDeletedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpaceUpdatedEventData. */ + interface ISpaceUpdatedEventData { + + /** SpaceUpdatedEventData space */ + space?: (google.chat.v1.ISpace|null); + } + + /** Represents a SpaceUpdatedEventData. */ + class SpaceUpdatedEventData implements ISpaceUpdatedEventData { + + /** + * Constructs a new SpaceUpdatedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ISpaceUpdatedEventData); + + /** SpaceUpdatedEventData space. */ + public space?: (google.chat.v1.ISpace|null); + + /** + * Creates a new SpaceUpdatedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns SpaceUpdatedEventData instance + */ + public static create(properties?: google.chat.v1.ISpaceUpdatedEventData): google.chat.v1.SpaceUpdatedEventData; + + /** + * Encodes the specified SpaceUpdatedEventData message. Does not implicitly {@link google.chat.v1.SpaceUpdatedEventData.verify|verify} messages. + * @param message SpaceUpdatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ISpaceUpdatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpaceUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.SpaceUpdatedEventData.verify|verify} messages. + * @param message SpaceUpdatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ISpaceUpdatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpaceUpdatedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpaceUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.SpaceUpdatedEventData; + + /** + * Decodes a SpaceUpdatedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpaceUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.SpaceUpdatedEventData; + + /** + * Verifies a SpaceUpdatedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpaceUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpaceUpdatedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.SpaceUpdatedEventData; + + /** + * Creates a plain object from a SpaceUpdatedEventData message. Also converts values to other types if specified. + * @param message SpaceUpdatedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.SpaceUpdatedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpaceUpdatedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpaceUpdatedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpaceBatchUpdatedEventData. */ + interface ISpaceBatchUpdatedEventData { + + /** SpaceBatchUpdatedEventData spaces */ + spaces?: (google.chat.v1.ISpaceUpdatedEventData[]|null); + } + + /** Represents a SpaceBatchUpdatedEventData. */ + class SpaceBatchUpdatedEventData implements ISpaceBatchUpdatedEventData { + + /** + * Constructs a new SpaceBatchUpdatedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ISpaceBatchUpdatedEventData); + + /** SpaceBatchUpdatedEventData spaces. */ + public spaces: google.chat.v1.ISpaceUpdatedEventData[]; + + /** + * Creates a new SpaceBatchUpdatedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns SpaceBatchUpdatedEventData instance + */ + public static create(properties?: google.chat.v1.ISpaceBatchUpdatedEventData): google.chat.v1.SpaceBatchUpdatedEventData; + + /** + * Encodes the specified SpaceBatchUpdatedEventData message. Does not implicitly {@link google.chat.v1.SpaceBatchUpdatedEventData.verify|verify} messages. + * @param message SpaceBatchUpdatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ISpaceBatchUpdatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpaceBatchUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.SpaceBatchUpdatedEventData.verify|verify} messages. + * @param message SpaceBatchUpdatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ISpaceBatchUpdatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpaceBatchUpdatedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpaceBatchUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.SpaceBatchUpdatedEventData; + + /** + * Decodes a SpaceBatchUpdatedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpaceBatchUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.SpaceBatchUpdatedEventData; + + /** + * Verifies a SpaceBatchUpdatedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpaceBatchUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpaceBatchUpdatedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.SpaceBatchUpdatedEventData; + + /** + * Creates a plain object from a SpaceBatchUpdatedEventData message. Also converts values to other types if specified. + * @param message SpaceBatchUpdatedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.SpaceBatchUpdatedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpaceBatchUpdatedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpaceBatchUpdatedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReactionCreatedEventData. */ + interface IReactionCreatedEventData { + + /** ReactionCreatedEventData reaction */ + reaction?: (google.chat.v1.IReaction|null); + } + + /** Represents a ReactionCreatedEventData. */ + class ReactionCreatedEventData implements IReactionCreatedEventData { + + /** + * Constructs a new ReactionCreatedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IReactionCreatedEventData); + + /** ReactionCreatedEventData reaction. */ + public reaction?: (google.chat.v1.IReaction|null); + + /** + * Creates a new ReactionCreatedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns ReactionCreatedEventData instance + */ + public static create(properties?: google.chat.v1.IReactionCreatedEventData): google.chat.v1.ReactionCreatedEventData; + + /** + * Encodes the specified ReactionCreatedEventData message. Does not implicitly {@link google.chat.v1.ReactionCreatedEventData.verify|verify} messages. + * @param message ReactionCreatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IReactionCreatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReactionCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionCreatedEventData.verify|verify} messages. + * @param message ReactionCreatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IReactionCreatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReactionCreatedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReactionCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ReactionCreatedEventData; + + /** + * Decodes a ReactionCreatedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReactionCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ReactionCreatedEventData; + + /** + * Verifies a ReactionCreatedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReactionCreatedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReactionCreatedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ReactionCreatedEventData; + + /** + * Creates a plain object from a ReactionCreatedEventData message. Also converts values to other types if specified. + * @param message ReactionCreatedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ReactionCreatedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReactionCreatedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReactionCreatedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReactionDeletedEventData. */ + interface IReactionDeletedEventData { + + /** ReactionDeletedEventData reaction */ + reaction?: (google.chat.v1.IReaction|null); + } + + /** Represents a ReactionDeletedEventData. */ + class ReactionDeletedEventData implements IReactionDeletedEventData { + + /** + * Constructs a new ReactionDeletedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IReactionDeletedEventData); + + /** ReactionDeletedEventData reaction. */ + public reaction?: (google.chat.v1.IReaction|null); + + /** + * Creates a new ReactionDeletedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns ReactionDeletedEventData instance + */ + public static create(properties?: google.chat.v1.IReactionDeletedEventData): google.chat.v1.ReactionDeletedEventData; + + /** + * Encodes the specified ReactionDeletedEventData message. Does not implicitly {@link google.chat.v1.ReactionDeletedEventData.verify|verify} messages. + * @param message ReactionDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IReactionDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReactionDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionDeletedEventData.verify|verify} messages. + * @param message ReactionDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IReactionDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReactionDeletedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReactionDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ReactionDeletedEventData; + + /** + * Decodes a ReactionDeletedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReactionDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ReactionDeletedEventData; + + /** + * Verifies a ReactionDeletedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReactionDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReactionDeletedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ReactionDeletedEventData; + + /** + * Creates a plain object from a ReactionDeletedEventData message. Also converts values to other types if specified. + * @param message ReactionDeletedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ReactionDeletedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReactionDeletedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReactionDeletedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReactionBatchCreatedEventData. */ + interface IReactionBatchCreatedEventData { + + /** ReactionBatchCreatedEventData reactions */ + reactions?: (google.chat.v1.IReactionCreatedEventData[]|null); + } + + /** Represents a ReactionBatchCreatedEventData. */ + class ReactionBatchCreatedEventData implements IReactionBatchCreatedEventData { + + /** + * Constructs a new ReactionBatchCreatedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IReactionBatchCreatedEventData); + + /** ReactionBatchCreatedEventData reactions. */ + public reactions: google.chat.v1.IReactionCreatedEventData[]; + + /** + * Creates a new ReactionBatchCreatedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns ReactionBatchCreatedEventData instance + */ + public static create(properties?: google.chat.v1.IReactionBatchCreatedEventData): google.chat.v1.ReactionBatchCreatedEventData; + + /** + * Encodes the specified ReactionBatchCreatedEventData message. Does not implicitly {@link google.chat.v1.ReactionBatchCreatedEventData.verify|verify} messages. + * @param message ReactionBatchCreatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IReactionBatchCreatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReactionBatchCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionBatchCreatedEventData.verify|verify} messages. + * @param message ReactionBatchCreatedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IReactionBatchCreatedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReactionBatchCreatedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReactionBatchCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ReactionBatchCreatedEventData; + + /** + * Decodes a ReactionBatchCreatedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReactionBatchCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ReactionBatchCreatedEventData; + + /** + * Verifies a ReactionBatchCreatedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReactionBatchCreatedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReactionBatchCreatedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ReactionBatchCreatedEventData; + + /** + * Creates a plain object from a ReactionBatchCreatedEventData message. Also converts values to other types if specified. + * @param message ReactionBatchCreatedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ReactionBatchCreatedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReactionBatchCreatedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReactionBatchCreatedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReactionBatchDeletedEventData. */ + interface IReactionBatchDeletedEventData { + + /** ReactionBatchDeletedEventData reactions */ + reactions?: (google.chat.v1.IReactionDeletedEventData[]|null); + } + + /** Represents a ReactionBatchDeletedEventData. */ + class ReactionBatchDeletedEventData implements IReactionBatchDeletedEventData { + + /** + * Constructs a new ReactionBatchDeletedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IReactionBatchDeletedEventData); + + /** ReactionBatchDeletedEventData reactions. */ + public reactions: google.chat.v1.IReactionDeletedEventData[]; + + /** + * Creates a new ReactionBatchDeletedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns ReactionBatchDeletedEventData instance + */ + public static create(properties?: google.chat.v1.IReactionBatchDeletedEventData): google.chat.v1.ReactionBatchDeletedEventData; + + /** + * Encodes the specified ReactionBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.ReactionBatchDeletedEventData.verify|verify} messages. + * @param message ReactionBatchDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IReactionBatchDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReactionBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionBatchDeletedEventData.verify|verify} messages. + * @param message ReactionBatchDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IReactionBatchDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReactionBatchDeletedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReactionBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ReactionBatchDeletedEventData; + + /** + * Decodes a ReactionBatchDeletedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReactionBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ReactionBatchDeletedEventData; + + /** + * Verifies a ReactionBatchDeletedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReactionBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReactionBatchDeletedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ReactionBatchDeletedEventData; + + /** + * Creates a plain object from a ReactionBatchDeletedEventData message. Also converts values to other types if specified. + * @param message ReactionBatchDeletedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ReactionBatchDeletedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReactionBatchDeletedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReactionBatchDeletedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpaceReadState. */ + interface ISpaceReadState { + + /** SpaceReadState name */ + name?: (string|null); + + /** SpaceReadState lastReadTime */ + lastReadTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SpaceReadState. */ + class SpaceReadState implements ISpaceReadState { + + /** + * Constructs a new SpaceReadState. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ISpaceReadState); + + /** SpaceReadState name. */ + public name: string; + + /** SpaceReadState lastReadTime. */ + public lastReadTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SpaceReadState instance using the specified properties. + * @param [properties] Properties to set + * @returns SpaceReadState instance + */ + public static create(properties?: google.chat.v1.ISpaceReadState): google.chat.v1.SpaceReadState; + + /** + * Encodes the specified SpaceReadState message. Does not implicitly {@link google.chat.v1.SpaceReadState.verify|verify} messages. + * @param message SpaceReadState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ISpaceReadState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpaceReadState message, length delimited. Does not implicitly {@link google.chat.v1.SpaceReadState.verify|verify} messages. + * @param message SpaceReadState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ISpaceReadState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpaceReadState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpaceReadState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.SpaceReadState; + + /** + * Decodes a SpaceReadState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpaceReadState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.SpaceReadState; + + /** + * Verifies a SpaceReadState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpaceReadState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpaceReadState + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.SpaceReadState; + + /** + * Creates a plain object from a SpaceReadState message. Also converts values to other types if specified. + * @param message SpaceReadState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.SpaceReadState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpaceReadState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpaceReadState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSpaceReadStateRequest. */ + interface IGetSpaceReadStateRequest { + + /** GetSpaceReadStateRequest name */ + name?: (string|null); + } + + /** Represents a GetSpaceReadStateRequest. */ + class GetSpaceReadStateRequest implements IGetSpaceReadStateRequest { + + /** + * Constructs a new GetSpaceReadStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IGetSpaceReadStateRequest); + + /** GetSpaceReadStateRequest name. */ + public name: string; + + /** + * Creates a new GetSpaceReadStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSpaceReadStateRequest instance + */ + public static create(properties?: google.chat.v1.IGetSpaceReadStateRequest): google.chat.v1.GetSpaceReadStateRequest; + + /** + * Encodes the specified GetSpaceReadStateRequest message. Does not implicitly {@link google.chat.v1.GetSpaceReadStateRequest.verify|verify} messages. + * @param message GetSpaceReadStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IGetSpaceReadStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSpaceReadStateRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetSpaceReadStateRequest.verify|verify} messages. + * @param message GetSpaceReadStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IGetSpaceReadStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSpaceReadStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSpaceReadStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.GetSpaceReadStateRequest; + + /** + * Decodes a GetSpaceReadStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSpaceReadStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.GetSpaceReadStateRequest; + + /** + * Verifies a GetSpaceReadStateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSpaceReadStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSpaceReadStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.GetSpaceReadStateRequest; + + /** + * Creates a plain object from a GetSpaceReadStateRequest message. Also converts values to other types if specified. + * @param message GetSpaceReadStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.GetSpaceReadStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSpaceReadStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSpaceReadStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSpaceReadStateRequest. */ + interface IUpdateSpaceReadStateRequest { + + /** UpdateSpaceReadStateRequest spaceReadState */ + spaceReadState?: (google.chat.v1.ISpaceReadState|null); + + /** UpdateSpaceReadStateRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSpaceReadStateRequest. */ + class UpdateSpaceReadStateRequest implements IUpdateSpaceReadStateRequest { + + /** + * Constructs a new UpdateSpaceReadStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IUpdateSpaceReadStateRequest); + + /** UpdateSpaceReadStateRequest spaceReadState. */ + public spaceReadState?: (google.chat.v1.ISpaceReadState|null); + + /** UpdateSpaceReadStateRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSpaceReadStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSpaceReadStateRequest instance + */ + public static create(properties?: google.chat.v1.IUpdateSpaceReadStateRequest): google.chat.v1.UpdateSpaceReadStateRequest; + + /** + * Encodes the specified UpdateSpaceReadStateRequest message. Does not implicitly {@link google.chat.v1.UpdateSpaceReadStateRequest.verify|verify} messages. + * @param message UpdateSpaceReadStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IUpdateSpaceReadStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSpaceReadStateRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateSpaceReadStateRequest.verify|verify} messages. + * @param message UpdateSpaceReadStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IUpdateSpaceReadStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSpaceReadStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSpaceReadStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.UpdateSpaceReadStateRequest; + + /** + * Decodes an UpdateSpaceReadStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSpaceReadStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.UpdateSpaceReadStateRequest; + + /** + * Verifies an UpdateSpaceReadStateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSpaceReadStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSpaceReadStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.UpdateSpaceReadStateRequest; + + /** + * Creates a plain object from an UpdateSpaceReadStateRequest message. Also converts values to other types if specified. + * @param message UpdateSpaceReadStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.UpdateSpaceReadStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSpaceReadStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSpaceReadStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SetUpSpaceRequest. */ + interface ISetUpSpaceRequest { + + /** SetUpSpaceRequest space */ + space?: (google.chat.v1.ISpace|null); + + /** SetUpSpaceRequest requestId */ + requestId?: (string|null); + + /** SetUpSpaceRequest memberships */ + memberships?: (google.chat.v1.IMembership[]|null); + } + + /** Represents a SetUpSpaceRequest. */ + class SetUpSpaceRequest implements ISetUpSpaceRequest { + + /** + * Constructs a new SetUpSpaceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ISetUpSpaceRequest); + + /** SetUpSpaceRequest space. */ + public space?: (google.chat.v1.ISpace|null); + + /** SetUpSpaceRequest requestId. */ + public requestId: string; + + /** SetUpSpaceRequest memberships. */ + public memberships: google.chat.v1.IMembership[]; + + /** + * Creates a new SetUpSpaceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetUpSpaceRequest instance + */ + public static create(properties?: google.chat.v1.ISetUpSpaceRequest): google.chat.v1.SetUpSpaceRequest; + + /** + * Encodes the specified SetUpSpaceRequest message. Does not implicitly {@link google.chat.v1.SetUpSpaceRequest.verify|verify} messages. + * @param message SetUpSpaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ISetUpSpaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetUpSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.SetUpSpaceRequest.verify|verify} messages. + * @param message SetUpSpaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ISetUpSpaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetUpSpaceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetUpSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.SetUpSpaceRequest; + + /** + * Decodes a SetUpSpaceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetUpSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.SetUpSpaceRequest; + + /** + * Verifies a SetUpSpaceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetUpSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetUpSpaceRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.SetUpSpaceRequest; + + /** + * Creates a plain object from a SetUpSpaceRequest message. Also converts values to other types if specified. + * @param message SetUpSpaceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.SetUpSpaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetUpSpaceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetUpSpaceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThreadReadState. */ + interface IThreadReadState { + + /** ThreadReadState name */ + name?: (string|null); + + /** ThreadReadState lastReadTime */ + lastReadTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ThreadReadState. */ + class ThreadReadState implements IThreadReadState { + + /** + * Constructs a new ThreadReadState. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IThreadReadState); + + /** ThreadReadState name. */ + public name: string; + + /** ThreadReadState lastReadTime. */ + public lastReadTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ThreadReadState instance using the specified properties. + * @param [properties] Properties to set + * @returns ThreadReadState instance + */ + public static create(properties?: google.chat.v1.IThreadReadState): google.chat.v1.ThreadReadState; + + /** + * Encodes the specified ThreadReadState message. Does not implicitly {@link google.chat.v1.ThreadReadState.verify|verify} messages. + * @param message ThreadReadState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IThreadReadState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ThreadReadState message, length delimited. Does not implicitly {@link google.chat.v1.ThreadReadState.verify|verify} messages. + * @param message ThreadReadState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IThreadReadState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThreadReadState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ThreadReadState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ThreadReadState; + + /** + * Decodes a ThreadReadState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ThreadReadState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ThreadReadState; + + /** + * Verifies a ThreadReadState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ThreadReadState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ThreadReadState + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ThreadReadState; + + /** + * Creates a plain object from a ThreadReadState message. Also converts values to other types if specified. + * @param message ThreadReadState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ThreadReadState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ThreadReadState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ThreadReadState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetThreadReadStateRequest. */ + interface IGetThreadReadStateRequest { + + /** GetThreadReadStateRequest name */ + name?: (string|null); + } + + /** Represents a GetThreadReadStateRequest. */ + class GetThreadReadStateRequest implements IGetThreadReadStateRequest { + + /** + * Constructs a new GetThreadReadStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IGetThreadReadStateRequest); + + /** GetThreadReadStateRequest name. */ + public name: string; + + /** + * Creates a new GetThreadReadStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetThreadReadStateRequest instance + */ + public static create(properties?: google.chat.v1.IGetThreadReadStateRequest): google.chat.v1.GetThreadReadStateRequest; + + /** + * Encodes the specified GetThreadReadStateRequest message. Does not implicitly {@link google.chat.v1.GetThreadReadStateRequest.verify|verify} messages. + * @param message GetThreadReadStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IGetThreadReadStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetThreadReadStateRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetThreadReadStateRequest.verify|verify} messages. + * @param message GetThreadReadStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IGetThreadReadStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetThreadReadStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetThreadReadStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.GetThreadReadStateRequest; + + /** + * Decodes a GetThreadReadStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetThreadReadStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.GetThreadReadStateRequest; + + /** + * Verifies a GetThreadReadStateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetThreadReadStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetThreadReadStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.GetThreadReadStateRequest; + + /** + * Creates a plain object from a GetThreadReadStateRequest message. Also converts values to other types if specified. + * @param message GetThreadReadStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.GetThreadReadStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetThreadReadStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetThreadReadStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Code enum. */ + enum Code { + OK = 0, + CANCELLED = 1, + UNKNOWN = 2, + INVALID_ARGUMENT = 3, + DEADLINE_EXCEEDED = 4, + NOT_FOUND = 5, + ALREADY_EXISTS = 6, + PERMISSION_DENIED = 7, + UNAUTHENTICATED = 16, + RESOURCE_EXHAUSTED = 8, + FAILED_PRECONDITION = 9, + ABORTED = 10, + OUT_OF_RANGE = 11, + UNIMPLEMENTED = 12, + INTERNAL = 13, + UNAVAILABLE = 14, + DATA_LOSS = 15 + } + } + + /** Namespace api. */ + namespace api { + + /** 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; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + } +} diff --git a/owl-bot-staging/google-chat/v1/protos/protos.js b/owl-bot-staging/google-chat/v1/protos/protos.js new file mode 100644 index 00000000000..c88e356ea44 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/protos.js @@ -0,0 +1,62444 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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_apps_chat_protos || ($protobuf.roots._google_apps_chat_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + */ + + /** + * 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.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.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; + } + 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.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + if (message[".google.api.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; + } + } + 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.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + if (object[".google.api.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; + } + } + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + return protobuf; + })(); + + google.apps = (function() { + + /** + * Namespace apps. + * @memberof google + * @namespace + */ + var apps = {}; + + apps.card = (function() { + + /** + * Namespace card. + * @memberof google.apps + * @namespace + */ + var card = {}; + + card.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.apps.card + * @namespace + */ + var v1 = {}; + + v1.Card = (function() { + + /** + * Properties of a Card. + * @memberof google.apps.card.v1 + * @interface ICard + * @property {google.apps.card.v1.Card.ICardHeader|null} [header] Card header + * @property {Array.|null} [sections] Card sections + * @property {google.apps.card.v1.Card.DividerStyle|null} [sectionDividerStyle] Card sectionDividerStyle + * @property {Array.|null} [cardActions] Card cardActions + * @property {string|null} [name] Card name + * @property {google.apps.card.v1.Card.ICardFixedFooter|null} [fixedFooter] Card fixedFooter + * @property {google.apps.card.v1.Card.DisplayStyle|null} [displayStyle] Card displayStyle + * @property {google.apps.card.v1.Card.ICardHeader|null} [peekCardHeader] Card peekCardHeader + */ + + /** + * Constructs a new Card. + * @memberof google.apps.card.v1 + * @classdesc Represents a Card. + * @implements ICard + * @constructor + * @param {google.apps.card.v1.ICard=} [properties] Properties to set + */ + function Card(properties) { + this.sections = []; + this.cardActions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Card header. + * @member {google.apps.card.v1.Card.ICardHeader|null|undefined} header + * @memberof google.apps.card.v1.Card + * @instance + */ + Card.prototype.header = null; + + /** + * Card sections. + * @member {Array.} sections + * @memberof google.apps.card.v1.Card + * @instance + */ + Card.prototype.sections = $util.emptyArray; + + /** + * Card sectionDividerStyle. + * @member {google.apps.card.v1.Card.DividerStyle} sectionDividerStyle + * @memberof google.apps.card.v1.Card + * @instance + */ + Card.prototype.sectionDividerStyle = 0; + + /** + * Card cardActions. + * @member {Array.} cardActions + * @memberof google.apps.card.v1.Card + * @instance + */ + Card.prototype.cardActions = $util.emptyArray; + + /** + * Card name. + * @member {string} name + * @memberof google.apps.card.v1.Card + * @instance + */ + Card.prototype.name = ""; + + /** + * Card fixedFooter. + * @member {google.apps.card.v1.Card.ICardFixedFooter|null|undefined} fixedFooter + * @memberof google.apps.card.v1.Card + * @instance + */ + Card.prototype.fixedFooter = null; + + /** + * Card displayStyle. + * @member {google.apps.card.v1.Card.DisplayStyle} displayStyle + * @memberof google.apps.card.v1.Card + * @instance + */ + Card.prototype.displayStyle = 0; + + /** + * Card peekCardHeader. + * @member {google.apps.card.v1.Card.ICardHeader|null|undefined} peekCardHeader + * @memberof google.apps.card.v1.Card + * @instance + */ + Card.prototype.peekCardHeader = null; + + /** + * Creates a new Card instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Card + * @static + * @param {google.apps.card.v1.ICard=} [properties] Properties to set + * @returns {google.apps.card.v1.Card} Card instance + */ + Card.create = function create(properties) { + return new Card(properties); + }; + + /** + * Encodes the specified Card message. Does not implicitly {@link google.apps.card.v1.Card.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Card + * @static + * @param {google.apps.card.v1.ICard} message Card message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Card.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.google.apps.card.v1.Card.CardHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sections != null && message.sections.length) + for (var i = 0; i < message.sections.length; ++i) + $root.google.apps.card.v1.Card.Section.encode(message.sections[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cardActions != null && message.cardActions.length) + for (var i = 0; i < message.cardActions.length; ++i) + $root.google.apps.card.v1.Card.CardAction.encode(message.cardActions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.fixedFooter != null && Object.hasOwnProperty.call(message, "fixedFooter")) + $root.google.apps.card.v1.Card.CardFixedFooter.encode(message.fixedFooter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.displayStyle != null && Object.hasOwnProperty.call(message, "displayStyle")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.displayStyle); + if (message.peekCardHeader != null && Object.hasOwnProperty.call(message, "peekCardHeader")) + $root.google.apps.card.v1.Card.CardHeader.encode(message.peekCardHeader, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.sectionDividerStyle != null && Object.hasOwnProperty.call(message, "sectionDividerStyle")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.sectionDividerStyle); + return writer; + }; + + /** + * Encodes the specified Card message, length delimited. Does not implicitly {@link google.apps.card.v1.Card.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Card + * @static + * @param {google.apps.card.v1.ICard} message Card message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Card.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Card message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Card + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Card} Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Card.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Card(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.header = $root.google.apps.card.v1.Card.CardHeader.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.sections && message.sections.length)) + message.sections = []; + message.sections.push($root.google.apps.card.v1.Card.Section.decode(reader, reader.uint32())); + break; + } + case 9: { + message.sectionDividerStyle = reader.int32(); + break; + } + case 3: { + if (!(message.cardActions && message.cardActions.length)) + message.cardActions = []; + message.cardActions.push($root.google.apps.card.v1.Card.CardAction.decode(reader, reader.uint32())); + break; + } + case 4: { + message.name = reader.string(); + break; + } + case 5: { + message.fixedFooter = $root.google.apps.card.v1.Card.CardFixedFooter.decode(reader, reader.uint32()); + break; + } + case 6: { + message.displayStyle = reader.int32(); + break; + } + case 7: { + message.peekCardHeader = $root.google.apps.card.v1.Card.CardHeader.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Card message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Card + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Card} Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Card.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Card message. + * @function verify + * @memberof google.apps.card.v1.Card + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Card.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.google.apps.card.v1.Card.CardHeader.verify(message.header); + if (error) + return "header." + error; + } + if (message.sections != null && message.hasOwnProperty("sections")) { + if (!Array.isArray(message.sections)) + return "sections: array expected"; + for (var i = 0; i < message.sections.length; ++i) { + var error = $root.google.apps.card.v1.Card.Section.verify(message.sections[i]); + if (error) + return "sections." + error; + } + } + if (message.sectionDividerStyle != null && message.hasOwnProperty("sectionDividerStyle")) + switch (message.sectionDividerStyle) { + default: + return "sectionDividerStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.cardActions != null && message.hasOwnProperty("cardActions")) { + if (!Array.isArray(message.cardActions)) + return "cardActions: array expected"; + for (var i = 0; i < message.cardActions.length; ++i) { + var error = $root.google.apps.card.v1.Card.CardAction.verify(message.cardActions[i]); + if (error) + return "cardActions." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.fixedFooter != null && message.hasOwnProperty("fixedFooter")) { + var error = $root.google.apps.card.v1.Card.CardFixedFooter.verify(message.fixedFooter); + if (error) + return "fixedFooter." + error; + } + if (message.displayStyle != null && message.hasOwnProperty("displayStyle")) + switch (message.displayStyle) { + default: + return "displayStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.peekCardHeader != null && message.hasOwnProperty("peekCardHeader")) { + var error = $root.google.apps.card.v1.Card.CardHeader.verify(message.peekCardHeader); + if (error) + return "peekCardHeader." + error; + } + return null; + }; + + /** + * Creates a Card message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Card + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Card} Card + */ + Card.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Card) + return object; + var message = new $root.google.apps.card.v1.Card(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".google.apps.card.v1.Card.header: object expected"); + message.header = $root.google.apps.card.v1.Card.CardHeader.fromObject(object.header); + } + if (object.sections) { + if (!Array.isArray(object.sections)) + throw TypeError(".google.apps.card.v1.Card.sections: array expected"); + message.sections = []; + for (var i = 0; i < object.sections.length; ++i) { + if (typeof object.sections[i] !== "object") + throw TypeError(".google.apps.card.v1.Card.sections: object expected"); + message.sections[i] = $root.google.apps.card.v1.Card.Section.fromObject(object.sections[i]); + } + } + switch (object.sectionDividerStyle) { + default: + if (typeof object.sectionDividerStyle === "number") { + message.sectionDividerStyle = object.sectionDividerStyle; + break; + } + break; + case "DIVIDER_STYLE_UNSPECIFIED": + case 0: + message.sectionDividerStyle = 0; + break; + case "SOLID_DIVIDER": + case 1: + message.sectionDividerStyle = 1; + break; + case "NO_DIVIDER": + case 2: + message.sectionDividerStyle = 2; + break; + } + if (object.cardActions) { + if (!Array.isArray(object.cardActions)) + throw TypeError(".google.apps.card.v1.Card.cardActions: array expected"); + message.cardActions = []; + for (var i = 0; i < object.cardActions.length; ++i) { + if (typeof object.cardActions[i] !== "object") + throw TypeError(".google.apps.card.v1.Card.cardActions: object expected"); + message.cardActions[i] = $root.google.apps.card.v1.Card.CardAction.fromObject(object.cardActions[i]); + } + } + if (object.name != null) + message.name = String(object.name); + if (object.fixedFooter != null) { + if (typeof object.fixedFooter !== "object") + throw TypeError(".google.apps.card.v1.Card.fixedFooter: object expected"); + message.fixedFooter = $root.google.apps.card.v1.Card.CardFixedFooter.fromObject(object.fixedFooter); + } + switch (object.displayStyle) { + default: + if (typeof object.displayStyle === "number") { + message.displayStyle = object.displayStyle; + break; + } + break; + case "DISPLAY_STYLE_UNSPECIFIED": + case 0: + message.displayStyle = 0; + break; + case "PEEK": + case 1: + message.displayStyle = 1; + break; + case "REPLACE": + case 2: + message.displayStyle = 2; + break; + } + if (object.peekCardHeader != null) { + if (typeof object.peekCardHeader !== "object") + throw TypeError(".google.apps.card.v1.Card.peekCardHeader: object expected"); + message.peekCardHeader = $root.google.apps.card.v1.Card.CardHeader.fromObject(object.peekCardHeader); + } + return message; + }; + + /** + * Creates a plain object from a Card message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Card + * @static + * @param {google.apps.card.v1.Card} message Card + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Card.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sections = []; + object.cardActions = []; + } + if (options.defaults) { + object.header = null; + object.name = ""; + object.fixedFooter = null; + object.displayStyle = options.enums === String ? "DISPLAY_STYLE_UNSPECIFIED" : 0; + object.peekCardHeader = null; + object.sectionDividerStyle = options.enums === String ? "DIVIDER_STYLE_UNSPECIFIED" : 0; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.google.apps.card.v1.Card.CardHeader.toObject(message.header, options); + if (message.sections && message.sections.length) { + object.sections = []; + for (var j = 0; j < message.sections.length; ++j) + object.sections[j] = $root.google.apps.card.v1.Card.Section.toObject(message.sections[j], options); + } + if (message.cardActions && message.cardActions.length) { + object.cardActions = []; + for (var j = 0; j < message.cardActions.length; ++j) + object.cardActions[j] = $root.google.apps.card.v1.Card.CardAction.toObject(message.cardActions[j], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fixedFooter != null && message.hasOwnProperty("fixedFooter")) + object.fixedFooter = $root.google.apps.card.v1.Card.CardFixedFooter.toObject(message.fixedFooter, options); + if (message.displayStyle != null && message.hasOwnProperty("displayStyle")) + object.displayStyle = options.enums === String ? $root.google.apps.card.v1.Card.DisplayStyle[message.displayStyle] === undefined ? message.displayStyle : $root.google.apps.card.v1.Card.DisplayStyle[message.displayStyle] : message.displayStyle; + if (message.peekCardHeader != null && message.hasOwnProperty("peekCardHeader")) + object.peekCardHeader = $root.google.apps.card.v1.Card.CardHeader.toObject(message.peekCardHeader, options); + if (message.sectionDividerStyle != null && message.hasOwnProperty("sectionDividerStyle")) + object.sectionDividerStyle = options.enums === String ? $root.google.apps.card.v1.Card.DividerStyle[message.sectionDividerStyle] === undefined ? message.sectionDividerStyle : $root.google.apps.card.v1.Card.DividerStyle[message.sectionDividerStyle] : message.sectionDividerStyle; + return object; + }; + + /** + * Converts this Card to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Card + * @instance + * @returns {Object.} JSON object + */ + Card.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Card + * @function getTypeUrl + * @memberof google.apps.card.v1.Card + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Card.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Card"; + }; + + Card.CardHeader = (function() { + + /** + * Properties of a CardHeader. + * @memberof google.apps.card.v1.Card + * @interface ICardHeader + * @property {string|null} [title] CardHeader title + * @property {string|null} [subtitle] CardHeader subtitle + * @property {google.apps.card.v1.Widget.ImageType|null} [imageType] CardHeader imageType + * @property {string|null} [imageUrl] CardHeader imageUrl + * @property {string|null} [imageAltText] CardHeader imageAltText + */ + + /** + * Constructs a new CardHeader. + * @memberof google.apps.card.v1.Card + * @classdesc Represents a CardHeader. + * @implements ICardHeader + * @constructor + * @param {google.apps.card.v1.Card.ICardHeader=} [properties] Properties to set + */ + function CardHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CardHeader title. + * @member {string} title + * @memberof google.apps.card.v1.Card.CardHeader + * @instance + */ + CardHeader.prototype.title = ""; + + /** + * CardHeader subtitle. + * @member {string} subtitle + * @memberof google.apps.card.v1.Card.CardHeader + * @instance + */ + CardHeader.prototype.subtitle = ""; + + /** + * CardHeader imageType. + * @member {google.apps.card.v1.Widget.ImageType} imageType + * @memberof google.apps.card.v1.Card.CardHeader + * @instance + */ + CardHeader.prototype.imageType = 0; + + /** + * CardHeader imageUrl. + * @member {string} imageUrl + * @memberof google.apps.card.v1.Card.CardHeader + * @instance + */ + CardHeader.prototype.imageUrl = ""; + + /** + * CardHeader imageAltText. + * @member {string} imageAltText + * @memberof google.apps.card.v1.Card.CardHeader + * @instance + */ + CardHeader.prototype.imageAltText = ""; + + /** + * Creates a new CardHeader instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Card.CardHeader + * @static + * @param {google.apps.card.v1.Card.ICardHeader=} [properties] Properties to set + * @returns {google.apps.card.v1.Card.CardHeader} CardHeader instance + */ + CardHeader.create = function create(properties) { + return new CardHeader(properties); + }; + + /** + * Encodes the specified CardHeader message. Does not implicitly {@link google.apps.card.v1.Card.CardHeader.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Card.CardHeader + * @static + * @param {google.apps.card.v1.Card.ICardHeader} message CardHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); + if (message.imageType != null && Object.hasOwnProperty.call(message, "imageType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.imageType); + if (message.imageUrl != null && Object.hasOwnProperty.call(message, "imageUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.imageUrl); + if (message.imageAltText != null && Object.hasOwnProperty.call(message, "imageAltText")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.imageAltText); + return writer; + }; + + /** + * Encodes the specified CardHeader message, length delimited. Does not implicitly {@link google.apps.card.v1.Card.CardHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Card.CardHeader + * @static + * @param {google.apps.card.v1.Card.ICardHeader} message CardHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CardHeader message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Card.CardHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Card.CardHeader} CardHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Card.CardHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.title = reader.string(); + break; + } + case 2: { + message.subtitle = reader.string(); + break; + } + case 3: { + message.imageType = reader.int32(); + break; + } + case 4: { + message.imageUrl = reader.string(); + break; + } + case 5: { + message.imageAltText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CardHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Card.CardHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Card.CardHeader} CardHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CardHeader message. + * @function verify + * @memberof google.apps.card.v1.Card.CardHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CardHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + if (message.imageType != null && message.hasOwnProperty("imageType")) + switch (message.imageType) { + default: + return "imageType: enum value expected"; + case 0: + case 1: + break; + } + if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) + if (!$util.isString(message.imageUrl)) + return "imageUrl: string expected"; + if (message.imageAltText != null && message.hasOwnProperty("imageAltText")) + if (!$util.isString(message.imageAltText)) + return "imageAltText: string expected"; + return null; + }; + + /** + * Creates a CardHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Card.CardHeader + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Card.CardHeader} CardHeader + */ + CardHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Card.CardHeader) + return object; + var message = new $root.google.apps.card.v1.Card.CardHeader(); + if (object.title != null) + message.title = String(object.title); + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + switch (object.imageType) { + default: + if (typeof object.imageType === "number") { + message.imageType = object.imageType; + break; + } + break; + case "SQUARE": + case 0: + message.imageType = 0; + break; + case "CIRCLE": + case 1: + message.imageType = 1; + break; + } + if (object.imageUrl != null) + message.imageUrl = String(object.imageUrl); + if (object.imageAltText != null) + message.imageAltText = String(object.imageAltText); + return message; + }; + + /** + * Creates a plain object from a CardHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Card.CardHeader + * @static + * @param {google.apps.card.v1.Card.CardHeader} message CardHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CardHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.title = ""; + object.subtitle = ""; + object.imageType = options.enums === String ? "SQUARE" : 0; + object.imageUrl = ""; + object.imageAltText = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + if (message.imageType != null && message.hasOwnProperty("imageType")) + object.imageType = options.enums === String ? $root.google.apps.card.v1.Widget.ImageType[message.imageType] === undefined ? message.imageType : $root.google.apps.card.v1.Widget.ImageType[message.imageType] : message.imageType; + if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) + object.imageUrl = message.imageUrl; + if (message.imageAltText != null && message.hasOwnProperty("imageAltText")) + object.imageAltText = message.imageAltText; + return object; + }; + + /** + * Converts this CardHeader to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Card.CardHeader + * @instance + * @returns {Object.} JSON object + */ + CardHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CardHeader + * @function getTypeUrl + * @memberof google.apps.card.v1.Card.CardHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CardHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Card.CardHeader"; + }; + + return CardHeader; + })(); + + Card.Section = (function() { + + /** + * Properties of a Section. + * @memberof google.apps.card.v1.Card + * @interface ISection + * @property {string|null} [header] Section header + * @property {Array.|null} [widgets] Section widgets + * @property {boolean|null} [collapsible] Section collapsible + * @property {number|null} [uncollapsibleWidgetsCount] Section uncollapsibleWidgetsCount + */ + + /** + * Constructs a new Section. + * @memberof google.apps.card.v1.Card + * @classdesc Represents a Section. + * @implements ISection + * @constructor + * @param {google.apps.card.v1.Card.ISection=} [properties] Properties to set + */ + function Section(properties) { + this.widgets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Section header. + * @member {string} header + * @memberof google.apps.card.v1.Card.Section + * @instance + */ + Section.prototype.header = ""; + + /** + * Section widgets. + * @member {Array.} widgets + * @memberof google.apps.card.v1.Card.Section + * @instance + */ + Section.prototype.widgets = $util.emptyArray; + + /** + * Section collapsible. + * @member {boolean} collapsible + * @memberof google.apps.card.v1.Card.Section + * @instance + */ + Section.prototype.collapsible = false; + + /** + * Section uncollapsibleWidgetsCount. + * @member {number} uncollapsibleWidgetsCount + * @memberof google.apps.card.v1.Card.Section + * @instance + */ + Section.prototype.uncollapsibleWidgetsCount = 0; + + /** + * Creates a new Section instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Card.Section + * @static + * @param {google.apps.card.v1.Card.ISection=} [properties] Properties to set + * @returns {google.apps.card.v1.Card.Section} Section instance + */ + Section.create = function create(properties) { + return new Section(properties); + }; + + /** + * Encodes the specified Section message. Does not implicitly {@link google.apps.card.v1.Card.Section.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Card.Section + * @static + * @param {google.apps.card.v1.Card.ISection} message Section message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Section.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.header); + if (message.widgets != null && message.widgets.length) + for (var i = 0; i < message.widgets.length; ++i) + $root.google.apps.card.v1.Widget.encode(message.widgets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.collapsible != null && Object.hasOwnProperty.call(message, "collapsible")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.collapsible); + if (message.uncollapsibleWidgetsCount != null && Object.hasOwnProperty.call(message, "uncollapsibleWidgetsCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.uncollapsibleWidgetsCount); + return writer; + }; + + /** + * Encodes the specified Section message, length delimited. Does not implicitly {@link google.apps.card.v1.Card.Section.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Card.Section + * @static + * @param {google.apps.card.v1.Card.ISection} message Section message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Section.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Section message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Card.Section + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Card.Section} Section + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Section.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Card.Section(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.header = reader.string(); + break; + } + case 2: { + if (!(message.widgets && message.widgets.length)) + message.widgets = []; + message.widgets.push($root.google.apps.card.v1.Widget.decode(reader, reader.uint32())); + break; + } + case 5: { + message.collapsible = reader.bool(); + break; + } + case 6: { + message.uncollapsibleWidgetsCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Section message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Card.Section + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Card.Section} Section + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Section.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Section message. + * @function verify + * @memberof google.apps.card.v1.Card.Section + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Section.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) + if (!$util.isString(message.header)) + return "header: string expected"; + if (message.widgets != null && message.hasOwnProperty("widgets")) { + if (!Array.isArray(message.widgets)) + return "widgets: array expected"; + for (var i = 0; i < message.widgets.length; ++i) { + var error = $root.google.apps.card.v1.Widget.verify(message.widgets[i]); + if (error) + return "widgets." + error; + } + } + if (message.collapsible != null && message.hasOwnProperty("collapsible")) + if (typeof message.collapsible !== "boolean") + return "collapsible: boolean expected"; + if (message.uncollapsibleWidgetsCount != null && message.hasOwnProperty("uncollapsibleWidgetsCount")) + if (!$util.isInteger(message.uncollapsibleWidgetsCount)) + return "uncollapsibleWidgetsCount: integer expected"; + return null; + }; + + /** + * Creates a Section message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Card.Section + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Card.Section} Section + */ + Section.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Card.Section) + return object; + var message = new $root.google.apps.card.v1.Card.Section(); + if (object.header != null) + message.header = String(object.header); + if (object.widgets) { + if (!Array.isArray(object.widgets)) + throw TypeError(".google.apps.card.v1.Card.Section.widgets: array expected"); + message.widgets = []; + for (var i = 0; i < object.widgets.length; ++i) { + if (typeof object.widgets[i] !== "object") + throw TypeError(".google.apps.card.v1.Card.Section.widgets: object expected"); + message.widgets[i] = $root.google.apps.card.v1.Widget.fromObject(object.widgets[i]); + } + } + if (object.collapsible != null) + message.collapsible = Boolean(object.collapsible); + if (object.uncollapsibleWidgetsCount != null) + message.uncollapsibleWidgetsCount = object.uncollapsibleWidgetsCount | 0; + return message; + }; + + /** + * Creates a plain object from a Section message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Card.Section + * @static + * @param {google.apps.card.v1.Card.Section} message Section + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Section.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.widgets = []; + if (options.defaults) { + object.header = ""; + object.collapsible = false; + object.uncollapsibleWidgetsCount = 0; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = message.header; + if (message.widgets && message.widgets.length) { + object.widgets = []; + for (var j = 0; j < message.widgets.length; ++j) + object.widgets[j] = $root.google.apps.card.v1.Widget.toObject(message.widgets[j], options); + } + if (message.collapsible != null && message.hasOwnProperty("collapsible")) + object.collapsible = message.collapsible; + if (message.uncollapsibleWidgetsCount != null && message.hasOwnProperty("uncollapsibleWidgetsCount")) + object.uncollapsibleWidgetsCount = message.uncollapsibleWidgetsCount; + return object; + }; + + /** + * Converts this Section to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Card.Section + * @instance + * @returns {Object.} JSON object + */ + Section.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Section + * @function getTypeUrl + * @memberof google.apps.card.v1.Card.Section + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Section.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Card.Section"; + }; + + return Section; + })(); + + /** + * DividerStyle enum. + * @name google.apps.card.v1.Card.DividerStyle + * @enum {number} + * @property {number} DIVIDER_STYLE_UNSPECIFIED=0 DIVIDER_STYLE_UNSPECIFIED value + * @property {number} SOLID_DIVIDER=1 SOLID_DIVIDER value + * @property {number} NO_DIVIDER=2 NO_DIVIDER value + */ + Card.DividerStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIVIDER_STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SOLID_DIVIDER"] = 1; + values[valuesById[2] = "NO_DIVIDER"] = 2; + return values; + })(); + + Card.CardAction = (function() { + + /** + * Properties of a CardAction. + * @memberof google.apps.card.v1.Card + * @interface ICardAction + * @property {string|null} [actionLabel] CardAction actionLabel + * @property {google.apps.card.v1.IOnClick|null} [onClick] CardAction onClick + */ + + /** + * Constructs a new CardAction. + * @memberof google.apps.card.v1.Card + * @classdesc Represents a CardAction. + * @implements ICardAction + * @constructor + * @param {google.apps.card.v1.Card.ICardAction=} [properties] Properties to set + */ + function CardAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CardAction actionLabel. + * @member {string} actionLabel + * @memberof google.apps.card.v1.Card.CardAction + * @instance + */ + CardAction.prototype.actionLabel = ""; + + /** + * CardAction onClick. + * @member {google.apps.card.v1.IOnClick|null|undefined} onClick + * @memberof google.apps.card.v1.Card.CardAction + * @instance + */ + CardAction.prototype.onClick = null; + + /** + * Creates a new CardAction instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Card.CardAction + * @static + * @param {google.apps.card.v1.Card.ICardAction=} [properties] Properties to set + * @returns {google.apps.card.v1.Card.CardAction} CardAction instance + */ + CardAction.create = function create(properties) { + return new CardAction(properties); + }; + + /** + * Encodes the specified CardAction message. Does not implicitly {@link google.apps.card.v1.Card.CardAction.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Card.CardAction + * @static + * @param {google.apps.card.v1.Card.ICardAction} message CardAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionLabel != null && Object.hasOwnProperty.call(message, "actionLabel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionLabel); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.apps.card.v1.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CardAction message, length delimited. Does not implicitly {@link google.apps.card.v1.Card.CardAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Card.CardAction + * @static + * @param {google.apps.card.v1.Card.ICardAction} message CardAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CardAction message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Card.CardAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Card.CardAction} CardAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Card.CardAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.actionLabel = reader.string(); + break; + } + case 2: { + message.onClick = $root.google.apps.card.v1.OnClick.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CardAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Card.CardAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Card.CardAction} CardAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CardAction message. + * @function verify + * @memberof google.apps.card.v1.Card.CardAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CardAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionLabel != null && message.hasOwnProperty("actionLabel")) + if (!$util.isString(message.actionLabel)) + return "actionLabel: string expected"; + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.apps.card.v1.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + return null; + }; + + /** + * Creates a CardAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Card.CardAction + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Card.CardAction} CardAction + */ + CardAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Card.CardAction) + return object; + var message = new $root.google.apps.card.v1.Card.CardAction(); + if (object.actionLabel != null) + message.actionLabel = String(object.actionLabel); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.apps.card.v1.Card.CardAction.onClick: object expected"); + message.onClick = $root.google.apps.card.v1.OnClick.fromObject(object.onClick); + } + return message; + }; + + /** + * Creates a plain object from a CardAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Card.CardAction + * @static + * @param {google.apps.card.v1.Card.CardAction} message CardAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CardAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.actionLabel = ""; + object.onClick = null; + } + if (message.actionLabel != null && message.hasOwnProperty("actionLabel")) + object.actionLabel = message.actionLabel; + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.apps.card.v1.OnClick.toObject(message.onClick, options); + return object; + }; + + /** + * Converts this CardAction to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Card.CardAction + * @instance + * @returns {Object.} JSON object + */ + CardAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CardAction + * @function getTypeUrl + * @memberof google.apps.card.v1.Card.CardAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CardAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Card.CardAction"; + }; + + return CardAction; + })(); + + Card.CardFixedFooter = (function() { + + /** + * Properties of a CardFixedFooter. + * @memberof google.apps.card.v1.Card + * @interface ICardFixedFooter + * @property {google.apps.card.v1.IButton|null} [primaryButton] CardFixedFooter primaryButton + * @property {google.apps.card.v1.IButton|null} [secondaryButton] CardFixedFooter secondaryButton + */ + + /** + * Constructs a new CardFixedFooter. + * @memberof google.apps.card.v1.Card + * @classdesc Represents a CardFixedFooter. + * @implements ICardFixedFooter + * @constructor + * @param {google.apps.card.v1.Card.ICardFixedFooter=} [properties] Properties to set + */ + function CardFixedFooter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CardFixedFooter primaryButton. + * @member {google.apps.card.v1.IButton|null|undefined} primaryButton + * @memberof google.apps.card.v1.Card.CardFixedFooter + * @instance + */ + CardFixedFooter.prototype.primaryButton = null; + + /** + * CardFixedFooter secondaryButton. + * @member {google.apps.card.v1.IButton|null|undefined} secondaryButton + * @memberof google.apps.card.v1.Card.CardFixedFooter + * @instance + */ + CardFixedFooter.prototype.secondaryButton = null; + + /** + * Creates a new CardFixedFooter instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Card.CardFixedFooter + * @static + * @param {google.apps.card.v1.Card.ICardFixedFooter=} [properties] Properties to set + * @returns {google.apps.card.v1.Card.CardFixedFooter} CardFixedFooter instance + */ + CardFixedFooter.create = function create(properties) { + return new CardFixedFooter(properties); + }; + + /** + * Encodes the specified CardFixedFooter message. Does not implicitly {@link google.apps.card.v1.Card.CardFixedFooter.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Card.CardFixedFooter + * @static + * @param {google.apps.card.v1.Card.ICardFixedFooter} message CardFixedFooter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardFixedFooter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryButton != null && Object.hasOwnProperty.call(message, "primaryButton")) + $root.google.apps.card.v1.Button.encode(message.primaryButton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.secondaryButton != null && Object.hasOwnProperty.call(message, "secondaryButton")) + $root.google.apps.card.v1.Button.encode(message.secondaryButton, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CardFixedFooter message, length delimited. Does not implicitly {@link google.apps.card.v1.Card.CardFixedFooter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Card.CardFixedFooter + * @static + * @param {google.apps.card.v1.Card.ICardFixedFooter} message CardFixedFooter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardFixedFooter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CardFixedFooter message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Card.CardFixedFooter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Card.CardFixedFooter} CardFixedFooter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardFixedFooter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Card.CardFixedFooter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.primaryButton = $root.google.apps.card.v1.Button.decode(reader, reader.uint32()); + break; + } + case 2: { + message.secondaryButton = $root.google.apps.card.v1.Button.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CardFixedFooter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Card.CardFixedFooter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Card.CardFixedFooter} CardFixedFooter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardFixedFooter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CardFixedFooter message. + * @function verify + * @memberof google.apps.card.v1.Card.CardFixedFooter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CardFixedFooter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryButton != null && message.hasOwnProperty("primaryButton")) { + var error = $root.google.apps.card.v1.Button.verify(message.primaryButton); + if (error) + return "primaryButton." + error; + } + if (message.secondaryButton != null && message.hasOwnProperty("secondaryButton")) { + var error = $root.google.apps.card.v1.Button.verify(message.secondaryButton); + if (error) + return "secondaryButton." + error; + } + return null; + }; + + /** + * Creates a CardFixedFooter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Card.CardFixedFooter + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Card.CardFixedFooter} CardFixedFooter + */ + CardFixedFooter.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Card.CardFixedFooter) + return object; + var message = new $root.google.apps.card.v1.Card.CardFixedFooter(); + if (object.primaryButton != null) { + if (typeof object.primaryButton !== "object") + throw TypeError(".google.apps.card.v1.Card.CardFixedFooter.primaryButton: object expected"); + message.primaryButton = $root.google.apps.card.v1.Button.fromObject(object.primaryButton); + } + if (object.secondaryButton != null) { + if (typeof object.secondaryButton !== "object") + throw TypeError(".google.apps.card.v1.Card.CardFixedFooter.secondaryButton: object expected"); + message.secondaryButton = $root.google.apps.card.v1.Button.fromObject(object.secondaryButton); + } + return message; + }; + + /** + * Creates a plain object from a CardFixedFooter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Card.CardFixedFooter + * @static + * @param {google.apps.card.v1.Card.CardFixedFooter} message CardFixedFooter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CardFixedFooter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.primaryButton = null; + object.secondaryButton = null; + } + if (message.primaryButton != null && message.hasOwnProperty("primaryButton")) + object.primaryButton = $root.google.apps.card.v1.Button.toObject(message.primaryButton, options); + if (message.secondaryButton != null && message.hasOwnProperty("secondaryButton")) + object.secondaryButton = $root.google.apps.card.v1.Button.toObject(message.secondaryButton, options); + return object; + }; + + /** + * Converts this CardFixedFooter to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Card.CardFixedFooter + * @instance + * @returns {Object.} JSON object + */ + CardFixedFooter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CardFixedFooter + * @function getTypeUrl + * @memberof google.apps.card.v1.Card.CardFixedFooter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CardFixedFooter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Card.CardFixedFooter"; + }; + + return CardFixedFooter; + })(); + + /** + * DisplayStyle enum. + * @name google.apps.card.v1.Card.DisplayStyle + * @enum {number} + * @property {number} DISPLAY_STYLE_UNSPECIFIED=0 DISPLAY_STYLE_UNSPECIFIED value + * @property {number} PEEK=1 PEEK value + * @property {number} REPLACE=2 REPLACE value + */ + Card.DisplayStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISPLAY_STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PEEK"] = 1; + values[valuesById[2] = "REPLACE"] = 2; + return values; + })(); + + return Card; + })(); + + v1.Widget = (function() { + + /** + * Properties of a Widget. + * @memberof google.apps.card.v1 + * @interface IWidget + * @property {google.apps.card.v1.ITextParagraph|null} [textParagraph] Widget textParagraph + * @property {google.apps.card.v1.IImage|null} [image] Widget image + * @property {google.apps.card.v1.IDecoratedText|null} [decoratedText] Widget decoratedText + * @property {google.apps.card.v1.IButtonList|null} [buttonList] Widget buttonList + * @property {google.apps.card.v1.ITextInput|null} [textInput] Widget textInput + * @property {google.apps.card.v1.ISelectionInput|null} [selectionInput] Widget selectionInput + * @property {google.apps.card.v1.IDateTimePicker|null} [dateTimePicker] Widget dateTimePicker + * @property {google.apps.card.v1.IDivider|null} [divider] Widget divider + * @property {google.apps.card.v1.IGrid|null} [grid] Widget grid + * @property {google.apps.card.v1.IColumns|null} [columns] Widget columns + * @property {google.apps.card.v1.Widget.HorizontalAlignment|null} [horizontalAlignment] Widget horizontalAlignment + */ + + /** + * Constructs a new Widget. + * @memberof google.apps.card.v1 + * @classdesc Represents a Widget. + * @implements IWidget + * @constructor + * @param {google.apps.card.v1.IWidget=} [properties] Properties to set + */ + function Widget(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Widget textParagraph. + * @member {google.apps.card.v1.ITextParagraph|null|undefined} textParagraph + * @memberof google.apps.card.v1.Widget + * @instance + */ + Widget.prototype.textParagraph = null; + + /** + * Widget image. + * @member {google.apps.card.v1.IImage|null|undefined} image + * @memberof google.apps.card.v1.Widget + * @instance + */ + Widget.prototype.image = null; + + /** + * Widget decoratedText. + * @member {google.apps.card.v1.IDecoratedText|null|undefined} decoratedText + * @memberof google.apps.card.v1.Widget + * @instance + */ + Widget.prototype.decoratedText = null; + + /** + * Widget buttonList. + * @member {google.apps.card.v1.IButtonList|null|undefined} buttonList + * @memberof google.apps.card.v1.Widget + * @instance + */ + Widget.prototype.buttonList = null; + + /** + * Widget textInput. + * @member {google.apps.card.v1.ITextInput|null|undefined} textInput + * @memberof google.apps.card.v1.Widget + * @instance + */ + Widget.prototype.textInput = null; + + /** + * Widget selectionInput. + * @member {google.apps.card.v1.ISelectionInput|null|undefined} selectionInput + * @memberof google.apps.card.v1.Widget + * @instance + */ + Widget.prototype.selectionInput = null; + + /** + * Widget dateTimePicker. + * @member {google.apps.card.v1.IDateTimePicker|null|undefined} dateTimePicker + * @memberof google.apps.card.v1.Widget + * @instance + */ + Widget.prototype.dateTimePicker = null; + + /** + * Widget divider. + * @member {google.apps.card.v1.IDivider|null|undefined} divider + * @memberof google.apps.card.v1.Widget + * @instance + */ + Widget.prototype.divider = null; + + /** + * Widget grid. + * @member {google.apps.card.v1.IGrid|null|undefined} grid + * @memberof google.apps.card.v1.Widget + * @instance + */ + Widget.prototype.grid = null; + + /** + * Widget columns. + * @member {google.apps.card.v1.IColumns|null|undefined} columns + * @memberof google.apps.card.v1.Widget + * @instance + */ + Widget.prototype.columns = null; + + /** + * Widget horizontalAlignment. + * @member {google.apps.card.v1.Widget.HorizontalAlignment} horizontalAlignment + * @memberof google.apps.card.v1.Widget + * @instance + */ + Widget.prototype.horizontalAlignment = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Widget data. + * @member {"textParagraph"|"image"|"decoratedText"|"buttonList"|"textInput"|"selectionInput"|"dateTimePicker"|"divider"|"grid"|"columns"|undefined} data + * @memberof google.apps.card.v1.Widget + * @instance + */ + Object.defineProperty(Widget.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["textParagraph", "image", "decoratedText", "buttonList", "textInput", "selectionInput", "dateTimePicker", "divider", "grid", "columns"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Widget instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Widget + * @static + * @param {google.apps.card.v1.IWidget=} [properties] Properties to set + * @returns {google.apps.card.v1.Widget} Widget instance + */ + Widget.create = function create(properties) { + return new Widget(properties); + }; + + /** + * Encodes the specified Widget message. Does not implicitly {@link google.apps.card.v1.Widget.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Widget + * @static + * @param {google.apps.card.v1.IWidget} message Widget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Widget.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textParagraph != null && Object.hasOwnProperty.call(message, "textParagraph")) + $root.google.apps.card.v1.TextParagraph.encode(message.textParagraph, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.apps.card.v1.Image.encode(message.image, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.decoratedText != null && Object.hasOwnProperty.call(message, "decoratedText")) + $root.google.apps.card.v1.DecoratedText.encode(message.decoratedText, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.buttonList != null && Object.hasOwnProperty.call(message, "buttonList")) + $root.google.apps.card.v1.ButtonList.encode(message.buttonList, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.textInput != null && Object.hasOwnProperty.call(message, "textInput")) + $root.google.apps.card.v1.TextInput.encode(message.textInput, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.selectionInput != null && Object.hasOwnProperty.call(message, "selectionInput")) + $root.google.apps.card.v1.SelectionInput.encode(message.selectionInput, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.dateTimePicker != null && Object.hasOwnProperty.call(message, "dateTimePicker")) + $root.google.apps.card.v1.DateTimePicker.encode(message.dateTimePicker, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.horizontalAlignment != null && Object.hasOwnProperty.call(message, "horizontalAlignment")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.horizontalAlignment); + if (message.divider != null && Object.hasOwnProperty.call(message, "divider")) + $root.google.apps.card.v1.Divider.encode(message.divider, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.grid != null && Object.hasOwnProperty.call(message, "grid")) + $root.google.apps.card.v1.Grid.encode(message.grid, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.columns != null && Object.hasOwnProperty.call(message, "columns")) + $root.google.apps.card.v1.Columns.encode(message.columns, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Widget message, length delimited. Does not implicitly {@link google.apps.card.v1.Widget.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Widget + * @static + * @param {google.apps.card.v1.IWidget} message Widget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Widget.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Widget message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Widget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Widget} Widget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Widget.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Widget(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.textParagraph = $root.google.apps.card.v1.TextParagraph.decode(reader, reader.uint32()); + break; + } + case 2: { + message.image = $root.google.apps.card.v1.Image.decode(reader, reader.uint32()); + break; + } + case 3: { + message.decoratedText = $root.google.apps.card.v1.DecoratedText.decode(reader, reader.uint32()); + break; + } + case 4: { + message.buttonList = $root.google.apps.card.v1.ButtonList.decode(reader, reader.uint32()); + break; + } + case 5: { + message.textInput = $root.google.apps.card.v1.TextInput.decode(reader, reader.uint32()); + break; + } + case 6: { + message.selectionInput = $root.google.apps.card.v1.SelectionInput.decode(reader, reader.uint32()); + break; + } + case 7: { + message.dateTimePicker = $root.google.apps.card.v1.DateTimePicker.decode(reader, reader.uint32()); + break; + } + case 9: { + message.divider = $root.google.apps.card.v1.Divider.decode(reader, reader.uint32()); + break; + } + case 10: { + message.grid = $root.google.apps.card.v1.Grid.decode(reader, reader.uint32()); + break; + } + case 11: { + message.columns = $root.google.apps.card.v1.Columns.decode(reader, reader.uint32()); + break; + } + case 8: { + message.horizontalAlignment = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Widget message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Widget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Widget} Widget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Widget.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Widget message. + * @function verify + * @memberof google.apps.card.v1.Widget + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Widget.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textParagraph != null && message.hasOwnProperty("textParagraph")) { + properties.data = 1; + { + var error = $root.google.apps.card.v1.TextParagraph.verify(message.textParagraph); + if (error) + return "textParagraph." + error; + } + } + if (message.image != null && message.hasOwnProperty("image")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.decoratedText != null && message.hasOwnProperty("decoratedText")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.DecoratedText.verify(message.decoratedText); + if (error) + return "decoratedText." + error; + } + } + if (message.buttonList != null && message.hasOwnProperty("buttonList")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.ButtonList.verify(message.buttonList); + if (error) + return "buttonList." + error; + } + } + if (message.textInput != null && message.hasOwnProperty("textInput")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.TextInput.verify(message.textInput); + if (error) + return "textInput." + error; + } + } + if (message.selectionInput != null && message.hasOwnProperty("selectionInput")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.SelectionInput.verify(message.selectionInput); + if (error) + return "selectionInput." + error; + } + } + if (message.dateTimePicker != null && message.hasOwnProperty("dateTimePicker")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.DateTimePicker.verify(message.dateTimePicker); + if (error) + return "dateTimePicker." + error; + } + } + if (message.divider != null && message.hasOwnProperty("divider")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.Divider.verify(message.divider); + if (error) + return "divider." + error; + } + } + if (message.grid != null && message.hasOwnProperty("grid")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.Grid.verify(message.grid); + if (error) + return "grid." + error; + } + } + if (message.columns != null && message.hasOwnProperty("columns")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.Columns.verify(message.columns); + if (error) + return "columns." + error; + } + } + if (message.horizontalAlignment != null && message.hasOwnProperty("horizontalAlignment")) + switch (message.horizontalAlignment) { + default: + return "horizontalAlignment: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a Widget message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Widget + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Widget} Widget + */ + Widget.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Widget) + return object; + var message = new $root.google.apps.card.v1.Widget(); + if (object.textParagraph != null) { + if (typeof object.textParagraph !== "object") + throw TypeError(".google.apps.card.v1.Widget.textParagraph: object expected"); + message.textParagraph = $root.google.apps.card.v1.TextParagraph.fromObject(object.textParagraph); + } + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.apps.card.v1.Widget.image: object expected"); + message.image = $root.google.apps.card.v1.Image.fromObject(object.image); + } + if (object.decoratedText != null) { + if (typeof object.decoratedText !== "object") + throw TypeError(".google.apps.card.v1.Widget.decoratedText: object expected"); + message.decoratedText = $root.google.apps.card.v1.DecoratedText.fromObject(object.decoratedText); + } + if (object.buttonList != null) { + if (typeof object.buttonList !== "object") + throw TypeError(".google.apps.card.v1.Widget.buttonList: object expected"); + message.buttonList = $root.google.apps.card.v1.ButtonList.fromObject(object.buttonList); + } + if (object.textInput != null) { + if (typeof object.textInput !== "object") + throw TypeError(".google.apps.card.v1.Widget.textInput: object expected"); + message.textInput = $root.google.apps.card.v1.TextInput.fromObject(object.textInput); + } + if (object.selectionInput != null) { + if (typeof object.selectionInput !== "object") + throw TypeError(".google.apps.card.v1.Widget.selectionInput: object expected"); + message.selectionInput = $root.google.apps.card.v1.SelectionInput.fromObject(object.selectionInput); + } + if (object.dateTimePicker != null) { + if (typeof object.dateTimePicker !== "object") + throw TypeError(".google.apps.card.v1.Widget.dateTimePicker: object expected"); + message.dateTimePicker = $root.google.apps.card.v1.DateTimePicker.fromObject(object.dateTimePicker); + } + if (object.divider != null) { + if (typeof object.divider !== "object") + throw TypeError(".google.apps.card.v1.Widget.divider: object expected"); + message.divider = $root.google.apps.card.v1.Divider.fromObject(object.divider); + } + if (object.grid != null) { + if (typeof object.grid !== "object") + throw TypeError(".google.apps.card.v1.Widget.grid: object expected"); + message.grid = $root.google.apps.card.v1.Grid.fromObject(object.grid); + } + if (object.columns != null) { + if (typeof object.columns !== "object") + throw TypeError(".google.apps.card.v1.Widget.columns: object expected"); + message.columns = $root.google.apps.card.v1.Columns.fromObject(object.columns); + } + switch (object.horizontalAlignment) { + default: + if (typeof object.horizontalAlignment === "number") { + message.horizontalAlignment = object.horizontalAlignment; + break; + } + break; + case "HORIZONTAL_ALIGNMENT_UNSPECIFIED": + case 0: + message.horizontalAlignment = 0; + break; + case "START": + case 1: + message.horizontalAlignment = 1; + break; + case "CENTER": + case 2: + message.horizontalAlignment = 2; + break; + case "END": + case 3: + message.horizontalAlignment = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Widget message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Widget + * @static + * @param {google.apps.card.v1.Widget} message Widget + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Widget.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.horizontalAlignment = options.enums === String ? "HORIZONTAL_ALIGNMENT_UNSPECIFIED" : 0; + if (message.textParagraph != null && message.hasOwnProperty("textParagraph")) { + object.textParagraph = $root.google.apps.card.v1.TextParagraph.toObject(message.textParagraph, options); + if (options.oneofs) + object.data = "textParagraph"; + } + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.apps.card.v1.Image.toObject(message.image, options); + if (options.oneofs) + object.data = "image"; + } + if (message.decoratedText != null && message.hasOwnProperty("decoratedText")) { + object.decoratedText = $root.google.apps.card.v1.DecoratedText.toObject(message.decoratedText, options); + if (options.oneofs) + object.data = "decoratedText"; + } + if (message.buttonList != null && message.hasOwnProperty("buttonList")) { + object.buttonList = $root.google.apps.card.v1.ButtonList.toObject(message.buttonList, options); + if (options.oneofs) + object.data = "buttonList"; + } + if (message.textInput != null && message.hasOwnProperty("textInput")) { + object.textInput = $root.google.apps.card.v1.TextInput.toObject(message.textInput, options); + if (options.oneofs) + object.data = "textInput"; + } + if (message.selectionInput != null && message.hasOwnProperty("selectionInput")) { + object.selectionInput = $root.google.apps.card.v1.SelectionInput.toObject(message.selectionInput, options); + if (options.oneofs) + object.data = "selectionInput"; + } + if (message.dateTimePicker != null && message.hasOwnProperty("dateTimePicker")) { + object.dateTimePicker = $root.google.apps.card.v1.DateTimePicker.toObject(message.dateTimePicker, options); + if (options.oneofs) + object.data = "dateTimePicker"; + } + if (message.horizontalAlignment != null && message.hasOwnProperty("horizontalAlignment")) + object.horizontalAlignment = options.enums === String ? $root.google.apps.card.v1.Widget.HorizontalAlignment[message.horizontalAlignment] === undefined ? message.horizontalAlignment : $root.google.apps.card.v1.Widget.HorizontalAlignment[message.horizontalAlignment] : message.horizontalAlignment; + if (message.divider != null && message.hasOwnProperty("divider")) { + object.divider = $root.google.apps.card.v1.Divider.toObject(message.divider, options); + if (options.oneofs) + object.data = "divider"; + } + if (message.grid != null && message.hasOwnProperty("grid")) { + object.grid = $root.google.apps.card.v1.Grid.toObject(message.grid, options); + if (options.oneofs) + object.data = "grid"; + } + if (message.columns != null && message.hasOwnProperty("columns")) { + object.columns = $root.google.apps.card.v1.Columns.toObject(message.columns, options); + if (options.oneofs) + object.data = "columns"; + } + return object; + }; + + /** + * Converts this Widget to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Widget + * @instance + * @returns {Object.} JSON object + */ + Widget.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Widget + * @function getTypeUrl + * @memberof google.apps.card.v1.Widget + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Widget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Widget"; + }; + + /** + * ImageType enum. + * @name google.apps.card.v1.Widget.ImageType + * @enum {number} + * @property {number} SQUARE=0 SQUARE value + * @property {number} CIRCLE=1 CIRCLE value + */ + Widget.ImageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SQUARE"] = 0; + values[valuesById[1] = "CIRCLE"] = 1; + return values; + })(); + + /** + * HorizontalAlignment enum. + * @name google.apps.card.v1.Widget.HorizontalAlignment + * @enum {number} + * @property {number} HORIZONTAL_ALIGNMENT_UNSPECIFIED=0 HORIZONTAL_ALIGNMENT_UNSPECIFIED value + * @property {number} START=1 START value + * @property {number} CENTER=2 CENTER value + * @property {number} END=3 END value + */ + Widget.HorizontalAlignment = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HORIZONTAL_ALIGNMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "START"] = 1; + values[valuesById[2] = "CENTER"] = 2; + values[valuesById[3] = "END"] = 3; + return values; + })(); + + return Widget; + })(); + + v1.TextParagraph = (function() { + + /** + * Properties of a TextParagraph. + * @memberof google.apps.card.v1 + * @interface ITextParagraph + * @property {string|null} [text] TextParagraph text + */ + + /** + * Constructs a new TextParagraph. + * @memberof google.apps.card.v1 + * @classdesc Represents a TextParagraph. + * @implements ITextParagraph + * @constructor + * @param {google.apps.card.v1.ITextParagraph=} [properties] Properties to set + */ + function TextParagraph(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextParagraph text. + * @member {string} text + * @memberof google.apps.card.v1.TextParagraph + * @instance + */ + TextParagraph.prototype.text = ""; + + /** + * Creates a new TextParagraph instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.TextParagraph + * @static + * @param {google.apps.card.v1.ITextParagraph=} [properties] Properties to set + * @returns {google.apps.card.v1.TextParagraph} TextParagraph instance + */ + TextParagraph.create = function create(properties) { + return new TextParagraph(properties); + }; + + /** + * Encodes the specified TextParagraph message. Does not implicitly {@link google.apps.card.v1.TextParagraph.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.TextParagraph + * @static + * @param {google.apps.card.v1.ITextParagraph} message TextParagraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextParagraph.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; + + /** + * Encodes the specified TextParagraph message, length delimited. Does not implicitly {@link google.apps.card.v1.TextParagraph.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.TextParagraph + * @static + * @param {google.apps.card.v1.ITextParagraph} message TextParagraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextParagraph.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextParagraph message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.TextParagraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.TextParagraph} TextParagraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextParagraph.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.TextParagraph(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextParagraph message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.TextParagraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.TextParagraph} TextParagraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextParagraph.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextParagraph message. + * @function verify + * @memberof google.apps.card.v1.TextParagraph + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextParagraph.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TextParagraph message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.TextParagraph + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.TextParagraph} TextParagraph + */ + TextParagraph.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.TextParagraph) + return object; + var message = new $root.google.apps.card.v1.TextParagraph(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TextParagraph message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.TextParagraph + * @static + * @param {google.apps.card.v1.TextParagraph} message TextParagraph + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextParagraph.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TextParagraph to JSON. + * @function toJSON + * @memberof google.apps.card.v1.TextParagraph + * @instance + * @returns {Object.} JSON object + */ + TextParagraph.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextParagraph + * @function getTypeUrl + * @memberof google.apps.card.v1.TextParagraph + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextParagraph.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.TextParagraph"; + }; + + return TextParagraph; + })(); + + v1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.apps.card.v1 + * @interface IImage + * @property {string|null} [imageUrl] Image imageUrl + * @property {google.apps.card.v1.IOnClick|null} [onClick] Image onClick + * @property {string|null} [altText] Image altText + */ + + /** + * Constructs a new Image. + * @memberof google.apps.card.v1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.apps.card.v1.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image imageUrl. + * @member {string} imageUrl + * @memberof google.apps.card.v1.Image + * @instance + */ + Image.prototype.imageUrl = ""; + + /** + * Image onClick. + * @member {google.apps.card.v1.IOnClick|null|undefined} onClick + * @memberof google.apps.card.v1.Image + * @instance + */ + Image.prototype.onClick = null; + + /** + * Image altText. + * @member {string} altText + * @memberof google.apps.card.v1.Image + * @instance + */ + Image.prototype.altText = ""; + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Image + * @static + * @param {google.apps.card.v1.IImage=} [properties] Properties to set + * @returns {google.apps.card.v1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.apps.card.v1.Image.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Image + * @static + * @param {google.apps.card.v1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageUrl != null && Object.hasOwnProperty.call(message, "imageUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUrl); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.apps.card.v1.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.altText != null && Object.hasOwnProperty.call(message, "altText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.altText); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.apps.card.v1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Image + * @static + * @param {google.apps.card.v1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageUrl = reader.string(); + break; + } + case 2: { + message.onClick = $root.google.apps.card.v1.OnClick.decode(reader, reader.uint32()); + break; + } + case 3: { + message.altText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.apps.card.v1.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) + if (!$util.isString(message.imageUrl)) + return "imageUrl: string expected"; + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.apps.card.v1.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + if (message.altText != null && message.hasOwnProperty("altText")) + if (!$util.isString(message.altText)) + return "altText: string expected"; + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Image) + return object; + var message = new $root.google.apps.card.v1.Image(); + if (object.imageUrl != null) + message.imageUrl = String(object.imageUrl); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.apps.card.v1.Image.onClick: object expected"); + message.onClick = $root.google.apps.card.v1.OnClick.fromObject(object.onClick); + } + if (object.altText != null) + message.altText = String(object.altText); + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Image + * @static + * @param {google.apps.card.v1.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.imageUrl = ""; + object.onClick = null; + object.altText = ""; + } + if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) + object.imageUrl = message.imageUrl; + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.apps.card.v1.OnClick.toObject(message.onClick, options); + if (message.altText != null && message.hasOwnProperty("altText")) + object.altText = message.altText; + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof google.apps.card.v1.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Image"; + }; + + return Image; + })(); + + v1.Divider = (function() { + + /** + * Properties of a Divider. + * @memberof google.apps.card.v1 + * @interface IDivider + */ + + /** + * Constructs a new Divider. + * @memberof google.apps.card.v1 + * @classdesc Represents a Divider. + * @implements IDivider + * @constructor + * @param {google.apps.card.v1.IDivider=} [properties] Properties to set + */ + function Divider(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Divider instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Divider + * @static + * @param {google.apps.card.v1.IDivider=} [properties] Properties to set + * @returns {google.apps.card.v1.Divider} Divider instance + */ + Divider.create = function create(properties) { + return new Divider(properties); + }; + + /** + * Encodes the specified Divider message. Does not implicitly {@link google.apps.card.v1.Divider.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Divider + * @static + * @param {google.apps.card.v1.IDivider} message Divider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Divider.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Divider message, length delimited. Does not implicitly {@link google.apps.card.v1.Divider.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Divider + * @static + * @param {google.apps.card.v1.IDivider} message Divider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Divider.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Divider message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Divider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Divider} Divider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Divider.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Divider(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Divider message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Divider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Divider} Divider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Divider.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Divider message. + * @function verify + * @memberof google.apps.card.v1.Divider + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Divider.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Divider message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Divider + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Divider} Divider + */ + Divider.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Divider) + return object; + return new $root.google.apps.card.v1.Divider(); + }; + + /** + * Creates a plain object from a Divider message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Divider + * @static + * @param {google.apps.card.v1.Divider} message Divider + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Divider.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Divider to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Divider + * @instance + * @returns {Object.} JSON object + */ + Divider.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Divider + * @function getTypeUrl + * @memberof google.apps.card.v1.Divider + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Divider.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Divider"; + }; + + return Divider; + })(); + + v1.DecoratedText = (function() { + + /** + * Properties of a DecoratedText. + * @memberof google.apps.card.v1 + * @interface IDecoratedText + * @property {google.apps.card.v1.IIcon|null} [icon] DecoratedText icon + * @property {google.apps.card.v1.IIcon|null} [startIcon] DecoratedText startIcon + * @property {string|null} [topLabel] DecoratedText topLabel + * @property {string|null} [text] DecoratedText text + * @property {boolean|null} [wrapText] DecoratedText wrapText + * @property {string|null} [bottomLabel] DecoratedText bottomLabel + * @property {google.apps.card.v1.IOnClick|null} [onClick] DecoratedText onClick + * @property {google.apps.card.v1.IButton|null} [button] DecoratedText button + * @property {google.apps.card.v1.DecoratedText.ISwitchControl|null} [switchControl] DecoratedText switchControl + * @property {google.apps.card.v1.IIcon|null} [endIcon] DecoratedText endIcon + */ + + /** + * Constructs a new DecoratedText. + * @memberof google.apps.card.v1 + * @classdesc Represents a DecoratedText. + * @implements IDecoratedText + * @constructor + * @param {google.apps.card.v1.IDecoratedText=} [properties] Properties to set + */ + function DecoratedText(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecoratedText icon. + * @member {google.apps.card.v1.IIcon|null|undefined} icon + * @memberof google.apps.card.v1.DecoratedText + * @instance + */ + DecoratedText.prototype.icon = null; + + /** + * DecoratedText startIcon. + * @member {google.apps.card.v1.IIcon|null|undefined} startIcon + * @memberof google.apps.card.v1.DecoratedText + * @instance + */ + DecoratedText.prototype.startIcon = null; + + /** + * DecoratedText topLabel. + * @member {string} topLabel + * @memberof google.apps.card.v1.DecoratedText + * @instance + */ + DecoratedText.prototype.topLabel = ""; + + /** + * DecoratedText text. + * @member {string} text + * @memberof google.apps.card.v1.DecoratedText + * @instance + */ + DecoratedText.prototype.text = ""; + + /** + * DecoratedText wrapText. + * @member {boolean} wrapText + * @memberof google.apps.card.v1.DecoratedText + * @instance + */ + DecoratedText.prototype.wrapText = false; + + /** + * DecoratedText bottomLabel. + * @member {string} bottomLabel + * @memberof google.apps.card.v1.DecoratedText + * @instance + */ + DecoratedText.prototype.bottomLabel = ""; + + /** + * DecoratedText onClick. + * @member {google.apps.card.v1.IOnClick|null|undefined} onClick + * @memberof google.apps.card.v1.DecoratedText + * @instance + */ + DecoratedText.prototype.onClick = null; + + /** + * DecoratedText button. + * @member {google.apps.card.v1.IButton|null|undefined} button + * @memberof google.apps.card.v1.DecoratedText + * @instance + */ + DecoratedText.prototype.button = null; + + /** + * DecoratedText switchControl. + * @member {google.apps.card.v1.DecoratedText.ISwitchControl|null|undefined} switchControl + * @memberof google.apps.card.v1.DecoratedText + * @instance + */ + DecoratedText.prototype.switchControl = null; + + /** + * DecoratedText endIcon. + * @member {google.apps.card.v1.IIcon|null|undefined} endIcon + * @memberof google.apps.card.v1.DecoratedText + * @instance + */ + DecoratedText.prototype.endIcon = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DecoratedText control. + * @member {"button"|"switchControl"|"endIcon"|undefined} control + * @memberof google.apps.card.v1.DecoratedText + * @instance + */ + Object.defineProperty(DecoratedText.prototype, "control", { + get: $util.oneOfGetter($oneOfFields = ["button", "switchControl", "endIcon"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DecoratedText instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.DecoratedText + * @static + * @param {google.apps.card.v1.IDecoratedText=} [properties] Properties to set + * @returns {google.apps.card.v1.DecoratedText} DecoratedText instance + */ + DecoratedText.create = function create(properties) { + return new DecoratedText(properties); + }; + + /** + * Encodes the specified DecoratedText message. Does not implicitly {@link google.apps.card.v1.DecoratedText.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.DecoratedText + * @static + * @param {google.apps.card.v1.IDecoratedText} message DecoratedText message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecoratedText.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) + $root.google.apps.card.v1.Icon.encode(message.icon, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.topLabel != null && Object.hasOwnProperty.call(message, "topLabel")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.topLabel); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.text); + if (message.wrapText != null && Object.hasOwnProperty.call(message, "wrapText")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.wrapText); + if (message.bottomLabel != null && Object.hasOwnProperty.call(message, "bottomLabel")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.bottomLabel); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.apps.card.v1.OnClick.encode(message.onClick, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.button != null && Object.hasOwnProperty.call(message, "button")) + $root.google.apps.card.v1.Button.encode(message.button, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.switchControl != null && Object.hasOwnProperty.call(message, "switchControl")) + $root.google.apps.card.v1.DecoratedText.SwitchControl.encode(message.switchControl, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.endIcon != null && Object.hasOwnProperty.call(message, "endIcon")) + $root.google.apps.card.v1.Icon.encode(message.endIcon, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.startIcon != null && Object.hasOwnProperty.call(message, "startIcon")) + $root.google.apps.card.v1.Icon.encode(message.startIcon, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DecoratedText message, length delimited. Does not implicitly {@link google.apps.card.v1.DecoratedText.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.DecoratedText + * @static + * @param {google.apps.card.v1.IDecoratedText} message DecoratedText message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecoratedText.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecoratedText message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.DecoratedText + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.DecoratedText} DecoratedText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecoratedText.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.DecoratedText(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.icon = $root.google.apps.card.v1.Icon.decode(reader, reader.uint32()); + break; + } + case 12: { + message.startIcon = $root.google.apps.card.v1.Icon.decode(reader, reader.uint32()); + break; + } + case 3: { + message.topLabel = reader.string(); + break; + } + case 4: { + message.text = reader.string(); + break; + } + case 5: { + message.wrapText = reader.bool(); + break; + } + case 6: { + message.bottomLabel = reader.string(); + break; + } + case 7: { + message.onClick = $root.google.apps.card.v1.OnClick.decode(reader, reader.uint32()); + break; + } + case 8: { + message.button = $root.google.apps.card.v1.Button.decode(reader, reader.uint32()); + break; + } + case 9: { + message.switchControl = $root.google.apps.card.v1.DecoratedText.SwitchControl.decode(reader, reader.uint32()); + break; + } + case 11: { + message.endIcon = $root.google.apps.card.v1.Icon.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DecoratedText message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.DecoratedText + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.DecoratedText} DecoratedText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecoratedText.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecoratedText message. + * @function verify + * @memberof google.apps.card.v1.DecoratedText + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecoratedText.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.icon != null && message.hasOwnProperty("icon")) { + var error = $root.google.apps.card.v1.Icon.verify(message.icon); + if (error) + return "icon." + error; + } + if (message.startIcon != null && message.hasOwnProperty("startIcon")) { + var error = $root.google.apps.card.v1.Icon.verify(message.startIcon); + if (error) + return "startIcon." + error; + } + if (message.topLabel != null && message.hasOwnProperty("topLabel")) + if (!$util.isString(message.topLabel)) + return "topLabel: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.wrapText != null && message.hasOwnProperty("wrapText")) + if (typeof message.wrapText !== "boolean") + return "wrapText: boolean expected"; + if (message.bottomLabel != null && message.hasOwnProperty("bottomLabel")) + if (!$util.isString(message.bottomLabel)) + return "bottomLabel: string expected"; + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.apps.card.v1.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + if (message.button != null && message.hasOwnProperty("button")) { + properties.control = 1; + { + var error = $root.google.apps.card.v1.Button.verify(message.button); + if (error) + return "button." + error; + } + } + if (message.switchControl != null && message.hasOwnProperty("switchControl")) { + if (properties.control === 1) + return "control: multiple values"; + properties.control = 1; + { + var error = $root.google.apps.card.v1.DecoratedText.SwitchControl.verify(message.switchControl); + if (error) + return "switchControl." + error; + } + } + if (message.endIcon != null && message.hasOwnProperty("endIcon")) { + if (properties.control === 1) + return "control: multiple values"; + properties.control = 1; + { + var error = $root.google.apps.card.v1.Icon.verify(message.endIcon); + if (error) + return "endIcon." + error; + } + } + return null; + }; + + /** + * Creates a DecoratedText message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.DecoratedText + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.DecoratedText} DecoratedText + */ + DecoratedText.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.DecoratedText) + return object; + var message = new $root.google.apps.card.v1.DecoratedText(); + if (object.icon != null) { + if (typeof object.icon !== "object") + throw TypeError(".google.apps.card.v1.DecoratedText.icon: object expected"); + message.icon = $root.google.apps.card.v1.Icon.fromObject(object.icon); + } + if (object.startIcon != null) { + if (typeof object.startIcon !== "object") + throw TypeError(".google.apps.card.v1.DecoratedText.startIcon: object expected"); + message.startIcon = $root.google.apps.card.v1.Icon.fromObject(object.startIcon); + } + if (object.topLabel != null) + message.topLabel = String(object.topLabel); + if (object.text != null) + message.text = String(object.text); + if (object.wrapText != null) + message.wrapText = Boolean(object.wrapText); + if (object.bottomLabel != null) + message.bottomLabel = String(object.bottomLabel); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.apps.card.v1.DecoratedText.onClick: object expected"); + message.onClick = $root.google.apps.card.v1.OnClick.fromObject(object.onClick); + } + if (object.button != null) { + if (typeof object.button !== "object") + throw TypeError(".google.apps.card.v1.DecoratedText.button: object expected"); + message.button = $root.google.apps.card.v1.Button.fromObject(object.button); + } + if (object.switchControl != null) { + if (typeof object.switchControl !== "object") + throw TypeError(".google.apps.card.v1.DecoratedText.switchControl: object expected"); + message.switchControl = $root.google.apps.card.v1.DecoratedText.SwitchControl.fromObject(object.switchControl); + } + if (object.endIcon != null) { + if (typeof object.endIcon !== "object") + throw TypeError(".google.apps.card.v1.DecoratedText.endIcon: object expected"); + message.endIcon = $root.google.apps.card.v1.Icon.fromObject(object.endIcon); + } + return message; + }; + + /** + * Creates a plain object from a DecoratedText message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.DecoratedText + * @static + * @param {google.apps.card.v1.DecoratedText} message DecoratedText + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecoratedText.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.icon = null; + object.topLabel = ""; + object.text = ""; + object.wrapText = false; + object.bottomLabel = ""; + object.onClick = null; + object.startIcon = null; + } + if (message.icon != null && message.hasOwnProperty("icon")) + object.icon = $root.google.apps.card.v1.Icon.toObject(message.icon, options); + if (message.topLabel != null && message.hasOwnProperty("topLabel")) + object.topLabel = message.topLabel; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.wrapText != null && message.hasOwnProperty("wrapText")) + object.wrapText = message.wrapText; + if (message.bottomLabel != null && message.hasOwnProperty("bottomLabel")) + object.bottomLabel = message.bottomLabel; + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.apps.card.v1.OnClick.toObject(message.onClick, options); + if (message.button != null && message.hasOwnProperty("button")) { + object.button = $root.google.apps.card.v1.Button.toObject(message.button, options); + if (options.oneofs) + object.control = "button"; + } + if (message.switchControl != null && message.hasOwnProperty("switchControl")) { + object.switchControl = $root.google.apps.card.v1.DecoratedText.SwitchControl.toObject(message.switchControl, options); + if (options.oneofs) + object.control = "switchControl"; + } + if (message.endIcon != null && message.hasOwnProperty("endIcon")) { + object.endIcon = $root.google.apps.card.v1.Icon.toObject(message.endIcon, options); + if (options.oneofs) + object.control = "endIcon"; + } + if (message.startIcon != null && message.hasOwnProperty("startIcon")) + object.startIcon = $root.google.apps.card.v1.Icon.toObject(message.startIcon, options); + return object; + }; + + /** + * Converts this DecoratedText to JSON. + * @function toJSON + * @memberof google.apps.card.v1.DecoratedText + * @instance + * @returns {Object.} JSON object + */ + DecoratedText.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DecoratedText + * @function getTypeUrl + * @memberof google.apps.card.v1.DecoratedText + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DecoratedText.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.DecoratedText"; + }; + + DecoratedText.SwitchControl = (function() { + + /** + * Properties of a SwitchControl. + * @memberof google.apps.card.v1.DecoratedText + * @interface ISwitchControl + * @property {string|null} [name] SwitchControl name + * @property {string|null} [value] SwitchControl value + * @property {boolean|null} [selected] SwitchControl selected + * @property {google.apps.card.v1.IAction|null} [onChangeAction] SwitchControl onChangeAction + * @property {google.apps.card.v1.DecoratedText.SwitchControl.ControlType|null} [controlType] SwitchControl controlType + */ + + /** + * Constructs a new SwitchControl. + * @memberof google.apps.card.v1.DecoratedText + * @classdesc Represents a SwitchControl. + * @implements ISwitchControl + * @constructor + * @param {google.apps.card.v1.DecoratedText.ISwitchControl=} [properties] Properties to set + */ + function SwitchControl(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SwitchControl name. + * @member {string} name + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @instance + */ + SwitchControl.prototype.name = ""; + + /** + * SwitchControl value. + * @member {string} value + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @instance + */ + SwitchControl.prototype.value = ""; + + /** + * SwitchControl selected. + * @member {boolean} selected + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @instance + */ + SwitchControl.prototype.selected = false; + + /** + * SwitchControl onChangeAction. + * @member {google.apps.card.v1.IAction|null|undefined} onChangeAction + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @instance + */ + SwitchControl.prototype.onChangeAction = null; + + /** + * SwitchControl controlType. + * @member {google.apps.card.v1.DecoratedText.SwitchControl.ControlType} controlType + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @instance + */ + SwitchControl.prototype.controlType = 0; + + /** + * Creates a new SwitchControl instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @static + * @param {google.apps.card.v1.DecoratedText.ISwitchControl=} [properties] Properties to set + * @returns {google.apps.card.v1.DecoratedText.SwitchControl} SwitchControl instance + */ + SwitchControl.create = function create(properties) { + return new SwitchControl(properties); + }; + + /** + * Encodes the specified SwitchControl message. Does not implicitly {@link google.apps.card.v1.DecoratedText.SwitchControl.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @static + * @param {google.apps.card.v1.DecoratedText.ISwitchControl} message SwitchControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SwitchControl.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.selected != null && Object.hasOwnProperty.call(message, "selected")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.selected); + if (message.onChangeAction != null && Object.hasOwnProperty.call(message, "onChangeAction")) + $root.google.apps.card.v1.Action.encode(message.onChangeAction, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.controlType != null && Object.hasOwnProperty.call(message, "controlType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.controlType); + return writer; + }; + + /** + * Encodes the specified SwitchControl message, length delimited. Does not implicitly {@link google.apps.card.v1.DecoratedText.SwitchControl.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @static + * @param {google.apps.card.v1.DecoratedText.ISwitchControl} message SwitchControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SwitchControl.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SwitchControl message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.DecoratedText.SwitchControl} SwitchControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SwitchControl.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.DecoratedText.SwitchControl(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + case 3: { + message.selected = reader.bool(); + break; + } + case 4: { + message.onChangeAction = $root.google.apps.card.v1.Action.decode(reader, reader.uint32()); + break; + } + case 5: { + message.controlType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SwitchControl message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.DecoratedText.SwitchControl} SwitchControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SwitchControl.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SwitchControl message. + * @function verify + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SwitchControl.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.selected != null && message.hasOwnProperty("selected")) + if (typeof message.selected !== "boolean") + return "selected: boolean expected"; + if (message.onChangeAction != null && message.hasOwnProperty("onChangeAction")) { + var error = $root.google.apps.card.v1.Action.verify(message.onChangeAction); + if (error) + return "onChangeAction." + error; + } + if (message.controlType != null && message.hasOwnProperty("controlType")) + switch (message.controlType) { + default: + return "controlType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a SwitchControl message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.DecoratedText.SwitchControl} SwitchControl + */ + SwitchControl.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.DecoratedText.SwitchControl) + return object; + var message = new $root.google.apps.card.v1.DecoratedText.SwitchControl(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + if (object.selected != null) + message.selected = Boolean(object.selected); + if (object.onChangeAction != null) { + if (typeof object.onChangeAction !== "object") + throw TypeError(".google.apps.card.v1.DecoratedText.SwitchControl.onChangeAction: object expected"); + message.onChangeAction = $root.google.apps.card.v1.Action.fromObject(object.onChangeAction); + } + switch (object.controlType) { + default: + if (typeof object.controlType === "number") { + message.controlType = object.controlType; + break; + } + break; + case "SWITCH": + case 0: + message.controlType = 0; + break; + case "CHECKBOX": + case 1: + message.controlType = 1; + break; + case "CHECK_BOX": + case 2: + message.controlType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SwitchControl message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @static + * @param {google.apps.card.v1.DecoratedText.SwitchControl} message SwitchControl + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SwitchControl.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + object.selected = false; + object.onChangeAction = null; + object.controlType = options.enums === String ? "SWITCH" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.selected != null && message.hasOwnProperty("selected")) + object.selected = message.selected; + if (message.onChangeAction != null && message.hasOwnProperty("onChangeAction")) + object.onChangeAction = $root.google.apps.card.v1.Action.toObject(message.onChangeAction, options); + if (message.controlType != null && message.hasOwnProperty("controlType")) + object.controlType = options.enums === String ? $root.google.apps.card.v1.DecoratedText.SwitchControl.ControlType[message.controlType] === undefined ? message.controlType : $root.google.apps.card.v1.DecoratedText.SwitchControl.ControlType[message.controlType] : message.controlType; + return object; + }; + + /** + * Converts this SwitchControl to JSON. + * @function toJSON + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @instance + * @returns {Object.} JSON object + */ + SwitchControl.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SwitchControl + * @function getTypeUrl + * @memberof google.apps.card.v1.DecoratedText.SwitchControl + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SwitchControl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.DecoratedText.SwitchControl"; + }; + + /** + * ControlType enum. + * @name google.apps.card.v1.DecoratedText.SwitchControl.ControlType + * @enum {number} + * @property {number} SWITCH=0 SWITCH value + * @property {number} CHECKBOX=1 CHECKBOX value + * @property {number} CHECK_BOX=2 CHECK_BOX value + */ + SwitchControl.ControlType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SWITCH"] = 0; + values[valuesById[1] = "CHECKBOX"] = 1; + values[valuesById[2] = "CHECK_BOX"] = 2; + return values; + })(); + + return SwitchControl; + })(); + + return DecoratedText; + })(); + + v1.TextInput = (function() { + + /** + * Properties of a TextInput. + * @memberof google.apps.card.v1 + * @interface ITextInput + * @property {string|null} [name] TextInput name + * @property {string|null} [label] TextInput label + * @property {string|null} [hintText] TextInput hintText + * @property {string|null} [value] TextInput value + * @property {google.apps.card.v1.TextInput.Type|null} [type] TextInput type + * @property {google.apps.card.v1.IAction|null} [onChangeAction] TextInput onChangeAction + * @property {google.apps.card.v1.ISuggestions|null} [initialSuggestions] TextInput initialSuggestions + * @property {google.apps.card.v1.IAction|null} [autoCompleteAction] TextInput autoCompleteAction + * @property {string|null} [placeholderText] TextInput placeholderText + */ + + /** + * Constructs a new TextInput. + * @memberof google.apps.card.v1 + * @classdesc Represents a TextInput. + * @implements ITextInput + * @constructor + * @param {google.apps.card.v1.ITextInput=} [properties] Properties to set + */ + function TextInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextInput name. + * @member {string} name + * @memberof google.apps.card.v1.TextInput + * @instance + */ + TextInput.prototype.name = ""; + + /** + * TextInput label. + * @member {string} label + * @memberof google.apps.card.v1.TextInput + * @instance + */ + TextInput.prototype.label = ""; + + /** + * TextInput hintText. + * @member {string} hintText + * @memberof google.apps.card.v1.TextInput + * @instance + */ + TextInput.prototype.hintText = ""; + + /** + * TextInput value. + * @member {string} value + * @memberof google.apps.card.v1.TextInput + * @instance + */ + TextInput.prototype.value = ""; + + /** + * TextInput type. + * @member {google.apps.card.v1.TextInput.Type} type + * @memberof google.apps.card.v1.TextInput + * @instance + */ + TextInput.prototype.type = 0; + + /** + * TextInput onChangeAction. + * @member {google.apps.card.v1.IAction|null|undefined} onChangeAction + * @memberof google.apps.card.v1.TextInput + * @instance + */ + TextInput.prototype.onChangeAction = null; + + /** + * TextInput initialSuggestions. + * @member {google.apps.card.v1.ISuggestions|null|undefined} initialSuggestions + * @memberof google.apps.card.v1.TextInput + * @instance + */ + TextInput.prototype.initialSuggestions = null; + + /** + * TextInput autoCompleteAction. + * @member {google.apps.card.v1.IAction|null|undefined} autoCompleteAction + * @memberof google.apps.card.v1.TextInput + * @instance + */ + TextInput.prototype.autoCompleteAction = null; + + /** + * TextInput placeholderText. + * @member {string} placeholderText + * @memberof google.apps.card.v1.TextInput + * @instance + */ + TextInput.prototype.placeholderText = ""; + + /** + * Creates a new TextInput instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.TextInput + * @static + * @param {google.apps.card.v1.ITextInput=} [properties] Properties to set + * @returns {google.apps.card.v1.TextInput} TextInput instance + */ + TextInput.create = function create(properties) { + return new TextInput(properties); + }; + + /** + * Encodes the specified TextInput message. Does not implicitly {@link google.apps.card.v1.TextInput.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.TextInput + * @static + * @param {google.apps.card.v1.ITextInput} message TextInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.hintText != null && Object.hasOwnProperty.call(message, "hintText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.hintText); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.value); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.onChangeAction != null && Object.hasOwnProperty.call(message, "onChangeAction")) + $root.google.apps.card.v1.Action.encode(message.onChangeAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.initialSuggestions != null && Object.hasOwnProperty.call(message, "initialSuggestions")) + $root.google.apps.card.v1.Suggestions.encode(message.initialSuggestions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.autoCompleteAction != null && Object.hasOwnProperty.call(message, "autoCompleteAction")) + $root.google.apps.card.v1.Action.encode(message.autoCompleteAction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.placeholderText != null && Object.hasOwnProperty.call(message, "placeholderText")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.placeholderText); + return writer; + }; + + /** + * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.apps.card.v1.TextInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.TextInput + * @static + * @param {google.apps.card.v1.ITextInput} message TextInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextInput message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.TextInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.TextInput} TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextInput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.TextInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + message.hintText = reader.string(); + break; + } + case 4: { + message.value = reader.string(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.onChangeAction = $root.google.apps.card.v1.Action.decode(reader, reader.uint32()); + break; + } + case 7: { + message.initialSuggestions = $root.google.apps.card.v1.Suggestions.decode(reader, reader.uint32()); + break; + } + case 8: { + message.autoCompleteAction = $root.google.apps.card.v1.Action.decode(reader, reader.uint32()); + break; + } + case 12: { + message.placeholderText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.TextInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.TextInput} TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextInput message. + * @function verify + * @memberof google.apps.card.v1.TextInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.hintText != null && message.hasOwnProperty("hintText")) + if (!$util.isString(message.hintText)) + return "hintText: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + if (message.onChangeAction != null && message.hasOwnProperty("onChangeAction")) { + var error = $root.google.apps.card.v1.Action.verify(message.onChangeAction); + if (error) + return "onChangeAction." + error; + } + if (message.initialSuggestions != null && message.hasOwnProperty("initialSuggestions")) { + var error = $root.google.apps.card.v1.Suggestions.verify(message.initialSuggestions); + if (error) + return "initialSuggestions." + error; + } + if (message.autoCompleteAction != null && message.hasOwnProperty("autoCompleteAction")) { + var error = $root.google.apps.card.v1.Action.verify(message.autoCompleteAction); + if (error) + return "autoCompleteAction." + error; + } + if (message.placeholderText != null && message.hasOwnProperty("placeholderText")) + if (!$util.isString(message.placeholderText)) + return "placeholderText: string expected"; + return null; + }; + + /** + * Creates a TextInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.TextInput + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.TextInput} TextInput + */ + TextInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.TextInput) + return object; + var message = new $root.google.apps.card.v1.TextInput(); + if (object.name != null) + message.name = String(object.name); + if (object.label != null) + message.label = String(object.label); + if (object.hintText != null) + message.hintText = String(object.hintText); + if (object.value != null) + message.value = String(object.value); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "SINGLE_LINE": + case 0: + message.type = 0; + break; + case "MULTIPLE_LINE": + case 1: + message.type = 1; + break; + } + if (object.onChangeAction != null) { + if (typeof object.onChangeAction !== "object") + throw TypeError(".google.apps.card.v1.TextInput.onChangeAction: object expected"); + message.onChangeAction = $root.google.apps.card.v1.Action.fromObject(object.onChangeAction); + } + if (object.initialSuggestions != null) { + if (typeof object.initialSuggestions !== "object") + throw TypeError(".google.apps.card.v1.TextInput.initialSuggestions: object expected"); + message.initialSuggestions = $root.google.apps.card.v1.Suggestions.fromObject(object.initialSuggestions); + } + if (object.autoCompleteAction != null) { + if (typeof object.autoCompleteAction !== "object") + throw TypeError(".google.apps.card.v1.TextInput.autoCompleteAction: object expected"); + message.autoCompleteAction = $root.google.apps.card.v1.Action.fromObject(object.autoCompleteAction); + } + if (object.placeholderText != null) + message.placeholderText = String(object.placeholderText); + return message; + }; + + /** + * Creates a plain object from a TextInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.TextInput + * @static + * @param {google.apps.card.v1.TextInput} message TextInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.label = ""; + object.hintText = ""; + object.value = ""; + object.type = options.enums === String ? "SINGLE_LINE" : 0; + object.onChangeAction = null; + object.initialSuggestions = null; + object.autoCompleteAction = null; + object.placeholderText = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.hintText != null && message.hasOwnProperty("hintText")) + object.hintText = message.hintText; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.apps.card.v1.TextInput.Type[message.type] === undefined ? message.type : $root.google.apps.card.v1.TextInput.Type[message.type] : message.type; + if (message.onChangeAction != null && message.hasOwnProperty("onChangeAction")) + object.onChangeAction = $root.google.apps.card.v1.Action.toObject(message.onChangeAction, options); + if (message.initialSuggestions != null && message.hasOwnProperty("initialSuggestions")) + object.initialSuggestions = $root.google.apps.card.v1.Suggestions.toObject(message.initialSuggestions, options); + if (message.autoCompleteAction != null && message.hasOwnProperty("autoCompleteAction")) + object.autoCompleteAction = $root.google.apps.card.v1.Action.toObject(message.autoCompleteAction, options); + if (message.placeholderText != null && message.hasOwnProperty("placeholderText")) + object.placeholderText = message.placeholderText; + return object; + }; + + /** + * Converts this TextInput to JSON. + * @function toJSON + * @memberof google.apps.card.v1.TextInput + * @instance + * @returns {Object.} JSON object + */ + TextInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextInput + * @function getTypeUrl + * @memberof google.apps.card.v1.TextInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.TextInput"; + }; + + /** + * Type enum. + * @name google.apps.card.v1.TextInput.Type + * @enum {number} + * @property {number} SINGLE_LINE=0 SINGLE_LINE value + * @property {number} MULTIPLE_LINE=1 MULTIPLE_LINE value + */ + TextInput.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SINGLE_LINE"] = 0; + values[valuesById[1] = "MULTIPLE_LINE"] = 1; + return values; + })(); + + return TextInput; + })(); + + v1.Suggestions = (function() { + + /** + * Properties of a Suggestions. + * @memberof google.apps.card.v1 + * @interface ISuggestions + * @property {Array.|null} [items] Suggestions items + */ + + /** + * Constructs a new Suggestions. + * @memberof google.apps.card.v1 + * @classdesc Represents a Suggestions. + * @implements ISuggestions + * @constructor + * @param {google.apps.card.v1.ISuggestions=} [properties] Properties to set + */ + function Suggestions(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Suggestions items. + * @member {Array.} items + * @memberof google.apps.card.v1.Suggestions + * @instance + */ + Suggestions.prototype.items = $util.emptyArray; + + /** + * Creates a new Suggestions instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Suggestions + * @static + * @param {google.apps.card.v1.ISuggestions=} [properties] Properties to set + * @returns {google.apps.card.v1.Suggestions} Suggestions instance + */ + Suggestions.create = function create(properties) { + return new Suggestions(properties); + }; + + /** + * Encodes the specified Suggestions message. Does not implicitly {@link google.apps.card.v1.Suggestions.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Suggestions + * @static + * @param {google.apps.card.v1.ISuggestions} message Suggestions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.apps.card.v1.Suggestions.SuggestionItem.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Suggestions message, length delimited. Does not implicitly {@link google.apps.card.v1.Suggestions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Suggestions + * @static + * @param {google.apps.card.v1.ISuggestions} message Suggestions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Suggestions message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Suggestions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Suggestions} Suggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Suggestions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.apps.card.v1.Suggestions.SuggestionItem.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Suggestions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Suggestions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Suggestions} Suggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Suggestions message. + * @function verify + * @memberof google.apps.card.v1.Suggestions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Suggestions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.apps.card.v1.Suggestions.SuggestionItem.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates a Suggestions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Suggestions + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Suggestions} Suggestions + */ + Suggestions.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Suggestions) + return object; + var message = new $root.google.apps.card.v1.Suggestions(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.apps.card.v1.Suggestions.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.apps.card.v1.Suggestions.items: object expected"); + message.items[i] = $root.google.apps.card.v1.Suggestions.SuggestionItem.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Suggestions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Suggestions + * @static + * @param {google.apps.card.v1.Suggestions} message Suggestions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Suggestions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.apps.card.v1.Suggestions.SuggestionItem.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this Suggestions to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Suggestions + * @instance + * @returns {Object.} JSON object + */ + Suggestions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Suggestions + * @function getTypeUrl + * @memberof google.apps.card.v1.Suggestions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Suggestions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Suggestions"; + }; + + Suggestions.SuggestionItem = (function() { + + /** + * Properties of a SuggestionItem. + * @memberof google.apps.card.v1.Suggestions + * @interface ISuggestionItem + * @property {string|null} [text] SuggestionItem text + */ + + /** + * Constructs a new SuggestionItem. + * @memberof google.apps.card.v1.Suggestions + * @classdesc Represents a SuggestionItem. + * @implements ISuggestionItem + * @constructor + * @param {google.apps.card.v1.Suggestions.ISuggestionItem=} [properties] Properties to set + */ + function SuggestionItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestionItem text. + * @member {string|null|undefined} text + * @memberof google.apps.card.v1.Suggestions.SuggestionItem + * @instance + */ + SuggestionItem.prototype.text = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SuggestionItem content. + * @member {"text"|undefined} content + * @memberof google.apps.card.v1.Suggestions.SuggestionItem + * @instance + */ + Object.defineProperty(SuggestionItem.prototype, "content", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SuggestionItem instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Suggestions.SuggestionItem + * @static + * @param {google.apps.card.v1.Suggestions.ISuggestionItem=} [properties] Properties to set + * @returns {google.apps.card.v1.Suggestions.SuggestionItem} SuggestionItem instance + */ + SuggestionItem.create = function create(properties) { + return new SuggestionItem(properties); + }; + + /** + * Encodes the specified SuggestionItem message. Does not implicitly {@link google.apps.card.v1.Suggestions.SuggestionItem.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Suggestions.SuggestionItem + * @static + * @param {google.apps.card.v1.Suggestions.ISuggestionItem} message SuggestionItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; + + /** + * Encodes the specified SuggestionItem message, length delimited. Does not implicitly {@link google.apps.card.v1.Suggestions.SuggestionItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Suggestions.SuggestionItem + * @static + * @param {google.apps.card.v1.Suggestions.ISuggestionItem} message SuggestionItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestionItem message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Suggestions.SuggestionItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Suggestions.SuggestionItem} SuggestionItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionItem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Suggestions.SuggestionItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestionItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Suggestions.SuggestionItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Suggestions.SuggestionItem} SuggestionItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestionItem message. + * @function verify + * @memberof google.apps.card.v1.Suggestions.SuggestionItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.content = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + return null; + }; + + /** + * Creates a SuggestionItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Suggestions.SuggestionItem + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Suggestions.SuggestionItem} SuggestionItem + */ + SuggestionItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Suggestions.SuggestionItem) + return object; + var message = new $root.google.apps.card.v1.Suggestions.SuggestionItem(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a SuggestionItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Suggestions.SuggestionItem + * @static + * @param {google.apps.card.v1.Suggestions.SuggestionItem} message SuggestionItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.content = "text"; + } + return object; + }; + + /** + * Converts this SuggestionItem to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Suggestions.SuggestionItem + * @instance + * @returns {Object.} JSON object + */ + SuggestionItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SuggestionItem + * @function getTypeUrl + * @memberof google.apps.card.v1.Suggestions.SuggestionItem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SuggestionItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Suggestions.SuggestionItem"; + }; + + return SuggestionItem; + })(); + + return Suggestions; + })(); + + v1.ButtonList = (function() { + + /** + * Properties of a ButtonList. + * @memberof google.apps.card.v1 + * @interface IButtonList + * @property {Array.|null} [buttons] ButtonList buttons + */ + + /** + * Constructs a new ButtonList. + * @memberof google.apps.card.v1 + * @classdesc Represents a ButtonList. + * @implements IButtonList + * @constructor + * @param {google.apps.card.v1.IButtonList=} [properties] Properties to set + */ + function ButtonList(properties) { + this.buttons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ButtonList buttons. + * @member {Array.} buttons + * @memberof google.apps.card.v1.ButtonList + * @instance + */ + ButtonList.prototype.buttons = $util.emptyArray; + + /** + * Creates a new ButtonList instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.ButtonList + * @static + * @param {google.apps.card.v1.IButtonList=} [properties] Properties to set + * @returns {google.apps.card.v1.ButtonList} ButtonList instance + */ + ButtonList.create = function create(properties) { + return new ButtonList(properties); + }; + + /** + * Encodes the specified ButtonList message. Does not implicitly {@link google.apps.card.v1.ButtonList.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.ButtonList + * @static + * @param {google.apps.card.v1.IButtonList} message ButtonList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ButtonList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.google.apps.card.v1.Button.encode(message.buttons[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ButtonList message, length delimited. Does not implicitly {@link google.apps.card.v1.ButtonList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.ButtonList + * @static + * @param {google.apps.card.v1.IButtonList} message ButtonList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ButtonList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ButtonList message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.ButtonList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.ButtonList} ButtonList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ButtonList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.ButtonList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.google.apps.card.v1.Button.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ButtonList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.ButtonList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.ButtonList} ButtonList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ButtonList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ButtonList message. + * @function verify + * @memberof google.apps.card.v1.ButtonList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ButtonList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.google.apps.card.v1.Button.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } + } + return null; + }; + + /** + * Creates a ButtonList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.ButtonList + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.ButtonList} ButtonList + */ + ButtonList.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.ButtonList) + return object; + var message = new $root.google.apps.card.v1.ButtonList(); + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".google.apps.card.v1.ButtonList.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".google.apps.card.v1.ButtonList.buttons: object expected"); + message.buttons[i] = $root.google.apps.card.v1.Button.fromObject(object.buttons[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ButtonList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.ButtonList + * @static + * @param {google.apps.card.v1.ButtonList} message ButtonList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ButtonList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buttons = []; + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.google.apps.card.v1.Button.toObject(message.buttons[j], options); + } + return object; + }; + + /** + * Converts this ButtonList to JSON. + * @function toJSON + * @memberof google.apps.card.v1.ButtonList + * @instance + * @returns {Object.} JSON object + */ + ButtonList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ButtonList + * @function getTypeUrl + * @memberof google.apps.card.v1.ButtonList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ButtonList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.ButtonList"; + }; + + return ButtonList; + })(); + + v1.SelectionInput = (function() { + + /** + * Properties of a SelectionInput. + * @memberof google.apps.card.v1 + * @interface ISelectionInput + * @property {string|null} [name] SelectionInput name + * @property {string|null} [label] SelectionInput label + * @property {google.apps.card.v1.SelectionInput.SelectionType|null} [type] SelectionInput type + * @property {Array.|null} [items] SelectionInput items + * @property {google.apps.card.v1.IAction|null} [onChangeAction] SelectionInput onChangeAction + * @property {number|null} [multiSelectMaxSelectedItems] SelectionInput multiSelectMaxSelectedItems + * @property {number|null} [multiSelectMinQueryLength] SelectionInput multiSelectMinQueryLength + * @property {google.apps.card.v1.IAction|null} [externalDataSource] SelectionInput externalDataSource + * @property {google.apps.card.v1.SelectionInput.IPlatformDataSource|null} [platformDataSource] SelectionInput platformDataSource + */ + + /** + * Constructs a new SelectionInput. + * @memberof google.apps.card.v1 + * @classdesc Represents a SelectionInput. + * @implements ISelectionInput + * @constructor + * @param {google.apps.card.v1.ISelectionInput=} [properties] Properties to set + */ + function SelectionInput(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectionInput name. + * @member {string} name + * @memberof google.apps.card.v1.SelectionInput + * @instance + */ + SelectionInput.prototype.name = ""; + + /** + * SelectionInput label. + * @member {string} label + * @memberof google.apps.card.v1.SelectionInput + * @instance + */ + SelectionInput.prototype.label = ""; + + /** + * SelectionInput type. + * @member {google.apps.card.v1.SelectionInput.SelectionType} type + * @memberof google.apps.card.v1.SelectionInput + * @instance + */ + SelectionInput.prototype.type = 0; + + /** + * SelectionInput items. + * @member {Array.} items + * @memberof google.apps.card.v1.SelectionInput + * @instance + */ + SelectionInput.prototype.items = $util.emptyArray; + + /** + * SelectionInput onChangeAction. + * @member {google.apps.card.v1.IAction|null|undefined} onChangeAction + * @memberof google.apps.card.v1.SelectionInput + * @instance + */ + SelectionInput.prototype.onChangeAction = null; + + /** + * SelectionInput multiSelectMaxSelectedItems. + * @member {number} multiSelectMaxSelectedItems + * @memberof google.apps.card.v1.SelectionInput + * @instance + */ + SelectionInput.prototype.multiSelectMaxSelectedItems = 0; + + /** + * SelectionInput multiSelectMinQueryLength. + * @member {number} multiSelectMinQueryLength + * @memberof google.apps.card.v1.SelectionInput + * @instance + */ + SelectionInput.prototype.multiSelectMinQueryLength = 0; + + /** + * SelectionInput externalDataSource. + * @member {google.apps.card.v1.IAction|null|undefined} externalDataSource + * @memberof google.apps.card.v1.SelectionInput + * @instance + */ + SelectionInput.prototype.externalDataSource = null; + + /** + * SelectionInput platformDataSource. + * @member {google.apps.card.v1.SelectionInput.IPlatformDataSource|null|undefined} platformDataSource + * @memberof google.apps.card.v1.SelectionInput + * @instance + */ + SelectionInput.prototype.platformDataSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SelectionInput multiSelectDataSource. + * @member {"externalDataSource"|"platformDataSource"|undefined} multiSelectDataSource + * @memberof google.apps.card.v1.SelectionInput + * @instance + */ + Object.defineProperty(SelectionInput.prototype, "multiSelectDataSource", { + get: $util.oneOfGetter($oneOfFields = ["externalDataSource", "platformDataSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SelectionInput instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.SelectionInput + * @static + * @param {google.apps.card.v1.ISelectionInput=} [properties] Properties to set + * @returns {google.apps.card.v1.SelectionInput} SelectionInput instance + */ + SelectionInput.create = function create(properties) { + return new SelectionInput(properties); + }; + + /** + * Encodes the specified SelectionInput message. Does not implicitly {@link google.apps.card.v1.SelectionInput.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.SelectionInput + * @static + * @param {google.apps.card.v1.ISelectionInput} message SelectionInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectionInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.apps.card.v1.SelectionInput.SelectionItem.encode(message.items[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.onChangeAction != null && Object.hasOwnProperty.call(message, "onChangeAction")) + $root.google.apps.card.v1.Action.encode(message.onChangeAction, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.multiSelectMaxSelectedItems != null && Object.hasOwnProperty.call(message, "multiSelectMaxSelectedItems")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.multiSelectMaxSelectedItems); + if (message.multiSelectMinQueryLength != null && Object.hasOwnProperty.call(message, "multiSelectMinQueryLength")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.multiSelectMinQueryLength); + if (message.externalDataSource != null && Object.hasOwnProperty.call(message, "externalDataSource")) + $root.google.apps.card.v1.Action.encode(message.externalDataSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.platformDataSource != null && Object.hasOwnProperty.call(message, "platformDataSource")) + $root.google.apps.card.v1.SelectionInput.PlatformDataSource.encode(message.platformDataSource, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SelectionInput message, length delimited. Does not implicitly {@link google.apps.card.v1.SelectionInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.SelectionInput + * @static + * @param {google.apps.card.v1.ISelectionInput} message SelectionInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectionInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectionInput message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.SelectionInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.SelectionInput} SelectionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectionInput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.SelectionInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + case 4: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.apps.card.v1.SelectionInput.SelectionItem.decode(reader, reader.uint32())); + break; + } + case 5: { + message.onChangeAction = $root.google.apps.card.v1.Action.decode(reader, reader.uint32()); + break; + } + case 6: { + message.multiSelectMaxSelectedItems = reader.int32(); + break; + } + case 7: { + message.multiSelectMinQueryLength = reader.int32(); + break; + } + case 8: { + message.externalDataSource = $root.google.apps.card.v1.Action.decode(reader, reader.uint32()); + break; + } + case 9: { + message.platformDataSource = $root.google.apps.card.v1.SelectionInput.PlatformDataSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectionInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.SelectionInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.SelectionInput} SelectionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectionInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectionInput message. + * @function verify + * @memberof google.apps.card.v1.SelectionInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectionInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.apps.card.v1.SelectionInput.SelectionItem.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.onChangeAction != null && message.hasOwnProperty("onChangeAction")) { + var error = $root.google.apps.card.v1.Action.verify(message.onChangeAction); + if (error) + return "onChangeAction." + error; + } + if (message.multiSelectMaxSelectedItems != null && message.hasOwnProperty("multiSelectMaxSelectedItems")) + if (!$util.isInteger(message.multiSelectMaxSelectedItems)) + return "multiSelectMaxSelectedItems: integer expected"; + if (message.multiSelectMinQueryLength != null && message.hasOwnProperty("multiSelectMinQueryLength")) + if (!$util.isInteger(message.multiSelectMinQueryLength)) + return "multiSelectMinQueryLength: integer expected"; + if (message.externalDataSource != null && message.hasOwnProperty("externalDataSource")) { + properties.multiSelectDataSource = 1; + { + var error = $root.google.apps.card.v1.Action.verify(message.externalDataSource); + if (error) + return "externalDataSource." + error; + } + } + if (message.platformDataSource != null && message.hasOwnProperty("platformDataSource")) { + if (properties.multiSelectDataSource === 1) + return "multiSelectDataSource: multiple values"; + properties.multiSelectDataSource = 1; + { + var error = $root.google.apps.card.v1.SelectionInput.PlatformDataSource.verify(message.platformDataSource); + if (error) + return "platformDataSource." + error; + } + } + return null; + }; + + /** + * Creates a SelectionInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.SelectionInput + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.SelectionInput} SelectionInput + */ + SelectionInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.SelectionInput) + return object; + var message = new $root.google.apps.card.v1.SelectionInput(); + if (object.name != null) + message.name = String(object.name); + if (object.label != null) + message.label = String(object.label); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "CHECK_BOX": + case 0: + message.type = 0; + break; + case "RADIO_BUTTON": + case 1: + message.type = 1; + break; + case "SWITCH": + case 2: + message.type = 2; + break; + case "DROPDOWN": + case 3: + message.type = 3; + break; + case "MULTI_SELECT": + case 4: + message.type = 4; + break; + } + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.apps.card.v1.SelectionInput.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.apps.card.v1.SelectionInput.items: object expected"); + message.items[i] = $root.google.apps.card.v1.SelectionInput.SelectionItem.fromObject(object.items[i]); + } + } + if (object.onChangeAction != null) { + if (typeof object.onChangeAction !== "object") + throw TypeError(".google.apps.card.v1.SelectionInput.onChangeAction: object expected"); + message.onChangeAction = $root.google.apps.card.v1.Action.fromObject(object.onChangeAction); + } + if (object.multiSelectMaxSelectedItems != null) + message.multiSelectMaxSelectedItems = object.multiSelectMaxSelectedItems | 0; + if (object.multiSelectMinQueryLength != null) + message.multiSelectMinQueryLength = object.multiSelectMinQueryLength | 0; + if (object.externalDataSource != null) { + if (typeof object.externalDataSource !== "object") + throw TypeError(".google.apps.card.v1.SelectionInput.externalDataSource: object expected"); + message.externalDataSource = $root.google.apps.card.v1.Action.fromObject(object.externalDataSource); + } + if (object.platformDataSource != null) { + if (typeof object.platformDataSource !== "object") + throw TypeError(".google.apps.card.v1.SelectionInput.platformDataSource: object expected"); + message.platformDataSource = $root.google.apps.card.v1.SelectionInput.PlatformDataSource.fromObject(object.platformDataSource); + } + return message; + }; + + /** + * Creates a plain object from a SelectionInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.SelectionInput + * @static + * @param {google.apps.card.v1.SelectionInput} message SelectionInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectionInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) { + object.name = ""; + object.label = ""; + object.type = options.enums === String ? "CHECK_BOX" : 0; + object.onChangeAction = null; + object.multiSelectMaxSelectedItems = 0; + object.multiSelectMinQueryLength = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.apps.card.v1.SelectionInput.SelectionType[message.type] === undefined ? message.type : $root.google.apps.card.v1.SelectionInput.SelectionType[message.type] : message.type; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.apps.card.v1.SelectionInput.SelectionItem.toObject(message.items[j], options); + } + if (message.onChangeAction != null && message.hasOwnProperty("onChangeAction")) + object.onChangeAction = $root.google.apps.card.v1.Action.toObject(message.onChangeAction, options); + if (message.multiSelectMaxSelectedItems != null && message.hasOwnProperty("multiSelectMaxSelectedItems")) + object.multiSelectMaxSelectedItems = message.multiSelectMaxSelectedItems; + if (message.multiSelectMinQueryLength != null && message.hasOwnProperty("multiSelectMinQueryLength")) + object.multiSelectMinQueryLength = message.multiSelectMinQueryLength; + if (message.externalDataSource != null && message.hasOwnProperty("externalDataSource")) { + object.externalDataSource = $root.google.apps.card.v1.Action.toObject(message.externalDataSource, options); + if (options.oneofs) + object.multiSelectDataSource = "externalDataSource"; + } + if (message.platformDataSource != null && message.hasOwnProperty("platformDataSource")) { + object.platformDataSource = $root.google.apps.card.v1.SelectionInput.PlatformDataSource.toObject(message.platformDataSource, options); + if (options.oneofs) + object.multiSelectDataSource = "platformDataSource"; + } + return object; + }; + + /** + * Converts this SelectionInput to JSON. + * @function toJSON + * @memberof google.apps.card.v1.SelectionInput + * @instance + * @returns {Object.} JSON object + */ + SelectionInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectionInput + * @function getTypeUrl + * @memberof google.apps.card.v1.SelectionInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectionInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.SelectionInput"; + }; + + /** + * SelectionType enum. + * @name google.apps.card.v1.SelectionInput.SelectionType + * @enum {number} + * @property {number} CHECK_BOX=0 CHECK_BOX value + * @property {number} RADIO_BUTTON=1 RADIO_BUTTON value + * @property {number} SWITCH=2 SWITCH value + * @property {number} DROPDOWN=3 DROPDOWN value + * @property {number} MULTI_SELECT=4 MULTI_SELECT value + */ + SelectionInput.SelectionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHECK_BOX"] = 0; + values[valuesById[1] = "RADIO_BUTTON"] = 1; + values[valuesById[2] = "SWITCH"] = 2; + values[valuesById[3] = "DROPDOWN"] = 3; + values[valuesById[4] = "MULTI_SELECT"] = 4; + return values; + })(); + + SelectionInput.SelectionItem = (function() { + + /** + * Properties of a SelectionItem. + * @memberof google.apps.card.v1.SelectionInput + * @interface ISelectionItem + * @property {string|null} [text] SelectionItem text + * @property {string|null} [value] SelectionItem value + * @property {boolean|null} [selected] SelectionItem selected + * @property {string|null} [startIconUri] SelectionItem startIconUri + * @property {string|null} [bottomText] SelectionItem bottomText + */ + + /** + * Constructs a new SelectionItem. + * @memberof google.apps.card.v1.SelectionInput + * @classdesc Represents a SelectionItem. + * @implements ISelectionItem + * @constructor + * @param {google.apps.card.v1.SelectionInput.ISelectionItem=} [properties] Properties to set + */ + function SelectionItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectionItem text. + * @member {string} text + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @instance + */ + SelectionItem.prototype.text = ""; + + /** + * SelectionItem value. + * @member {string} value + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @instance + */ + SelectionItem.prototype.value = ""; + + /** + * SelectionItem selected. + * @member {boolean} selected + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @instance + */ + SelectionItem.prototype.selected = false; + + /** + * SelectionItem startIconUri. + * @member {string} startIconUri + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @instance + */ + SelectionItem.prototype.startIconUri = ""; + + /** + * SelectionItem bottomText. + * @member {string} bottomText + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @instance + */ + SelectionItem.prototype.bottomText = ""; + + /** + * Creates a new SelectionItem instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @static + * @param {google.apps.card.v1.SelectionInput.ISelectionItem=} [properties] Properties to set + * @returns {google.apps.card.v1.SelectionInput.SelectionItem} SelectionItem instance + */ + SelectionItem.create = function create(properties) { + return new SelectionItem(properties); + }; + + /** + * Encodes the specified SelectionItem message. Does not implicitly {@link google.apps.card.v1.SelectionInput.SelectionItem.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @static + * @param {google.apps.card.v1.SelectionInput.ISelectionItem} message SelectionItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectionItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.selected != null && Object.hasOwnProperty.call(message, "selected")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.selected); + if (message.startIconUri != null && Object.hasOwnProperty.call(message, "startIconUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.startIconUri); + if (message.bottomText != null && Object.hasOwnProperty.call(message, "bottomText")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.bottomText); + return writer; + }; + + /** + * Encodes the specified SelectionItem message, length delimited. Does not implicitly {@link google.apps.card.v1.SelectionInput.SelectionItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @static + * @param {google.apps.card.v1.SelectionInput.ISelectionItem} message SelectionItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectionItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectionItem message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.SelectionInput.SelectionItem} SelectionItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectionItem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.SelectionInput.SelectionItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + case 3: { + message.selected = reader.bool(); + break; + } + case 4: { + message.startIconUri = reader.string(); + break; + } + case 5: { + message.bottomText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectionItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.SelectionInput.SelectionItem} SelectionItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectionItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectionItem message. + * @function verify + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectionItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.selected != null && message.hasOwnProperty("selected")) + if (typeof message.selected !== "boolean") + return "selected: boolean expected"; + if (message.startIconUri != null && message.hasOwnProperty("startIconUri")) + if (!$util.isString(message.startIconUri)) + return "startIconUri: string expected"; + if (message.bottomText != null && message.hasOwnProperty("bottomText")) + if (!$util.isString(message.bottomText)) + return "bottomText: string expected"; + return null; + }; + + /** + * Creates a SelectionItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.SelectionInput.SelectionItem} SelectionItem + */ + SelectionItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.SelectionInput.SelectionItem) + return object; + var message = new $root.google.apps.card.v1.SelectionInput.SelectionItem(); + if (object.text != null) + message.text = String(object.text); + if (object.value != null) + message.value = String(object.value); + if (object.selected != null) + message.selected = Boolean(object.selected); + if (object.startIconUri != null) + message.startIconUri = String(object.startIconUri); + if (object.bottomText != null) + message.bottomText = String(object.bottomText); + return message; + }; + + /** + * Creates a plain object from a SelectionItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @static + * @param {google.apps.card.v1.SelectionInput.SelectionItem} message SelectionItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectionItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.value = ""; + object.selected = false; + object.startIconUri = ""; + object.bottomText = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.selected != null && message.hasOwnProperty("selected")) + object.selected = message.selected; + if (message.startIconUri != null && message.hasOwnProperty("startIconUri")) + object.startIconUri = message.startIconUri; + if (message.bottomText != null && message.hasOwnProperty("bottomText")) + object.bottomText = message.bottomText; + return object; + }; + + /** + * Converts this SelectionItem to JSON. + * @function toJSON + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @instance + * @returns {Object.} JSON object + */ + SelectionItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectionItem + * @function getTypeUrl + * @memberof google.apps.card.v1.SelectionInput.SelectionItem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectionItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.SelectionInput.SelectionItem"; + }; + + return SelectionItem; + })(); + + SelectionInput.PlatformDataSource = (function() { + + /** + * Properties of a PlatformDataSource. + * @memberof google.apps.card.v1.SelectionInput + * @interface IPlatformDataSource + * @property {google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource|null} [commonDataSource] PlatformDataSource commonDataSource + */ + + /** + * Constructs a new PlatformDataSource. + * @memberof google.apps.card.v1.SelectionInput + * @classdesc Represents a PlatformDataSource. + * @implements IPlatformDataSource + * @constructor + * @param {google.apps.card.v1.SelectionInput.IPlatformDataSource=} [properties] Properties to set + */ + function PlatformDataSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlatformDataSource commonDataSource. + * @member {google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource|null|undefined} commonDataSource + * @memberof google.apps.card.v1.SelectionInput.PlatformDataSource + * @instance + */ + PlatformDataSource.prototype.commonDataSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PlatformDataSource dataSource. + * @member {"commonDataSource"|undefined} dataSource + * @memberof google.apps.card.v1.SelectionInput.PlatformDataSource + * @instance + */ + Object.defineProperty(PlatformDataSource.prototype, "dataSource", { + get: $util.oneOfGetter($oneOfFields = ["commonDataSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PlatformDataSource instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.SelectionInput.PlatformDataSource + * @static + * @param {google.apps.card.v1.SelectionInput.IPlatformDataSource=} [properties] Properties to set + * @returns {google.apps.card.v1.SelectionInput.PlatformDataSource} PlatformDataSource instance + */ + PlatformDataSource.create = function create(properties) { + return new PlatformDataSource(properties); + }; + + /** + * Encodes the specified PlatformDataSource message. Does not implicitly {@link google.apps.card.v1.SelectionInput.PlatformDataSource.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.SelectionInput.PlatformDataSource + * @static + * @param {google.apps.card.v1.SelectionInput.IPlatformDataSource} message PlatformDataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlatformDataSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonDataSource != null && Object.hasOwnProperty.call(message, "commonDataSource")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.commonDataSource); + return writer; + }; + + /** + * Encodes the specified PlatformDataSource message, length delimited. Does not implicitly {@link google.apps.card.v1.SelectionInput.PlatformDataSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.SelectionInput.PlatformDataSource + * @static + * @param {google.apps.card.v1.SelectionInput.IPlatformDataSource} message PlatformDataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlatformDataSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlatformDataSource message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.SelectionInput.PlatformDataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.SelectionInput.PlatformDataSource} PlatformDataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlatformDataSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.SelectionInput.PlatformDataSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.commonDataSource = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PlatformDataSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.SelectionInput.PlatformDataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.SelectionInput.PlatformDataSource} PlatformDataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlatformDataSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlatformDataSource message. + * @function verify + * @memberof google.apps.card.v1.SelectionInput.PlatformDataSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlatformDataSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.commonDataSource != null && message.hasOwnProperty("commonDataSource")) { + properties.dataSource = 1; + switch (message.commonDataSource) { + default: + return "commonDataSource: enum value expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a PlatformDataSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.SelectionInput.PlatformDataSource + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.SelectionInput.PlatformDataSource} PlatformDataSource + */ + PlatformDataSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.SelectionInput.PlatformDataSource) + return object; + var message = new $root.google.apps.card.v1.SelectionInput.PlatformDataSource(); + switch (object.commonDataSource) { + default: + if (typeof object.commonDataSource === "number") { + message.commonDataSource = object.commonDataSource; + break; + } + break; + case "UNKNOWN": + case 0: + message.commonDataSource = 0; + break; + case "USER": + case 1: + message.commonDataSource = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a PlatformDataSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.SelectionInput.PlatformDataSource + * @static + * @param {google.apps.card.v1.SelectionInput.PlatformDataSource} message PlatformDataSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlatformDataSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.commonDataSource != null && message.hasOwnProperty("commonDataSource")) { + object.commonDataSource = options.enums === String ? $root.google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource[message.commonDataSource] === undefined ? message.commonDataSource : $root.google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource[message.commonDataSource] : message.commonDataSource; + if (options.oneofs) + object.dataSource = "commonDataSource"; + } + return object; + }; + + /** + * Converts this PlatformDataSource to JSON. + * @function toJSON + * @memberof google.apps.card.v1.SelectionInput.PlatformDataSource + * @instance + * @returns {Object.} JSON object + */ + PlatformDataSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlatformDataSource + * @function getTypeUrl + * @memberof google.apps.card.v1.SelectionInput.PlatformDataSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlatformDataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.SelectionInput.PlatformDataSource"; + }; + + /** + * CommonDataSource enum. + * @name google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} USER=1 USER value + */ + PlatformDataSource.CommonDataSource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "USER"] = 1; + return values; + })(); + + return PlatformDataSource; + })(); + + return SelectionInput; + })(); + + v1.DateTimePicker = (function() { + + /** + * Properties of a DateTimePicker. + * @memberof google.apps.card.v1 + * @interface IDateTimePicker + * @property {string|null} [name] DateTimePicker name + * @property {string|null} [label] DateTimePicker label + * @property {google.apps.card.v1.DateTimePicker.DateTimePickerType|null} [type] DateTimePicker type + * @property {number|Long|null} [valueMsEpoch] DateTimePicker valueMsEpoch + * @property {number|null} [timezoneOffsetDate] DateTimePicker timezoneOffsetDate + * @property {google.apps.card.v1.IAction|null} [onChangeAction] DateTimePicker onChangeAction + */ + + /** + * Constructs a new DateTimePicker. + * @memberof google.apps.card.v1 + * @classdesc Represents a DateTimePicker. + * @implements IDateTimePicker + * @constructor + * @param {google.apps.card.v1.IDateTimePicker=} [properties] Properties to set + */ + function DateTimePicker(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DateTimePicker name. + * @member {string} name + * @memberof google.apps.card.v1.DateTimePicker + * @instance + */ + DateTimePicker.prototype.name = ""; + + /** + * DateTimePicker label. + * @member {string} label + * @memberof google.apps.card.v1.DateTimePicker + * @instance + */ + DateTimePicker.prototype.label = ""; + + /** + * DateTimePicker type. + * @member {google.apps.card.v1.DateTimePicker.DateTimePickerType} type + * @memberof google.apps.card.v1.DateTimePicker + * @instance + */ + DateTimePicker.prototype.type = 0; + + /** + * DateTimePicker valueMsEpoch. + * @member {number|Long} valueMsEpoch + * @memberof google.apps.card.v1.DateTimePicker + * @instance + */ + DateTimePicker.prototype.valueMsEpoch = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DateTimePicker timezoneOffsetDate. + * @member {number} timezoneOffsetDate + * @memberof google.apps.card.v1.DateTimePicker + * @instance + */ + DateTimePicker.prototype.timezoneOffsetDate = 0; + + /** + * DateTimePicker onChangeAction. + * @member {google.apps.card.v1.IAction|null|undefined} onChangeAction + * @memberof google.apps.card.v1.DateTimePicker + * @instance + */ + DateTimePicker.prototype.onChangeAction = null; + + /** + * Creates a new DateTimePicker instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.DateTimePicker + * @static + * @param {google.apps.card.v1.IDateTimePicker=} [properties] Properties to set + * @returns {google.apps.card.v1.DateTimePicker} DateTimePicker instance + */ + DateTimePicker.create = function create(properties) { + return new DateTimePicker(properties); + }; + + /** + * Encodes the specified DateTimePicker message. Does not implicitly {@link google.apps.card.v1.DateTimePicker.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.DateTimePicker + * @static + * @param {google.apps.card.v1.IDateTimePicker} message DateTimePicker message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTimePicker.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.valueMsEpoch != null && Object.hasOwnProperty.call(message, "valueMsEpoch")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.valueMsEpoch); + if (message.timezoneOffsetDate != null && Object.hasOwnProperty.call(message, "timezoneOffsetDate")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.timezoneOffsetDate); + if (message.onChangeAction != null && Object.hasOwnProperty.call(message, "onChangeAction")) + $root.google.apps.card.v1.Action.encode(message.onChangeAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DateTimePicker message, length delimited. Does not implicitly {@link google.apps.card.v1.DateTimePicker.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.DateTimePicker + * @static + * @param {google.apps.card.v1.IDateTimePicker} message DateTimePicker message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTimePicker.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateTimePicker message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.DateTimePicker + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.DateTimePicker} DateTimePicker + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTimePicker.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.DateTimePicker(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + case 4: { + message.valueMsEpoch = reader.int64(); + break; + } + case 5: { + message.timezoneOffsetDate = reader.int32(); + break; + } + case 6: { + message.onChangeAction = $root.google.apps.card.v1.Action.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DateTimePicker message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.DateTimePicker + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.DateTimePicker} DateTimePicker + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTimePicker.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateTimePicker message. + * @function verify + * @memberof google.apps.card.v1.DateTimePicker + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateTimePicker.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.valueMsEpoch != null && message.hasOwnProperty("valueMsEpoch")) + if (!$util.isInteger(message.valueMsEpoch) && !(message.valueMsEpoch && $util.isInteger(message.valueMsEpoch.low) && $util.isInteger(message.valueMsEpoch.high))) + return "valueMsEpoch: integer|Long expected"; + if (message.timezoneOffsetDate != null && message.hasOwnProperty("timezoneOffsetDate")) + if (!$util.isInteger(message.timezoneOffsetDate)) + return "timezoneOffsetDate: integer expected"; + if (message.onChangeAction != null && message.hasOwnProperty("onChangeAction")) { + var error = $root.google.apps.card.v1.Action.verify(message.onChangeAction); + if (error) + return "onChangeAction." + error; + } + return null; + }; + + /** + * Creates a DateTimePicker message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.DateTimePicker + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.DateTimePicker} DateTimePicker + */ + DateTimePicker.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.DateTimePicker) + return object; + var message = new $root.google.apps.card.v1.DateTimePicker(); + if (object.name != null) + message.name = String(object.name); + if (object.label != null) + message.label = String(object.label); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "DATE_AND_TIME": + case 0: + message.type = 0; + break; + case "DATE_ONLY": + case 1: + message.type = 1; + break; + case "TIME_ONLY": + case 2: + message.type = 2; + break; + } + if (object.valueMsEpoch != null) + if ($util.Long) + (message.valueMsEpoch = $util.Long.fromValue(object.valueMsEpoch)).unsigned = false; + else if (typeof object.valueMsEpoch === "string") + message.valueMsEpoch = parseInt(object.valueMsEpoch, 10); + else if (typeof object.valueMsEpoch === "number") + message.valueMsEpoch = object.valueMsEpoch; + else if (typeof object.valueMsEpoch === "object") + message.valueMsEpoch = new $util.LongBits(object.valueMsEpoch.low >>> 0, object.valueMsEpoch.high >>> 0).toNumber(); + if (object.timezoneOffsetDate != null) + message.timezoneOffsetDate = object.timezoneOffsetDate | 0; + if (object.onChangeAction != null) { + if (typeof object.onChangeAction !== "object") + throw TypeError(".google.apps.card.v1.DateTimePicker.onChangeAction: object expected"); + message.onChangeAction = $root.google.apps.card.v1.Action.fromObject(object.onChangeAction); + } + return message; + }; + + /** + * Creates a plain object from a DateTimePicker message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.DateTimePicker + * @static + * @param {google.apps.card.v1.DateTimePicker} message DateTimePicker + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateTimePicker.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.label = ""; + object.type = options.enums === String ? "DATE_AND_TIME" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.valueMsEpoch = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.valueMsEpoch = options.longs === String ? "0" : 0; + object.timezoneOffsetDate = 0; + object.onChangeAction = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.apps.card.v1.DateTimePicker.DateTimePickerType[message.type] === undefined ? message.type : $root.google.apps.card.v1.DateTimePicker.DateTimePickerType[message.type] : message.type; + if (message.valueMsEpoch != null && message.hasOwnProperty("valueMsEpoch")) + if (typeof message.valueMsEpoch === "number") + object.valueMsEpoch = options.longs === String ? String(message.valueMsEpoch) : message.valueMsEpoch; + else + object.valueMsEpoch = options.longs === String ? $util.Long.prototype.toString.call(message.valueMsEpoch) : options.longs === Number ? new $util.LongBits(message.valueMsEpoch.low >>> 0, message.valueMsEpoch.high >>> 0).toNumber() : message.valueMsEpoch; + if (message.timezoneOffsetDate != null && message.hasOwnProperty("timezoneOffsetDate")) + object.timezoneOffsetDate = message.timezoneOffsetDate; + if (message.onChangeAction != null && message.hasOwnProperty("onChangeAction")) + object.onChangeAction = $root.google.apps.card.v1.Action.toObject(message.onChangeAction, options); + return object; + }; + + /** + * Converts this DateTimePicker to JSON. + * @function toJSON + * @memberof google.apps.card.v1.DateTimePicker + * @instance + * @returns {Object.} JSON object + */ + DateTimePicker.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateTimePicker + * @function getTypeUrl + * @memberof google.apps.card.v1.DateTimePicker + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateTimePicker.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.DateTimePicker"; + }; + + /** + * DateTimePickerType enum. + * @name google.apps.card.v1.DateTimePicker.DateTimePickerType + * @enum {number} + * @property {number} DATE_AND_TIME=0 DATE_AND_TIME value + * @property {number} DATE_ONLY=1 DATE_ONLY value + * @property {number} TIME_ONLY=2 TIME_ONLY value + */ + DateTimePicker.DateTimePickerType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATE_AND_TIME"] = 0; + values[valuesById[1] = "DATE_ONLY"] = 1; + values[valuesById[2] = "TIME_ONLY"] = 2; + return values; + })(); + + return DateTimePicker; + })(); + + v1.Button = (function() { + + /** + * Properties of a Button. + * @memberof google.apps.card.v1 + * @interface IButton + * @property {string|null} [text] Button text + * @property {google.apps.card.v1.IIcon|null} [icon] Button icon + * @property {google.type.IColor|null} [color] Button color + * @property {google.apps.card.v1.IOnClick|null} [onClick] Button onClick + * @property {boolean|null} [disabled] Button disabled + * @property {string|null} [altText] Button altText + */ + + /** + * Constructs a new Button. + * @memberof google.apps.card.v1 + * @classdesc Represents a Button. + * @implements IButton + * @constructor + * @param {google.apps.card.v1.IButton=} [properties] Properties to set + */ + function Button(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Button text. + * @member {string} text + * @memberof google.apps.card.v1.Button + * @instance + */ + Button.prototype.text = ""; + + /** + * Button icon. + * @member {google.apps.card.v1.IIcon|null|undefined} icon + * @memberof google.apps.card.v1.Button + * @instance + */ + Button.prototype.icon = null; + + /** + * Button color. + * @member {google.type.IColor|null|undefined} color + * @memberof google.apps.card.v1.Button + * @instance + */ + Button.prototype.color = null; + + /** + * Button onClick. + * @member {google.apps.card.v1.IOnClick|null|undefined} onClick + * @memberof google.apps.card.v1.Button + * @instance + */ + Button.prototype.onClick = null; + + /** + * Button disabled. + * @member {boolean} disabled + * @memberof google.apps.card.v1.Button + * @instance + */ + Button.prototype.disabled = false; + + /** + * Button altText. + * @member {string} altText + * @memberof google.apps.card.v1.Button + * @instance + */ + Button.prototype.altText = ""; + + /** + * Creates a new Button instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Button + * @static + * @param {google.apps.card.v1.IButton=} [properties] Properties to set + * @returns {google.apps.card.v1.Button} Button instance + */ + Button.create = function create(properties) { + return new Button(properties); + }; + + /** + * Encodes the specified Button message. Does not implicitly {@link google.apps.card.v1.Button.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Button + * @static + * @param {google.apps.card.v1.IButton} message Button message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Button.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) + $root.google.apps.card.v1.Icon.encode(message.icon, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.color != null && Object.hasOwnProperty.call(message, "color")) + $root.google.type.Color.encode(message.color, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.apps.card.v1.OnClick.encode(message.onClick, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disabled); + if (message.altText != null && Object.hasOwnProperty.call(message, "altText")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.altText); + return writer; + }; + + /** + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.apps.card.v1.Button.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Button + * @static + * @param {google.apps.card.v1.IButton} message Button message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Button.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Button message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Button + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Button} Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Button.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Button(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.icon = $root.google.apps.card.v1.Icon.decode(reader, reader.uint32()); + break; + } + case 3: { + message.color = $root.google.type.Color.decode(reader, reader.uint32()); + break; + } + case 4: { + message.onClick = $root.google.apps.card.v1.OnClick.decode(reader, reader.uint32()); + break; + } + case 5: { + message.disabled = reader.bool(); + break; + } + case 6: { + message.altText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Button message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Button + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Button} Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Button.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Button message. + * @function verify + * @memberof google.apps.card.v1.Button + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Button.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.icon != null && message.hasOwnProperty("icon")) { + var error = $root.google.apps.card.v1.Icon.verify(message.icon); + if (error) + return "icon." + error; + } + if (message.color != null && message.hasOwnProperty("color")) { + var error = $root.google.type.Color.verify(message.color); + if (error) + return "color." + error; + } + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.apps.card.v1.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.altText != null && message.hasOwnProperty("altText")) + if (!$util.isString(message.altText)) + return "altText: string expected"; + return null; + }; + + /** + * Creates a Button message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Button + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Button} Button + */ + Button.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Button) + return object; + var message = new $root.google.apps.card.v1.Button(); + if (object.text != null) + message.text = String(object.text); + if (object.icon != null) { + if (typeof object.icon !== "object") + throw TypeError(".google.apps.card.v1.Button.icon: object expected"); + message.icon = $root.google.apps.card.v1.Icon.fromObject(object.icon); + } + if (object.color != null) { + if (typeof object.color !== "object") + throw TypeError(".google.apps.card.v1.Button.color: object expected"); + message.color = $root.google.type.Color.fromObject(object.color); + } + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.apps.card.v1.Button.onClick: object expected"); + message.onClick = $root.google.apps.card.v1.OnClick.fromObject(object.onClick); + } + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.altText != null) + message.altText = String(object.altText); + return message; + }; + + /** + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Button + * @static + * @param {google.apps.card.v1.Button} message Button + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Button.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.icon = null; + object.color = null; + object.onClick = null; + object.disabled = false; + object.altText = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.icon != null && message.hasOwnProperty("icon")) + object.icon = $root.google.apps.card.v1.Icon.toObject(message.icon, options); + if (message.color != null && message.hasOwnProperty("color")) + object.color = $root.google.type.Color.toObject(message.color, options); + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.apps.card.v1.OnClick.toObject(message.onClick, options); + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + if (message.altText != null && message.hasOwnProperty("altText")) + object.altText = message.altText; + return object; + }; + + /** + * Converts this Button to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Button + * @instance + * @returns {Object.} JSON object + */ + Button.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Button + * @function getTypeUrl + * @memberof google.apps.card.v1.Button + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Button.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Button"; + }; + + return Button; + })(); + + v1.Icon = (function() { + + /** + * Properties of an Icon. + * @memberof google.apps.card.v1 + * @interface IIcon + * @property {string|null} [knownIcon] Icon knownIcon + * @property {string|null} [iconUrl] Icon iconUrl + * @property {google.apps.card.v1.IMaterialIcon|null} [materialIcon] Icon materialIcon + * @property {string|null} [altText] Icon altText + * @property {google.apps.card.v1.Widget.ImageType|null} [imageType] Icon imageType + */ + + /** + * Constructs a new Icon. + * @memberof google.apps.card.v1 + * @classdesc Represents an Icon. + * @implements IIcon + * @constructor + * @param {google.apps.card.v1.IIcon=} [properties] Properties to set + */ + function Icon(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Icon knownIcon. + * @member {string|null|undefined} knownIcon + * @memberof google.apps.card.v1.Icon + * @instance + */ + Icon.prototype.knownIcon = null; + + /** + * Icon iconUrl. + * @member {string|null|undefined} iconUrl + * @memberof google.apps.card.v1.Icon + * @instance + */ + Icon.prototype.iconUrl = null; + + /** + * Icon materialIcon. + * @member {google.apps.card.v1.IMaterialIcon|null|undefined} materialIcon + * @memberof google.apps.card.v1.Icon + * @instance + */ + Icon.prototype.materialIcon = null; + + /** + * Icon altText. + * @member {string} altText + * @memberof google.apps.card.v1.Icon + * @instance + */ + Icon.prototype.altText = ""; + + /** + * Icon imageType. + * @member {google.apps.card.v1.Widget.ImageType} imageType + * @memberof google.apps.card.v1.Icon + * @instance + */ + Icon.prototype.imageType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Icon icons. + * @member {"knownIcon"|"iconUrl"|"materialIcon"|undefined} icons + * @memberof google.apps.card.v1.Icon + * @instance + */ + Object.defineProperty(Icon.prototype, "icons", { + get: $util.oneOfGetter($oneOfFields = ["knownIcon", "iconUrl", "materialIcon"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Icon instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Icon + * @static + * @param {google.apps.card.v1.IIcon=} [properties] Properties to set + * @returns {google.apps.card.v1.Icon} Icon instance + */ + Icon.create = function create(properties) { + return new Icon(properties); + }; + + /** + * Encodes the specified Icon message. Does not implicitly {@link google.apps.card.v1.Icon.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Icon + * @static + * @param {google.apps.card.v1.IIcon} message Icon message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Icon.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.knownIcon != null && Object.hasOwnProperty.call(message, "knownIcon")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.knownIcon); + if (message.iconUrl != null && Object.hasOwnProperty.call(message, "iconUrl")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.iconUrl); + if (message.altText != null && Object.hasOwnProperty.call(message, "altText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.altText); + if (message.imageType != null && Object.hasOwnProperty.call(message, "imageType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.imageType); + if (message.materialIcon != null && Object.hasOwnProperty.call(message, "materialIcon")) + $root.google.apps.card.v1.MaterialIcon.encode(message.materialIcon, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Icon message, length delimited. Does not implicitly {@link google.apps.card.v1.Icon.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Icon + * @static + * @param {google.apps.card.v1.IIcon} message Icon message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Icon.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Icon message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Icon + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Icon} Icon + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Icon.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Icon(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.knownIcon = reader.string(); + break; + } + case 2: { + message.iconUrl = reader.string(); + break; + } + case 5: { + message.materialIcon = $root.google.apps.card.v1.MaterialIcon.decode(reader, reader.uint32()); + break; + } + case 3: { + message.altText = reader.string(); + break; + } + case 4: { + message.imageType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Icon message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Icon + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Icon} Icon + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Icon.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Icon message. + * @function verify + * @memberof google.apps.card.v1.Icon + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Icon.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.knownIcon != null && message.hasOwnProperty("knownIcon")) { + properties.icons = 1; + if (!$util.isString(message.knownIcon)) + return "knownIcon: string expected"; + } + if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { + if (properties.icons === 1) + return "icons: multiple values"; + properties.icons = 1; + if (!$util.isString(message.iconUrl)) + return "iconUrl: string expected"; + } + if (message.materialIcon != null && message.hasOwnProperty("materialIcon")) { + if (properties.icons === 1) + return "icons: multiple values"; + properties.icons = 1; + { + var error = $root.google.apps.card.v1.MaterialIcon.verify(message.materialIcon); + if (error) + return "materialIcon." + error; + } + } + if (message.altText != null && message.hasOwnProperty("altText")) + if (!$util.isString(message.altText)) + return "altText: string expected"; + if (message.imageType != null && message.hasOwnProperty("imageType")) + switch (message.imageType) { + default: + return "imageType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an Icon message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Icon + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Icon} Icon + */ + Icon.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Icon) + return object; + var message = new $root.google.apps.card.v1.Icon(); + if (object.knownIcon != null) + message.knownIcon = String(object.knownIcon); + if (object.iconUrl != null) + message.iconUrl = String(object.iconUrl); + if (object.materialIcon != null) { + if (typeof object.materialIcon !== "object") + throw TypeError(".google.apps.card.v1.Icon.materialIcon: object expected"); + message.materialIcon = $root.google.apps.card.v1.MaterialIcon.fromObject(object.materialIcon); + } + if (object.altText != null) + message.altText = String(object.altText); + switch (object.imageType) { + default: + if (typeof object.imageType === "number") { + message.imageType = object.imageType; + break; + } + break; + case "SQUARE": + case 0: + message.imageType = 0; + break; + case "CIRCLE": + case 1: + message.imageType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an Icon message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Icon + * @static + * @param {google.apps.card.v1.Icon} message Icon + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Icon.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.altText = ""; + object.imageType = options.enums === String ? "SQUARE" : 0; + } + if (message.knownIcon != null && message.hasOwnProperty("knownIcon")) { + object.knownIcon = message.knownIcon; + if (options.oneofs) + object.icons = "knownIcon"; + } + if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { + object.iconUrl = message.iconUrl; + if (options.oneofs) + object.icons = "iconUrl"; + } + if (message.altText != null && message.hasOwnProperty("altText")) + object.altText = message.altText; + if (message.imageType != null && message.hasOwnProperty("imageType")) + object.imageType = options.enums === String ? $root.google.apps.card.v1.Widget.ImageType[message.imageType] === undefined ? message.imageType : $root.google.apps.card.v1.Widget.ImageType[message.imageType] : message.imageType; + if (message.materialIcon != null && message.hasOwnProperty("materialIcon")) { + object.materialIcon = $root.google.apps.card.v1.MaterialIcon.toObject(message.materialIcon, options); + if (options.oneofs) + object.icons = "materialIcon"; + } + return object; + }; + + /** + * Converts this Icon to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Icon + * @instance + * @returns {Object.} JSON object + */ + Icon.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Icon + * @function getTypeUrl + * @memberof google.apps.card.v1.Icon + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Icon.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Icon"; + }; + + return Icon; + })(); + + v1.MaterialIcon = (function() { + + /** + * Properties of a MaterialIcon. + * @memberof google.apps.card.v1 + * @interface IMaterialIcon + * @property {string|null} [name] MaterialIcon name + * @property {boolean|null} [fill] MaterialIcon fill + * @property {number|null} [weight] MaterialIcon weight + * @property {number|null} [grade] MaterialIcon grade + */ + + /** + * Constructs a new MaterialIcon. + * @memberof google.apps.card.v1 + * @classdesc Represents a MaterialIcon. + * @implements IMaterialIcon + * @constructor + * @param {google.apps.card.v1.IMaterialIcon=} [properties] Properties to set + */ + function MaterialIcon(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaterialIcon name. + * @member {string} name + * @memberof google.apps.card.v1.MaterialIcon + * @instance + */ + MaterialIcon.prototype.name = ""; + + /** + * MaterialIcon fill. + * @member {boolean} fill + * @memberof google.apps.card.v1.MaterialIcon + * @instance + */ + MaterialIcon.prototype.fill = false; + + /** + * MaterialIcon weight. + * @member {number} weight + * @memberof google.apps.card.v1.MaterialIcon + * @instance + */ + MaterialIcon.prototype.weight = 0; + + /** + * MaterialIcon grade. + * @member {number} grade + * @memberof google.apps.card.v1.MaterialIcon + * @instance + */ + MaterialIcon.prototype.grade = 0; + + /** + * Creates a new MaterialIcon instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.MaterialIcon + * @static + * @param {google.apps.card.v1.IMaterialIcon=} [properties] Properties to set + * @returns {google.apps.card.v1.MaterialIcon} MaterialIcon instance + */ + MaterialIcon.create = function create(properties) { + return new MaterialIcon(properties); + }; + + /** + * Encodes the specified MaterialIcon message. Does not implicitly {@link google.apps.card.v1.MaterialIcon.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.MaterialIcon + * @static + * @param {google.apps.card.v1.IMaterialIcon} message MaterialIcon message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterialIcon.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.fill != null && Object.hasOwnProperty.call(message, "fill")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fill); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.weight); + if (message.grade != null && Object.hasOwnProperty.call(message, "grade")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.grade); + return writer; + }; + + /** + * Encodes the specified MaterialIcon message, length delimited. Does not implicitly {@link google.apps.card.v1.MaterialIcon.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.MaterialIcon + * @static + * @param {google.apps.card.v1.IMaterialIcon} message MaterialIcon message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterialIcon.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaterialIcon message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.MaterialIcon + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.MaterialIcon} MaterialIcon + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterialIcon.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.MaterialIcon(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.fill = reader.bool(); + break; + } + case 3: { + message.weight = reader.int32(); + break; + } + case 4: { + message.grade = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaterialIcon message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.MaterialIcon + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.MaterialIcon} MaterialIcon + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterialIcon.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaterialIcon message. + * @function verify + * @memberof google.apps.card.v1.MaterialIcon + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaterialIcon.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.fill != null && message.hasOwnProperty("fill")) + if (typeof message.fill !== "boolean") + return "fill: boolean expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (!$util.isInteger(message.weight)) + return "weight: integer expected"; + if (message.grade != null && message.hasOwnProperty("grade")) + if (!$util.isInteger(message.grade)) + return "grade: integer expected"; + return null; + }; + + /** + * Creates a MaterialIcon message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.MaterialIcon + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.MaterialIcon} MaterialIcon + */ + MaterialIcon.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.MaterialIcon) + return object; + var message = new $root.google.apps.card.v1.MaterialIcon(); + if (object.name != null) + message.name = String(object.name); + if (object.fill != null) + message.fill = Boolean(object.fill); + if (object.weight != null) + message.weight = object.weight | 0; + if (object.grade != null) + message.grade = object.grade | 0; + return message; + }; + + /** + * Creates a plain object from a MaterialIcon message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.MaterialIcon + * @static + * @param {google.apps.card.v1.MaterialIcon} message MaterialIcon + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaterialIcon.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.fill = false; + object.weight = 0; + object.grade = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fill != null && message.hasOwnProperty("fill")) + object.fill = message.fill; + if (message.weight != null && message.hasOwnProperty("weight")) + object.weight = message.weight; + if (message.grade != null && message.hasOwnProperty("grade")) + object.grade = message.grade; + return object; + }; + + /** + * Converts this MaterialIcon to JSON. + * @function toJSON + * @memberof google.apps.card.v1.MaterialIcon + * @instance + * @returns {Object.} JSON object + */ + MaterialIcon.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaterialIcon + * @function getTypeUrl + * @memberof google.apps.card.v1.MaterialIcon + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaterialIcon.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.MaterialIcon"; + }; + + return MaterialIcon; + })(); + + v1.ImageCropStyle = (function() { + + /** + * Properties of an ImageCropStyle. + * @memberof google.apps.card.v1 + * @interface IImageCropStyle + * @property {google.apps.card.v1.ImageCropStyle.ImageCropType|null} [type] ImageCropStyle type + * @property {number|null} [aspectRatio] ImageCropStyle aspectRatio + */ + + /** + * Constructs a new ImageCropStyle. + * @memberof google.apps.card.v1 + * @classdesc Represents an ImageCropStyle. + * @implements IImageCropStyle + * @constructor + * @param {google.apps.card.v1.IImageCropStyle=} [properties] Properties to set + */ + function ImageCropStyle(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageCropStyle type. + * @member {google.apps.card.v1.ImageCropStyle.ImageCropType} type + * @memberof google.apps.card.v1.ImageCropStyle + * @instance + */ + ImageCropStyle.prototype.type = 0; + + /** + * ImageCropStyle aspectRatio. + * @member {number} aspectRatio + * @memberof google.apps.card.v1.ImageCropStyle + * @instance + */ + ImageCropStyle.prototype.aspectRatio = 0; + + /** + * Creates a new ImageCropStyle instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.ImageCropStyle + * @static + * @param {google.apps.card.v1.IImageCropStyle=} [properties] Properties to set + * @returns {google.apps.card.v1.ImageCropStyle} ImageCropStyle instance + */ + ImageCropStyle.create = function create(properties) { + return new ImageCropStyle(properties); + }; + + /** + * Encodes the specified ImageCropStyle message. Does not implicitly {@link google.apps.card.v1.ImageCropStyle.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.ImageCropStyle + * @static + * @param {google.apps.card.v1.IImageCropStyle} message ImageCropStyle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageCropStyle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.aspectRatio != null && Object.hasOwnProperty.call(message, "aspectRatio")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.aspectRatio); + return writer; + }; + + /** + * Encodes the specified ImageCropStyle message, length delimited. Does not implicitly {@link google.apps.card.v1.ImageCropStyle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.ImageCropStyle + * @static + * @param {google.apps.card.v1.IImageCropStyle} message ImageCropStyle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageCropStyle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageCropStyle message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.ImageCropStyle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.ImageCropStyle} ImageCropStyle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageCropStyle.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.ImageCropStyle(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.aspectRatio = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageCropStyle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.ImageCropStyle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.ImageCropStyle} ImageCropStyle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageCropStyle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageCropStyle message. + * @function verify + * @memberof google.apps.card.v1.ImageCropStyle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageCropStyle.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.aspectRatio != null && message.hasOwnProperty("aspectRatio")) + if (typeof message.aspectRatio !== "number") + return "aspectRatio: number expected"; + return null; + }; + + /** + * Creates an ImageCropStyle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.ImageCropStyle + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.ImageCropStyle} ImageCropStyle + */ + ImageCropStyle.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.ImageCropStyle) + return object; + var message = new $root.google.apps.card.v1.ImageCropStyle(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "IMAGE_CROP_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "SQUARE": + case 1: + message.type = 1; + break; + case "CIRCLE": + case 2: + message.type = 2; + break; + case "RECTANGLE_CUSTOM": + case 3: + message.type = 3; + break; + case "RECTANGLE_4_3": + case 4: + message.type = 4; + break; + } + if (object.aspectRatio != null) + message.aspectRatio = Number(object.aspectRatio); + return message; + }; + + /** + * Creates a plain object from an ImageCropStyle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.ImageCropStyle + * @static + * @param {google.apps.card.v1.ImageCropStyle} message ImageCropStyle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageCropStyle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "IMAGE_CROP_TYPE_UNSPECIFIED" : 0; + object.aspectRatio = 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.apps.card.v1.ImageCropStyle.ImageCropType[message.type] === undefined ? message.type : $root.google.apps.card.v1.ImageCropStyle.ImageCropType[message.type] : message.type; + if (message.aspectRatio != null && message.hasOwnProperty("aspectRatio")) + object.aspectRatio = options.json && !isFinite(message.aspectRatio) ? String(message.aspectRatio) : message.aspectRatio; + return object; + }; + + /** + * Converts this ImageCropStyle to JSON. + * @function toJSON + * @memberof google.apps.card.v1.ImageCropStyle + * @instance + * @returns {Object.} JSON object + */ + ImageCropStyle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageCropStyle + * @function getTypeUrl + * @memberof google.apps.card.v1.ImageCropStyle + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageCropStyle.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.ImageCropStyle"; + }; + + /** + * ImageCropType enum. + * @name google.apps.card.v1.ImageCropStyle.ImageCropType + * @enum {number} + * @property {number} IMAGE_CROP_TYPE_UNSPECIFIED=0 IMAGE_CROP_TYPE_UNSPECIFIED value + * @property {number} SQUARE=1 SQUARE value + * @property {number} CIRCLE=2 CIRCLE value + * @property {number} RECTANGLE_CUSTOM=3 RECTANGLE_CUSTOM value + * @property {number} RECTANGLE_4_3=4 RECTANGLE_4_3 value + */ + ImageCropStyle.ImageCropType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMAGE_CROP_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SQUARE"] = 1; + values[valuesById[2] = "CIRCLE"] = 2; + values[valuesById[3] = "RECTANGLE_CUSTOM"] = 3; + values[valuesById[4] = "RECTANGLE_4_3"] = 4; + return values; + })(); + + return ImageCropStyle; + })(); + + v1.BorderStyle = (function() { + + /** + * Properties of a BorderStyle. + * @memberof google.apps.card.v1 + * @interface IBorderStyle + * @property {google.apps.card.v1.BorderStyle.BorderType|null} [type] BorderStyle type + * @property {google.type.IColor|null} [strokeColor] BorderStyle strokeColor + * @property {number|null} [cornerRadius] BorderStyle cornerRadius + */ + + /** + * Constructs a new BorderStyle. + * @memberof google.apps.card.v1 + * @classdesc Represents a BorderStyle. + * @implements IBorderStyle + * @constructor + * @param {google.apps.card.v1.IBorderStyle=} [properties] Properties to set + */ + function BorderStyle(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BorderStyle type. + * @member {google.apps.card.v1.BorderStyle.BorderType} type + * @memberof google.apps.card.v1.BorderStyle + * @instance + */ + BorderStyle.prototype.type = 0; + + /** + * BorderStyle strokeColor. + * @member {google.type.IColor|null|undefined} strokeColor + * @memberof google.apps.card.v1.BorderStyle + * @instance + */ + BorderStyle.prototype.strokeColor = null; + + /** + * BorderStyle cornerRadius. + * @member {number} cornerRadius + * @memberof google.apps.card.v1.BorderStyle + * @instance + */ + BorderStyle.prototype.cornerRadius = 0; + + /** + * Creates a new BorderStyle instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.BorderStyle + * @static + * @param {google.apps.card.v1.IBorderStyle=} [properties] Properties to set + * @returns {google.apps.card.v1.BorderStyle} BorderStyle instance + */ + BorderStyle.create = function create(properties) { + return new BorderStyle(properties); + }; + + /** + * Encodes the specified BorderStyle message. Does not implicitly {@link google.apps.card.v1.BorderStyle.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.BorderStyle + * @static + * @param {google.apps.card.v1.IBorderStyle} message BorderStyle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BorderStyle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.strokeColor != null && Object.hasOwnProperty.call(message, "strokeColor")) + $root.google.type.Color.encode(message.strokeColor, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cornerRadius != null && Object.hasOwnProperty.call(message, "cornerRadius")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.cornerRadius); + return writer; + }; + + /** + * Encodes the specified BorderStyle message, length delimited. Does not implicitly {@link google.apps.card.v1.BorderStyle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.BorderStyle + * @static + * @param {google.apps.card.v1.IBorderStyle} message BorderStyle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BorderStyle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BorderStyle message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.BorderStyle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.BorderStyle} BorderStyle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BorderStyle.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.BorderStyle(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.strokeColor = $root.google.type.Color.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cornerRadius = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BorderStyle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.BorderStyle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.BorderStyle} BorderStyle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BorderStyle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BorderStyle message. + * @function verify + * @memberof google.apps.card.v1.BorderStyle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BorderStyle.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.strokeColor != null && message.hasOwnProperty("strokeColor")) { + var error = $root.google.type.Color.verify(message.strokeColor); + if (error) + return "strokeColor." + error; + } + if (message.cornerRadius != null && message.hasOwnProperty("cornerRadius")) + if (!$util.isInteger(message.cornerRadius)) + return "cornerRadius: integer expected"; + return null; + }; + + /** + * Creates a BorderStyle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.BorderStyle + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.BorderStyle} BorderStyle + */ + BorderStyle.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.BorderStyle) + return object; + var message = new $root.google.apps.card.v1.BorderStyle(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "BORDER_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "NO_BORDER": + case 1: + message.type = 1; + break; + case "STROKE": + case 2: + message.type = 2; + break; + } + if (object.strokeColor != null) { + if (typeof object.strokeColor !== "object") + throw TypeError(".google.apps.card.v1.BorderStyle.strokeColor: object expected"); + message.strokeColor = $root.google.type.Color.fromObject(object.strokeColor); + } + if (object.cornerRadius != null) + message.cornerRadius = object.cornerRadius | 0; + return message; + }; + + /** + * Creates a plain object from a BorderStyle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.BorderStyle + * @static + * @param {google.apps.card.v1.BorderStyle} message BorderStyle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BorderStyle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "BORDER_TYPE_UNSPECIFIED" : 0; + object.strokeColor = null; + object.cornerRadius = 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.apps.card.v1.BorderStyle.BorderType[message.type] === undefined ? message.type : $root.google.apps.card.v1.BorderStyle.BorderType[message.type] : message.type; + if (message.strokeColor != null && message.hasOwnProperty("strokeColor")) + object.strokeColor = $root.google.type.Color.toObject(message.strokeColor, options); + if (message.cornerRadius != null && message.hasOwnProperty("cornerRadius")) + object.cornerRadius = message.cornerRadius; + return object; + }; + + /** + * Converts this BorderStyle to JSON. + * @function toJSON + * @memberof google.apps.card.v1.BorderStyle + * @instance + * @returns {Object.} JSON object + */ + BorderStyle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BorderStyle + * @function getTypeUrl + * @memberof google.apps.card.v1.BorderStyle + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BorderStyle.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.BorderStyle"; + }; + + /** + * BorderType enum. + * @name google.apps.card.v1.BorderStyle.BorderType + * @enum {number} + * @property {number} BORDER_TYPE_UNSPECIFIED=0 BORDER_TYPE_UNSPECIFIED value + * @property {number} NO_BORDER=1 NO_BORDER value + * @property {number} STROKE=2 STROKE value + */ + BorderStyle.BorderType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BORDER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_BORDER"] = 1; + values[valuesById[2] = "STROKE"] = 2; + return values; + })(); + + return BorderStyle; + })(); + + v1.ImageComponent = (function() { + + /** + * Properties of an ImageComponent. + * @memberof google.apps.card.v1 + * @interface IImageComponent + * @property {string|null} [imageUri] ImageComponent imageUri + * @property {string|null} [altText] ImageComponent altText + * @property {google.apps.card.v1.IImageCropStyle|null} [cropStyle] ImageComponent cropStyle + * @property {google.apps.card.v1.IBorderStyle|null} [borderStyle] ImageComponent borderStyle + */ + + /** + * Constructs a new ImageComponent. + * @memberof google.apps.card.v1 + * @classdesc Represents an ImageComponent. + * @implements IImageComponent + * @constructor + * @param {google.apps.card.v1.IImageComponent=} [properties] Properties to set + */ + function ImageComponent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageComponent imageUri. + * @member {string} imageUri + * @memberof google.apps.card.v1.ImageComponent + * @instance + */ + ImageComponent.prototype.imageUri = ""; + + /** + * ImageComponent altText. + * @member {string} altText + * @memberof google.apps.card.v1.ImageComponent + * @instance + */ + ImageComponent.prototype.altText = ""; + + /** + * ImageComponent cropStyle. + * @member {google.apps.card.v1.IImageCropStyle|null|undefined} cropStyle + * @memberof google.apps.card.v1.ImageComponent + * @instance + */ + ImageComponent.prototype.cropStyle = null; + + /** + * ImageComponent borderStyle. + * @member {google.apps.card.v1.IBorderStyle|null|undefined} borderStyle + * @memberof google.apps.card.v1.ImageComponent + * @instance + */ + ImageComponent.prototype.borderStyle = null; + + /** + * Creates a new ImageComponent instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.ImageComponent + * @static + * @param {google.apps.card.v1.IImageComponent=} [properties] Properties to set + * @returns {google.apps.card.v1.ImageComponent} ImageComponent instance + */ + ImageComponent.create = function create(properties) { + return new ImageComponent(properties); + }; + + /** + * Encodes the specified ImageComponent message. Does not implicitly {@link google.apps.card.v1.ImageComponent.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.ImageComponent + * @static + * @param {google.apps.card.v1.IImageComponent} message ImageComponent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageComponent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); + if (message.altText != null && Object.hasOwnProperty.call(message, "altText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.altText); + if (message.cropStyle != null && Object.hasOwnProperty.call(message, "cropStyle")) + $root.google.apps.card.v1.ImageCropStyle.encode(message.cropStyle, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.borderStyle != null && Object.hasOwnProperty.call(message, "borderStyle")) + $root.google.apps.card.v1.BorderStyle.encode(message.borderStyle, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageComponent message, length delimited. Does not implicitly {@link google.apps.card.v1.ImageComponent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.ImageComponent + * @static + * @param {google.apps.card.v1.IImageComponent} message ImageComponent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageComponent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageComponent message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.ImageComponent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.ImageComponent} ImageComponent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageComponent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.ImageComponent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageUri = reader.string(); + break; + } + case 2: { + message.altText = reader.string(); + break; + } + case 3: { + message.cropStyle = $root.google.apps.card.v1.ImageCropStyle.decode(reader, reader.uint32()); + break; + } + case 4: { + message.borderStyle = $root.google.apps.card.v1.BorderStyle.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageComponent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.ImageComponent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.ImageComponent} ImageComponent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageComponent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageComponent message. + * @function verify + * @memberof google.apps.card.v1.ImageComponent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageComponent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.altText != null && message.hasOwnProperty("altText")) + if (!$util.isString(message.altText)) + return "altText: string expected"; + if (message.cropStyle != null && message.hasOwnProperty("cropStyle")) { + var error = $root.google.apps.card.v1.ImageCropStyle.verify(message.cropStyle); + if (error) + return "cropStyle." + error; + } + if (message.borderStyle != null && message.hasOwnProperty("borderStyle")) { + var error = $root.google.apps.card.v1.BorderStyle.verify(message.borderStyle); + if (error) + return "borderStyle." + error; + } + return null; + }; + + /** + * Creates an ImageComponent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.ImageComponent + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.ImageComponent} ImageComponent + */ + ImageComponent.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.ImageComponent) + return object; + var message = new $root.google.apps.card.v1.ImageComponent(); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.altText != null) + message.altText = String(object.altText); + if (object.cropStyle != null) { + if (typeof object.cropStyle !== "object") + throw TypeError(".google.apps.card.v1.ImageComponent.cropStyle: object expected"); + message.cropStyle = $root.google.apps.card.v1.ImageCropStyle.fromObject(object.cropStyle); + } + if (object.borderStyle != null) { + if (typeof object.borderStyle !== "object") + throw TypeError(".google.apps.card.v1.ImageComponent.borderStyle: object expected"); + message.borderStyle = $root.google.apps.card.v1.BorderStyle.fromObject(object.borderStyle); + } + return message; + }; + + /** + * Creates a plain object from an ImageComponent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.ImageComponent + * @static + * @param {google.apps.card.v1.ImageComponent} message ImageComponent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageComponent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.imageUri = ""; + object.altText = ""; + object.cropStyle = null; + object.borderStyle = null; + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.altText != null && message.hasOwnProperty("altText")) + object.altText = message.altText; + if (message.cropStyle != null && message.hasOwnProperty("cropStyle")) + object.cropStyle = $root.google.apps.card.v1.ImageCropStyle.toObject(message.cropStyle, options); + if (message.borderStyle != null && message.hasOwnProperty("borderStyle")) + object.borderStyle = $root.google.apps.card.v1.BorderStyle.toObject(message.borderStyle, options); + return object; + }; + + /** + * Converts this ImageComponent to JSON. + * @function toJSON + * @memberof google.apps.card.v1.ImageComponent + * @instance + * @returns {Object.} JSON object + */ + ImageComponent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageComponent + * @function getTypeUrl + * @memberof google.apps.card.v1.ImageComponent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageComponent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.ImageComponent"; + }; + + return ImageComponent; + })(); + + v1.Grid = (function() { + + /** + * Properties of a Grid. + * @memberof google.apps.card.v1 + * @interface IGrid + * @property {string|null} [title] Grid title + * @property {Array.|null} [items] Grid items + * @property {google.apps.card.v1.IBorderStyle|null} [borderStyle] Grid borderStyle + * @property {number|null} [columnCount] Grid columnCount + * @property {google.apps.card.v1.IOnClick|null} [onClick] Grid onClick + */ + + /** + * Constructs a new Grid. + * @memberof google.apps.card.v1 + * @classdesc Represents a Grid. + * @implements IGrid + * @constructor + * @param {google.apps.card.v1.IGrid=} [properties] Properties to set + */ + function Grid(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Grid title. + * @member {string} title + * @memberof google.apps.card.v1.Grid + * @instance + */ + Grid.prototype.title = ""; + + /** + * Grid items. + * @member {Array.} items + * @memberof google.apps.card.v1.Grid + * @instance + */ + Grid.prototype.items = $util.emptyArray; + + /** + * Grid borderStyle. + * @member {google.apps.card.v1.IBorderStyle|null|undefined} borderStyle + * @memberof google.apps.card.v1.Grid + * @instance + */ + Grid.prototype.borderStyle = null; + + /** + * Grid columnCount. + * @member {number} columnCount + * @memberof google.apps.card.v1.Grid + * @instance + */ + Grid.prototype.columnCount = 0; + + /** + * Grid onClick. + * @member {google.apps.card.v1.IOnClick|null|undefined} onClick + * @memberof google.apps.card.v1.Grid + * @instance + */ + Grid.prototype.onClick = null; + + /** + * Creates a new Grid instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Grid + * @static + * @param {google.apps.card.v1.IGrid=} [properties] Properties to set + * @returns {google.apps.card.v1.Grid} Grid instance + */ + Grid.create = function create(properties) { + return new Grid(properties); + }; + + /** + * Encodes the specified Grid message. Does not implicitly {@link google.apps.card.v1.Grid.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Grid + * @static + * @param {google.apps.card.v1.IGrid} message Grid message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Grid.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.apps.card.v1.Grid.GridItem.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.borderStyle != null && Object.hasOwnProperty.call(message, "borderStyle")) + $root.google.apps.card.v1.BorderStyle.encode(message.borderStyle, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.columnCount != null && Object.hasOwnProperty.call(message, "columnCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.columnCount); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.apps.card.v1.OnClick.encode(message.onClick, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Grid message, length delimited. Does not implicitly {@link google.apps.card.v1.Grid.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Grid + * @static + * @param {google.apps.card.v1.IGrid} message Grid message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Grid.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Grid message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Grid + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Grid} Grid + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Grid.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Grid(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.title = reader.string(); + break; + } + case 2: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.apps.card.v1.Grid.GridItem.decode(reader, reader.uint32())); + break; + } + case 3: { + message.borderStyle = $root.google.apps.card.v1.BorderStyle.decode(reader, reader.uint32()); + break; + } + case 4: { + message.columnCount = reader.int32(); + break; + } + case 5: { + message.onClick = $root.google.apps.card.v1.OnClick.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Grid message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Grid + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Grid} Grid + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Grid.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Grid message. + * @function verify + * @memberof google.apps.card.v1.Grid + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Grid.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.apps.card.v1.Grid.GridItem.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.borderStyle != null && message.hasOwnProperty("borderStyle")) { + var error = $root.google.apps.card.v1.BorderStyle.verify(message.borderStyle); + if (error) + return "borderStyle." + error; + } + if (message.columnCount != null && message.hasOwnProperty("columnCount")) + if (!$util.isInteger(message.columnCount)) + return "columnCount: integer expected"; + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.apps.card.v1.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + return null; + }; + + /** + * Creates a Grid message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Grid + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Grid} Grid + */ + Grid.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Grid) + return object; + var message = new $root.google.apps.card.v1.Grid(); + if (object.title != null) + message.title = String(object.title); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.apps.card.v1.Grid.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.apps.card.v1.Grid.items: object expected"); + message.items[i] = $root.google.apps.card.v1.Grid.GridItem.fromObject(object.items[i]); + } + } + if (object.borderStyle != null) { + if (typeof object.borderStyle !== "object") + throw TypeError(".google.apps.card.v1.Grid.borderStyle: object expected"); + message.borderStyle = $root.google.apps.card.v1.BorderStyle.fromObject(object.borderStyle); + } + if (object.columnCount != null) + message.columnCount = object.columnCount | 0; + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.apps.card.v1.Grid.onClick: object expected"); + message.onClick = $root.google.apps.card.v1.OnClick.fromObject(object.onClick); + } + return message; + }; + + /** + * Creates a plain object from a Grid message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Grid + * @static + * @param {google.apps.card.v1.Grid} message Grid + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Grid.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) { + object.title = ""; + object.borderStyle = null; + object.columnCount = 0; + object.onClick = null; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.apps.card.v1.Grid.GridItem.toObject(message.items[j], options); + } + if (message.borderStyle != null && message.hasOwnProperty("borderStyle")) + object.borderStyle = $root.google.apps.card.v1.BorderStyle.toObject(message.borderStyle, options); + if (message.columnCount != null && message.hasOwnProperty("columnCount")) + object.columnCount = message.columnCount; + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.apps.card.v1.OnClick.toObject(message.onClick, options); + return object; + }; + + /** + * Converts this Grid to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Grid + * @instance + * @returns {Object.} JSON object + */ + Grid.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Grid + * @function getTypeUrl + * @memberof google.apps.card.v1.Grid + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Grid.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Grid"; + }; + + Grid.GridItem = (function() { + + /** + * Properties of a GridItem. + * @memberof google.apps.card.v1.Grid + * @interface IGridItem + * @property {string|null} [id] GridItem id + * @property {google.apps.card.v1.IImageComponent|null} [image] GridItem image + * @property {string|null} [title] GridItem title + * @property {string|null} [subtitle] GridItem subtitle + * @property {google.apps.card.v1.Grid.GridItem.GridItemLayout|null} [layout] GridItem layout + */ + + /** + * Constructs a new GridItem. + * @memberof google.apps.card.v1.Grid + * @classdesc Represents a GridItem. + * @implements IGridItem + * @constructor + * @param {google.apps.card.v1.Grid.IGridItem=} [properties] Properties to set + */ + function GridItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GridItem id. + * @member {string} id + * @memberof google.apps.card.v1.Grid.GridItem + * @instance + */ + GridItem.prototype.id = ""; + + /** + * GridItem image. + * @member {google.apps.card.v1.IImageComponent|null|undefined} image + * @memberof google.apps.card.v1.Grid.GridItem + * @instance + */ + GridItem.prototype.image = null; + + /** + * GridItem title. + * @member {string} title + * @memberof google.apps.card.v1.Grid.GridItem + * @instance + */ + GridItem.prototype.title = ""; + + /** + * GridItem subtitle. + * @member {string} subtitle + * @memberof google.apps.card.v1.Grid.GridItem + * @instance + */ + GridItem.prototype.subtitle = ""; + + /** + * GridItem layout. + * @member {google.apps.card.v1.Grid.GridItem.GridItemLayout} layout + * @memberof google.apps.card.v1.Grid.GridItem + * @instance + */ + GridItem.prototype.layout = 0; + + /** + * Creates a new GridItem instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Grid.GridItem + * @static + * @param {google.apps.card.v1.Grid.IGridItem=} [properties] Properties to set + * @returns {google.apps.card.v1.Grid.GridItem} GridItem instance + */ + GridItem.create = function create(properties) { + return new GridItem(properties); + }; + + /** + * Encodes the specified GridItem message. Does not implicitly {@link google.apps.card.v1.Grid.GridItem.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Grid.GridItem + * @static + * @param {google.apps.card.v1.Grid.IGridItem} message GridItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GridItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.apps.card.v1.ImageComponent.encode(message.image, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.subtitle); + if (message.layout != null && Object.hasOwnProperty.call(message, "layout")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.layout); + return writer; + }; + + /** + * Encodes the specified GridItem message, length delimited. Does not implicitly {@link google.apps.card.v1.Grid.GridItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Grid.GridItem + * @static + * @param {google.apps.card.v1.Grid.IGridItem} message GridItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GridItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GridItem message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Grid.GridItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Grid.GridItem} GridItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GridItem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Grid.GridItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.image = $root.google.apps.card.v1.ImageComponent.decode(reader, reader.uint32()); + break; + } + case 3: { + message.title = reader.string(); + break; + } + case 4: { + message.subtitle = reader.string(); + break; + } + case 9: { + message.layout = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GridItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Grid.GridItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Grid.GridItem} GridItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GridItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GridItem message. + * @function verify + * @memberof google.apps.card.v1.Grid.GridItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GridItem.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.image != null && message.hasOwnProperty("image")) { + var error = $root.google.apps.card.v1.ImageComponent.verify(message.image); + if (error) + return "image." + error; + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + if (message.layout != null && message.hasOwnProperty("layout")) + switch (message.layout) { + default: + return "layout: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GridItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Grid.GridItem + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Grid.GridItem} GridItem + */ + GridItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Grid.GridItem) + return object; + var message = new $root.google.apps.card.v1.Grid.GridItem(); + if (object.id != null) + message.id = String(object.id); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.apps.card.v1.Grid.GridItem.image: object expected"); + message.image = $root.google.apps.card.v1.ImageComponent.fromObject(object.image); + } + if (object.title != null) + message.title = String(object.title); + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + switch (object.layout) { + default: + if (typeof object.layout === "number") { + message.layout = object.layout; + break; + } + break; + case "GRID_ITEM_LAYOUT_UNSPECIFIED": + case 0: + message.layout = 0; + break; + case "TEXT_BELOW": + case 1: + message.layout = 1; + break; + case "TEXT_ABOVE": + case 2: + message.layout = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GridItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Grid.GridItem + * @static + * @param {google.apps.card.v1.Grid.GridItem} message GridItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GridItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.image = null; + object.title = ""; + object.subtitle = ""; + object.layout = options.enums === String ? "GRID_ITEM_LAYOUT_UNSPECIFIED" : 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.apps.card.v1.ImageComponent.toObject(message.image, options); + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + if (message.layout != null && message.hasOwnProperty("layout")) + object.layout = options.enums === String ? $root.google.apps.card.v1.Grid.GridItem.GridItemLayout[message.layout] === undefined ? message.layout : $root.google.apps.card.v1.Grid.GridItem.GridItemLayout[message.layout] : message.layout; + return object; + }; + + /** + * Converts this GridItem to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Grid.GridItem + * @instance + * @returns {Object.} JSON object + */ + GridItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GridItem + * @function getTypeUrl + * @memberof google.apps.card.v1.Grid.GridItem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GridItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Grid.GridItem"; + }; + + /** + * GridItemLayout enum. + * @name google.apps.card.v1.Grid.GridItem.GridItemLayout + * @enum {number} + * @property {number} GRID_ITEM_LAYOUT_UNSPECIFIED=0 GRID_ITEM_LAYOUT_UNSPECIFIED value + * @property {number} TEXT_BELOW=1 TEXT_BELOW value + * @property {number} TEXT_ABOVE=2 TEXT_ABOVE value + */ + GridItem.GridItemLayout = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GRID_ITEM_LAYOUT_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT_BELOW"] = 1; + values[valuesById[2] = "TEXT_ABOVE"] = 2; + return values; + })(); + + return GridItem; + })(); + + return Grid; + })(); + + v1.Columns = (function() { + + /** + * Properties of a Columns. + * @memberof google.apps.card.v1 + * @interface IColumns + * @property {Array.|null} [columnItems] Columns columnItems + */ + + /** + * Constructs a new Columns. + * @memberof google.apps.card.v1 + * @classdesc Represents a Columns. + * @implements IColumns + * @constructor + * @param {google.apps.card.v1.IColumns=} [properties] Properties to set + */ + function Columns(properties) { + this.columnItems = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Columns columnItems. + * @member {Array.} columnItems + * @memberof google.apps.card.v1.Columns + * @instance + */ + Columns.prototype.columnItems = $util.emptyArray; + + /** + * Creates a new Columns instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Columns + * @static + * @param {google.apps.card.v1.IColumns=} [properties] Properties to set + * @returns {google.apps.card.v1.Columns} Columns instance + */ + Columns.create = function create(properties) { + return new Columns(properties); + }; + + /** + * Encodes the specified Columns message. Does not implicitly {@link google.apps.card.v1.Columns.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Columns + * @static + * @param {google.apps.card.v1.IColumns} message Columns message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Columns.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnItems != null && message.columnItems.length) + for (var i = 0; i < message.columnItems.length; ++i) + $root.google.apps.card.v1.Columns.Column.encode(message.columnItems[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Columns message, length delimited. Does not implicitly {@link google.apps.card.v1.Columns.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Columns + * @static + * @param {google.apps.card.v1.IColumns} message Columns message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Columns.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Columns message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Columns + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Columns} Columns + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Columns.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Columns(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.columnItems && message.columnItems.length)) + message.columnItems = []; + message.columnItems.push($root.google.apps.card.v1.Columns.Column.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Columns message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Columns + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Columns} Columns + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Columns.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Columns message. + * @function verify + * @memberof google.apps.card.v1.Columns + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Columns.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnItems != null && message.hasOwnProperty("columnItems")) { + if (!Array.isArray(message.columnItems)) + return "columnItems: array expected"; + for (var i = 0; i < message.columnItems.length; ++i) { + var error = $root.google.apps.card.v1.Columns.Column.verify(message.columnItems[i]); + if (error) + return "columnItems." + error; + } + } + return null; + }; + + /** + * Creates a Columns message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Columns + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Columns} Columns + */ + Columns.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Columns) + return object; + var message = new $root.google.apps.card.v1.Columns(); + if (object.columnItems) { + if (!Array.isArray(object.columnItems)) + throw TypeError(".google.apps.card.v1.Columns.columnItems: array expected"); + message.columnItems = []; + for (var i = 0; i < object.columnItems.length; ++i) { + if (typeof object.columnItems[i] !== "object") + throw TypeError(".google.apps.card.v1.Columns.columnItems: object expected"); + message.columnItems[i] = $root.google.apps.card.v1.Columns.Column.fromObject(object.columnItems[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Columns message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Columns + * @static + * @param {google.apps.card.v1.Columns} message Columns + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Columns.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columnItems = []; + if (message.columnItems && message.columnItems.length) { + object.columnItems = []; + for (var j = 0; j < message.columnItems.length; ++j) + object.columnItems[j] = $root.google.apps.card.v1.Columns.Column.toObject(message.columnItems[j], options); + } + return object; + }; + + /** + * Converts this Columns to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Columns + * @instance + * @returns {Object.} JSON object + */ + Columns.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Columns + * @function getTypeUrl + * @memberof google.apps.card.v1.Columns + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Columns.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Columns"; + }; + + Columns.Column = (function() { + + /** + * Properties of a Column. + * @memberof google.apps.card.v1.Columns + * @interface IColumn + * @property {google.apps.card.v1.Columns.Column.HorizontalSizeStyle|null} [horizontalSizeStyle] Column horizontalSizeStyle + * @property {google.apps.card.v1.Widget.HorizontalAlignment|null} [horizontalAlignment] Column horizontalAlignment + * @property {google.apps.card.v1.Columns.Column.VerticalAlignment|null} [verticalAlignment] Column verticalAlignment + * @property {Array.|null} [widgets] Column widgets + */ + + /** + * Constructs a new Column. + * @memberof google.apps.card.v1.Columns + * @classdesc Represents a Column. + * @implements IColumn + * @constructor + * @param {google.apps.card.v1.Columns.IColumn=} [properties] Properties to set + */ + function Column(properties) { + this.widgets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Column horizontalSizeStyle. + * @member {google.apps.card.v1.Columns.Column.HorizontalSizeStyle} horizontalSizeStyle + * @memberof google.apps.card.v1.Columns.Column + * @instance + */ + Column.prototype.horizontalSizeStyle = 0; + + /** + * Column horizontalAlignment. + * @member {google.apps.card.v1.Widget.HorizontalAlignment} horizontalAlignment + * @memberof google.apps.card.v1.Columns.Column + * @instance + */ + Column.prototype.horizontalAlignment = 0; + + /** + * Column verticalAlignment. + * @member {google.apps.card.v1.Columns.Column.VerticalAlignment} verticalAlignment + * @memberof google.apps.card.v1.Columns.Column + * @instance + */ + Column.prototype.verticalAlignment = 0; + + /** + * Column widgets. + * @member {Array.} widgets + * @memberof google.apps.card.v1.Columns.Column + * @instance + */ + Column.prototype.widgets = $util.emptyArray; + + /** + * Creates a new Column instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Columns.Column + * @static + * @param {google.apps.card.v1.Columns.IColumn=} [properties] Properties to set + * @returns {google.apps.card.v1.Columns.Column} Column instance + */ + Column.create = function create(properties) { + return new Column(properties); + }; + + /** + * Encodes the specified Column message. Does not implicitly {@link google.apps.card.v1.Columns.Column.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Columns.Column + * @static + * @param {google.apps.card.v1.Columns.IColumn} message Column message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Column.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.horizontalSizeStyle != null && Object.hasOwnProperty.call(message, "horizontalSizeStyle")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.horizontalSizeStyle); + if (message.horizontalAlignment != null && Object.hasOwnProperty.call(message, "horizontalAlignment")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.horizontalAlignment); + if (message.verticalAlignment != null && Object.hasOwnProperty.call(message, "verticalAlignment")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verticalAlignment); + if (message.widgets != null && message.widgets.length) + for (var i = 0; i < message.widgets.length; ++i) + $root.google.apps.card.v1.Columns.Column.Widgets.encode(message.widgets[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Column message, length delimited. Does not implicitly {@link google.apps.card.v1.Columns.Column.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Columns.Column + * @static + * @param {google.apps.card.v1.Columns.IColumn} message Column message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Column.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Column message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Columns.Column + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Columns.Column} Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Column.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Columns.Column(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.horizontalSizeStyle = reader.int32(); + break; + } + case 2: { + message.horizontalAlignment = reader.int32(); + break; + } + case 3: { + message.verticalAlignment = reader.int32(); + break; + } + case 4: { + if (!(message.widgets && message.widgets.length)) + message.widgets = []; + message.widgets.push($root.google.apps.card.v1.Columns.Column.Widgets.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Column message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Columns.Column + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Columns.Column} Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Column.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Column message. + * @function verify + * @memberof google.apps.card.v1.Columns.Column + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Column.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.horizontalSizeStyle != null && message.hasOwnProperty("horizontalSizeStyle")) + switch (message.horizontalSizeStyle) { + default: + return "horizontalSizeStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.horizontalAlignment != null && message.hasOwnProperty("horizontalAlignment")) + switch (message.horizontalAlignment) { + default: + return "horizontalAlignment: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.verticalAlignment != null && message.hasOwnProperty("verticalAlignment")) + switch (message.verticalAlignment) { + default: + return "verticalAlignment: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.widgets != null && message.hasOwnProperty("widgets")) { + if (!Array.isArray(message.widgets)) + return "widgets: array expected"; + for (var i = 0; i < message.widgets.length; ++i) { + var error = $root.google.apps.card.v1.Columns.Column.Widgets.verify(message.widgets[i]); + if (error) + return "widgets." + error; + } + } + return null; + }; + + /** + * Creates a Column message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Columns.Column + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Columns.Column} Column + */ + Column.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Columns.Column) + return object; + var message = new $root.google.apps.card.v1.Columns.Column(); + switch (object.horizontalSizeStyle) { + default: + if (typeof object.horizontalSizeStyle === "number") { + message.horizontalSizeStyle = object.horizontalSizeStyle; + break; + } + break; + case "HORIZONTAL_SIZE_STYLE_UNSPECIFIED": + case 0: + message.horizontalSizeStyle = 0; + break; + case "FILL_AVAILABLE_SPACE": + case 1: + message.horizontalSizeStyle = 1; + break; + case "FILL_MINIMUM_SPACE": + case 2: + message.horizontalSizeStyle = 2; + break; + } + switch (object.horizontalAlignment) { + default: + if (typeof object.horizontalAlignment === "number") { + message.horizontalAlignment = object.horizontalAlignment; + break; + } + break; + case "HORIZONTAL_ALIGNMENT_UNSPECIFIED": + case 0: + message.horizontalAlignment = 0; + break; + case "START": + case 1: + message.horizontalAlignment = 1; + break; + case "CENTER": + case 2: + message.horizontalAlignment = 2; + break; + case "END": + case 3: + message.horizontalAlignment = 3; + break; + } + switch (object.verticalAlignment) { + default: + if (typeof object.verticalAlignment === "number") { + message.verticalAlignment = object.verticalAlignment; + break; + } + break; + case "VERTICAL_ALIGNMENT_UNSPECIFIED": + case 0: + message.verticalAlignment = 0; + break; + case "CENTER": + case 1: + message.verticalAlignment = 1; + break; + case "TOP": + case 2: + message.verticalAlignment = 2; + break; + case "BOTTOM": + case 3: + message.verticalAlignment = 3; + break; + } + if (object.widgets) { + if (!Array.isArray(object.widgets)) + throw TypeError(".google.apps.card.v1.Columns.Column.widgets: array expected"); + message.widgets = []; + for (var i = 0; i < object.widgets.length; ++i) { + if (typeof object.widgets[i] !== "object") + throw TypeError(".google.apps.card.v1.Columns.Column.widgets: object expected"); + message.widgets[i] = $root.google.apps.card.v1.Columns.Column.Widgets.fromObject(object.widgets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Column message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Columns.Column + * @static + * @param {google.apps.card.v1.Columns.Column} message Column + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Column.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.widgets = []; + if (options.defaults) { + object.horizontalSizeStyle = options.enums === String ? "HORIZONTAL_SIZE_STYLE_UNSPECIFIED" : 0; + object.horizontalAlignment = options.enums === String ? "HORIZONTAL_ALIGNMENT_UNSPECIFIED" : 0; + object.verticalAlignment = options.enums === String ? "VERTICAL_ALIGNMENT_UNSPECIFIED" : 0; + } + if (message.horizontalSizeStyle != null && message.hasOwnProperty("horizontalSizeStyle")) + object.horizontalSizeStyle = options.enums === String ? $root.google.apps.card.v1.Columns.Column.HorizontalSizeStyle[message.horizontalSizeStyle] === undefined ? message.horizontalSizeStyle : $root.google.apps.card.v1.Columns.Column.HorizontalSizeStyle[message.horizontalSizeStyle] : message.horizontalSizeStyle; + if (message.horizontalAlignment != null && message.hasOwnProperty("horizontalAlignment")) + object.horizontalAlignment = options.enums === String ? $root.google.apps.card.v1.Widget.HorizontalAlignment[message.horizontalAlignment] === undefined ? message.horizontalAlignment : $root.google.apps.card.v1.Widget.HorizontalAlignment[message.horizontalAlignment] : message.horizontalAlignment; + if (message.verticalAlignment != null && message.hasOwnProperty("verticalAlignment")) + object.verticalAlignment = options.enums === String ? $root.google.apps.card.v1.Columns.Column.VerticalAlignment[message.verticalAlignment] === undefined ? message.verticalAlignment : $root.google.apps.card.v1.Columns.Column.VerticalAlignment[message.verticalAlignment] : message.verticalAlignment; + if (message.widgets && message.widgets.length) { + object.widgets = []; + for (var j = 0; j < message.widgets.length; ++j) + object.widgets[j] = $root.google.apps.card.v1.Columns.Column.Widgets.toObject(message.widgets[j], options); + } + return object; + }; + + /** + * Converts this Column to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Columns.Column + * @instance + * @returns {Object.} JSON object + */ + Column.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Column + * @function getTypeUrl + * @memberof google.apps.card.v1.Columns.Column + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Column.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Columns.Column"; + }; + + /** + * HorizontalSizeStyle enum. + * @name google.apps.card.v1.Columns.Column.HorizontalSizeStyle + * @enum {number} + * @property {number} HORIZONTAL_SIZE_STYLE_UNSPECIFIED=0 HORIZONTAL_SIZE_STYLE_UNSPECIFIED value + * @property {number} FILL_AVAILABLE_SPACE=1 FILL_AVAILABLE_SPACE value + * @property {number} FILL_MINIMUM_SPACE=2 FILL_MINIMUM_SPACE value + */ + Column.HorizontalSizeStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HORIZONTAL_SIZE_STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FILL_AVAILABLE_SPACE"] = 1; + values[valuesById[2] = "FILL_MINIMUM_SPACE"] = 2; + return values; + })(); + + /** + * VerticalAlignment enum. + * @name google.apps.card.v1.Columns.Column.VerticalAlignment + * @enum {number} + * @property {number} VERTICAL_ALIGNMENT_UNSPECIFIED=0 VERTICAL_ALIGNMENT_UNSPECIFIED value + * @property {number} CENTER=1 CENTER value + * @property {number} TOP=2 TOP value + * @property {number} BOTTOM=3 BOTTOM value + */ + Column.VerticalAlignment = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VERTICAL_ALIGNMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "CENTER"] = 1; + values[valuesById[2] = "TOP"] = 2; + values[valuesById[3] = "BOTTOM"] = 3; + return values; + })(); + + Column.Widgets = (function() { + + /** + * Properties of a Widgets. + * @memberof google.apps.card.v1.Columns.Column + * @interface IWidgets + * @property {google.apps.card.v1.ITextParagraph|null} [textParagraph] Widgets textParagraph + * @property {google.apps.card.v1.IImage|null} [image] Widgets image + * @property {google.apps.card.v1.IDecoratedText|null} [decoratedText] Widgets decoratedText + * @property {google.apps.card.v1.IButtonList|null} [buttonList] Widgets buttonList + * @property {google.apps.card.v1.ITextInput|null} [textInput] Widgets textInput + * @property {google.apps.card.v1.ISelectionInput|null} [selectionInput] Widgets selectionInput + * @property {google.apps.card.v1.IDateTimePicker|null} [dateTimePicker] Widgets dateTimePicker + */ + + /** + * Constructs a new Widgets. + * @memberof google.apps.card.v1.Columns.Column + * @classdesc Represents a Widgets. + * @implements IWidgets + * @constructor + * @param {google.apps.card.v1.Columns.Column.IWidgets=} [properties] Properties to set + */ + function Widgets(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Widgets textParagraph. + * @member {google.apps.card.v1.ITextParagraph|null|undefined} textParagraph + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @instance + */ + Widgets.prototype.textParagraph = null; + + /** + * Widgets image. + * @member {google.apps.card.v1.IImage|null|undefined} image + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @instance + */ + Widgets.prototype.image = null; + + /** + * Widgets decoratedText. + * @member {google.apps.card.v1.IDecoratedText|null|undefined} decoratedText + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @instance + */ + Widgets.prototype.decoratedText = null; + + /** + * Widgets buttonList. + * @member {google.apps.card.v1.IButtonList|null|undefined} buttonList + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @instance + */ + Widgets.prototype.buttonList = null; + + /** + * Widgets textInput. + * @member {google.apps.card.v1.ITextInput|null|undefined} textInput + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @instance + */ + Widgets.prototype.textInput = null; + + /** + * Widgets selectionInput. + * @member {google.apps.card.v1.ISelectionInput|null|undefined} selectionInput + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @instance + */ + Widgets.prototype.selectionInput = null; + + /** + * Widgets dateTimePicker. + * @member {google.apps.card.v1.IDateTimePicker|null|undefined} dateTimePicker + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @instance + */ + Widgets.prototype.dateTimePicker = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Widgets data. + * @member {"textParagraph"|"image"|"decoratedText"|"buttonList"|"textInput"|"selectionInput"|"dateTimePicker"|undefined} data + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @instance + */ + Object.defineProperty(Widgets.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["textParagraph", "image", "decoratedText", "buttonList", "textInput", "selectionInput", "dateTimePicker"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Widgets instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @static + * @param {google.apps.card.v1.Columns.Column.IWidgets=} [properties] Properties to set + * @returns {google.apps.card.v1.Columns.Column.Widgets} Widgets instance + */ + Widgets.create = function create(properties) { + return new Widgets(properties); + }; + + /** + * Encodes the specified Widgets message. Does not implicitly {@link google.apps.card.v1.Columns.Column.Widgets.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @static + * @param {google.apps.card.v1.Columns.Column.IWidgets} message Widgets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Widgets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textParagraph != null && Object.hasOwnProperty.call(message, "textParagraph")) + $root.google.apps.card.v1.TextParagraph.encode(message.textParagraph, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.apps.card.v1.Image.encode(message.image, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.decoratedText != null && Object.hasOwnProperty.call(message, "decoratedText")) + $root.google.apps.card.v1.DecoratedText.encode(message.decoratedText, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.buttonList != null && Object.hasOwnProperty.call(message, "buttonList")) + $root.google.apps.card.v1.ButtonList.encode(message.buttonList, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.textInput != null && Object.hasOwnProperty.call(message, "textInput")) + $root.google.apps.card.v1.TextInput.encode(message.textInput, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.selectionInput != null && Object.hasOwnProperty.call(message, "selectionInput")) + $root.google.apps.card.v1.SelectionInput.encode(message.selectionInput, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.dateTimePicker != null && Object.hasOwnProperty.call(message, "dateTimePicker")) + $root.google.apps.card.v1.DateTimePicker.encode(message.dateTimePicker, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Widgets message, length delimited. Does not implicitly {@link google.apps.card.v1.Columns.Column.Widgets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @static + * @param {google.apps.card.v1.Columns.Column.IWidgets} message Widgets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Widgets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Widgets message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Columns.Column.Widgets} Widgets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Widgets.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Columns.Column.Widgets(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.textParagraph = $root.google.apps.card.v1.TextParagraph.decode(reader, reader.uint32()); + break; + } + case 2: { + message.image = $root.google.apps.card.v1.Image.decode(reader, reader.uint32()); + break; + } + case 3: { + message.decoratedText = $root.google.apps.card.v1.DecoratedText.decode(reader, reader.uint32()); + break; + } + case 4: { + message.buttonList = $root.google.apps.card.v1.ButtonList.decode(reader, reader.uint32()); + break; + } + case 5: { + message.textInput = $root.google.apps.card.v1.TextInput.decode(reader, reader.uint32()); + break; + } + case 6: { + message.selectionInput = $root.google.apps.card.v1.SelectionInput.decode(reader, reader.uint32()); + break; + } + case 7: { + message.dateTimePicker = $root.google.apps.card.v1.DateTimePicker.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Widgets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Columns.Column.Widgets} Widgets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Widgets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Widgets message. + * @function verify + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Widgets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textParagraph != null && message.hasOwnProperty("textParagraph")) { + properties.data = 1; + { + var error = $root.google.apps.card.v1.TextParagraph.verify(message.textParagraph); + if (error) + return "textParagraph." + error; + } + } + if (message.image != null && message.hasOwnProperty("image")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.decoratedText != null && message.hasOwnProperty("decoratedText")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.DecoratedText.verify(message.decoratedText); + if (error) + return "decoratedText." + error; + } + } + if (message.buttonList != null && message.hasOwnProperty("buttonList")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.ButtonList.verify(message.buttonList); + if (error) + return "buttonList." + error; + } + } + if (message.textInput != null && message.hasOwnProperty("textInput")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.TextInput.verify(message.textInput); + if (error) + return "textInput." + error; + } + } + if (message.selectionInput != null && message.hasOwnProperty("selectionInput")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.SelectionInput.verify(message.selectionInput); + if (error) + return "selectionInput." + error; + } + } + if (message.dateTimePicker != null && message.hasOwnProperty("dateTimePicker")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.DateTimePicker.verify(message.dateTimePicker); + if (error) + return "dateTimePicker." + error; + } + } + return null; + }; + + /** + * Creates a Widgets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Columns.Column.Widgets} Widgets + */ + Widgets.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Columns.Column.Widgets) + return object; + var message = new $root.google.apps.card.v1.Columns.Column.Widgets(); + if (object.textParagraph != null) { + if (typeof object.textParagraph !== "object") + throw TypeError(".google.apps.card.v1.Columns.Column.Widgets.textParagraph: object expected"); + message.textParagraph = $root.google.apps.card.v1.TextParagraph.fromObject(object.textParagraph); + } + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.apps.card.v1.Columns.Column.Widgets.image: object expected"); + message.image = $root.google.apps.card.v1.Image.fromObject(object.image); + } + if (object.decoratedText != null) { + if (typeof object.decoratedText !== "object") + throw TypeError(".google.apps.card.v1.Columns.Column.Widgets.decoratedText: object expected"); + message.decoratedText = $root.google.apps.card.v1.DecoratedText.fromObject(object.decoratedText); + } + if (object.buttonList != null) { + if (typeof object.buttonList !== "object") + throw TypeError(".google.apps.card.v1.Columns.Column.Widgets.buttonList: object expected"); + message.buttonList = $root.google.apps.card.v1.ButtonList.fromObject(object.buttonList); + } + if (object.textInput != null) { + if (typeof object.textInput !== "object") + throw TypeError(".google.apps.card.v1.Columns.Column.Widgets.textInput: object expected"); + message.textInput = $root.google.apps.card.v1.TextInput.fromObject(object.textInput); + } + if (object.selectionInput != null) { + if (typeof object.selectionInput !== "object") + throw TypeError(".google.apps.card.v1.Columns.Column.Widgets.selectionInput: object expected"); + message.selectionInput = $root.google.apps.card.v1.SelectionInput.fromObject(object.selectionInput); + } + if (object.dateTimePicker != null) { + if (typeof object.dateTimePicker !== "object") + throw TypeError(".google.apps.card.v1.Columns.Column.Widgets.dateTimePicker: object expected"); + message.dateTimePicker = $root.google.apps.card.v1.DateTimePicker.fromObject(object.dateTimePicker); + } + return message; + }; + + /** + * Creates a plain object from a Widgets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @static + * @param {google.apps.card.v1.Columns.Column.Widgets} message Widgets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Widgets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.textParagraph != null && message.hasOwnProperty("textParagraph")) { + object.textParagraph = $root.google.apps.card.v1.TextParagraph.toObject(message.textParagraph, options); + if (options.oneofs) + object.data = "textParagraph"; + } + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.apps.card.v1.Image.toObject(message.image, options); + if (options.oneofs) + object.data = "image"; + } + if (message.decoratedText != null && message.hasOwnProperty("decoratedText")) { + object.decoratedText = $root.google.apps.card.v1.DecoratedText.toObject(message.decoratedText, options); + if (options.oneofs) + object.data = "decoratedText"; + } + if (message.buttonList != null && message.hasOwnProperty("buttonList")) { + object.buttonList = $root.google.apps.card.v1.ButtonList.toObject(message.buttonList, options); + if (options.oneofs) + object.data = "buttonList"; + } + if (message.textInput != null && message.hasOwnProperty("textInput")) { + object.textInput = $root.google.apps.card.v1.TextInput.toObject(message.textInput, options); + if (options.oneofs) + object.data = "textInput"; + } + if (message.selectionInput != null && message.hasOwnProperty("selectionInput")) { + object.selectionInput = $root.google.apps.card.v1.SelectionInput.toObject(message.selectionInput, options); + if (options.oneofs) + object.data = "selectionInput"; + } + if (message.dateTimePicker != null && message.hasOwnProperty("dateTimePicker")) { + object.dateTimePicker = $root.google.apps.card.v1.DateTimePicker.toObject(message.dateTimePicker, options); + if (options.oneofs) + object.data = "dateTimePicker"; + } + return object; + }; + + /** + * Converts this Widgets to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @instance + * @returns {Object.} JSON object + */ + Widgets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Widgets + * @function getTypeUrl + * @memberof google.apps.card.v1.Columns.Column.Widgets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Widgets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Columns.Column.Widgets"; + }; + + return Widgets; + })(); + + return Column; + })(); + + return Columns; + })(); + + v1.OnClick = (function() { + + /** + * Properties of an OnClick. + * @memberof google.apps.card.v1 + * @interface IOnClick + * @property {google.apps.card.v1.IAction|null} [action] OnClick action + * @property {google.apps.card.v1.IOpenLink|null} [openLink] OnClick openLink + * @property {google.apps.card.v1.IAction|null} [openDynamicLinkAction] OnClick openDynamicLinkAction + * @property {google.apps.card.v1.ICard|null} [card] OnClick card + */ + + /** + * Constructs a new OnClick. + * @memberof google.apps.card.v1 + * @classdesc Represents an OnClick. + * @implements IOnClick + * @constructor + * @param {google.apps.card.v1.IOnClick=} [properties] Properties to set + */ + function OnClick(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OnClick action. + * @member {google.apps.card.v1.IAction|null|undefined} action + * @memberof google.apps.card.v1.OnClick + * @instance + */ + OnClick.prototype.action = null; + + /** + * OnClick openLink. + * @member {google.apps.card.v1.IOpenLink|null|undefined} openLink + * @memberof google.apps.card.v1.OnClick + * @instance + */ + OnClick.prototype.openLink = null; + + /** + * OnClick openDynamicLinkAction. + * @member {google.apps.card.v1.IAction|null|undefined} openDynamicLinkAction + * @memberof google.apps.card.v1.OnClick + * @instance + */ + OnClick.prototype.openDynamicLinkAction = null; + + /** + * OnClick card. + * @member {google.apps.card.v1.ICard|null|undefined} card + * @memberof google.apps.card.v1.OnClick + * @instance + */ + OnClick.prototype.card = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OnClick data. + * @member {"action"|"openLink"|"openDynamicLinkAction"|"card"|undefined} data + * @memberof google.apps.card.v1.OnClick + * @instance + */ + Object.defineProperty(OnClick.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["action", "openLink", "openDynamicLinkAction", "card"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OnClick instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.OnClick + * @static + * @param {google.apps.card.v1.IOnClick=} [properties] Properties to set + * @returns {google.apps.card.v1.OnClick} OnClick instance + */ + OnClick.create = function create(properties) { + return new OnClick(properties); + }; + + /** + * Encodes the specified OnClick message. Does not implicitly {@link google.apps.card.v1.OnClick.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.OnClick + * @static + * @param {google.apps.card.v1.IOnClick} message OnClick message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnClick.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.apps.card.v1.Action.encode(message.action, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.openLink != null && Object.hasOwnProperty.call(message, "openLink")) + $root.google.apps.card.v1.OpenLink.encode(message.openLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.openDynamicLinkAction != null && Object.hasOwnProperty.call(message, "openDynamicLinkAction")) + $root.google.apps.card.v1.Action.encode(message.openDynamicLinkAction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.card != null && Object.hasOwnProperty.call(message, "card")) + $root.google.apps.card.v1.Card.encode(message.card, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OnClick message, length delimited. Does not implicitly {@link google.apps.card.v1.OnClick.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.OnClick + * @static + * @param {google.apps.card.v1.IOnClick} message OnClick message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnClick.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OnClick message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.OnClick + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.OnClick} OnClick + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnClick.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.OnClick(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = $root.google.apps.card.v1.Action.decode(reader, reader.uint32()); + break; + } + case 2: { + message.openLink = $root.google.apps.card.v1.OpenLink.decode(reader, reader.uint32()); + break; + } + case 3: { + message.openDynamicLinkAction = $root.google.apps.card.v1.Action.decode(reader, reader.uint32()); + break; + } + case 4: { + message.card = $root.google.apps.card.v1.Card.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OnClick message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.OnClick + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.OnClick} OnClick + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnClick.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OnClick message. + * @function verify + * @memberof google.apps.card.v1.OnClick + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnClick.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.action != null && message.hasOwnProperty("action")) { + properties.data = 1; + { + var error = $root.google.apps.card.v1.Action.verify(message.action); + if (error) + return "action." + error; + } + } + if (message.openLink != null && message.hasOwnProperty("openLink")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.OpenLink.verify(message.openLink); + if (error) + return "openLink." + error; + } + } + if (message.openDynamicLinkAction != null && message.hasOwnProperty("openDynamicLinkAction")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.Action.verify(message.openDynamicLinkAction); + if (error) + return "openDynamicLinkAction." + error; + } + } + if (message.card != null && message.hasOwnProperty("card")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.apps.card.v1.Card.verify(message.card); + if (error) + return "card." + error; + } + } + return null; + }; + + /** + * Creates an OnClick message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.OnClick + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.OnClick} OnClick + */ + OnClick.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.OnClick) + return object; + var message = new $root.google.apps.card.v1.OnClick(); + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.apps.card.v1.OnClick.action: object expected"); + message.action = $root.google.apps.card.v1.Action.fromObject(object.action); + } + if (object.openLink != null) { + if (typeof object.openLink !== "object") + throw TypeError(".google.apps.card.v1.OnClick.openLink: object expected"); + message.openLink = $root.google.apps.card.v1.OpenLink.fromObject(object.openLink); + } + if (object.openDynamicLinkAction != null) { + if (typeof object.openDynamicLinkAction !== "object") + throw TypeError(".google.apps.card.v1.OnClick.openDynamicLinkAction: object expected"); + message.openDynamicLinkAction = $root.google.apps.card.v1.Action.fromObject(object.openDynamicLinkAction); + } + if (object.card != null) { + if (typeof object.card !== "object") + throw TypeError(".google.apps.card.v1.OnClick.card: object expected"); + message.card = $root.google.apps.card.v1.Card.fromObject(object.card); + } + return message; + }; + + /** + * Creates a plain object from an OnClick message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.OnClick + * @static + * @param {google.apps.card.v1.OnClick} message OnClick + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnClick.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.action != null && message.hasOwnProperty("action")) { + object.action = $root.google.apps.card.v1.Action.toObject(message.action, options); + if (options.oneofs) + object.data = "action"; + } + if (message.openLink != null && message.hasOwnProperty("openLink")) { + object.openLink = $root.google.apps.card.v1.OpenLink.toObject(message.openLink, options); + if (options.oneofs) + object.data = "openLink"; + } + if (message.openDynamicLinkAction != null && message.hasOwnProperty("openDynamicLinkAction")) { + object.openDynamicLinkAction = $root.google.apps.card.v1.Action.toObject(message.openDynamicLinkAction, options); + if (options.oneofs) + object.data = "openDynamicLinkAction"; + } + if (message.card != null && message.hasOwnProperty("card")) { + object.card = $root.google.apps.card.v1.Card.toObject(message.card, options); + if (options.oneofs) + object.data = "card"; + } + return object; + }; + + /** + * Converts this OnClick to JSON. + * @function toJSON + * @memberof google.apps.card.v1.OnClick + * @instance + * @returns {Object.} JSON object + */ + OnClick.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OnClick + * @function getTypeUrl + * @memberof google.apps.card.v1.OnClick + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnClick.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.OnClick"; + }; + + return OnClick; + })(); + + v1.OpenLink = (function() { + + /** + * Properties of an OpenLink. + * @memberof google.apps.card.v1 + * @interface IOpenLink + * @property {string|null} [url] OpenLink url + * @property {google.apps.card.v1.OpenLink.OpenAs|null} [openAs] OpenLink openAs + * @property {google.apps.card.v1.OpenLink.OnClose|null} [onClose] OpenLink onClose + */ + + /** + * Constructs a new OpenLink. + * @memberof google.apps.card.v1 + * @classdesc Represents an OpenLink. + * @implements IOpenLink + * @constructor + * @param {google.apps.card.v1.IOpenLink=} [properties] Properties to set + */ + function OpenLink(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenLink url. + * @member {string} url + * @memberof google.apps.card.v1.OpenLink + * @instance + */ + OpenLink.prototype.url = ""; + + /** + * OpenLink openAs. + * @member {google.apps.card.v1.OpenLink.OpenAs} openAs + * @memberof google.apps.card.v1.OpenLink + * @instance + */ + OpenLink.prototype.openAs = 0; + + /** + * OpenLink onClose. + * @member {google.apps.card.v1.OpenLink.OnClose} onClose + * @memberof google.apps.card.v1.OpenLink + * @instance + */ + OpenLink.prototype.onClose = 0; + + /** + * Creates a new OpenLink instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.OpenLink + * @static + * @param {google.apps.card.v1.IOpenLink=} [properties] Properties to set + * @returns {google.apps.card.v1.OpenLink} OpenLink instance + */ + OpenLink.create = function create(properties) { + return new OpenLink(properties); + }; + + /** + * Encodes the specified OpenLink message. Does not implicitly {@link google.apps.card.v1.OpenLink.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.OpenLink + * @static + * @param {google.apps.card.v1.IOpenLink} message OpenLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenLink.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.openAs != null && Object.hasOwnProperty.call(message, "openAs")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.openAs); + if (message.onClose != null && Object.hasOwnProperty.call(message, "onClose")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.onClose); + return writer; + }; + + /** + * Encodes the specified OpenLink message, length delimited. Does not implicitly {@link google.apps.card.v1.OpenLink.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.OpenLink + * @static + * @param {google.apps.card.v1.IOpenLink} message OpenLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenLink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenLink message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.OpenLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.OpenLink} OpenLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenLink.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.OpenLink(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.url = reader.string(); + break; + } + case 2: { + message.openAs = reader.int32(); + break; + } + case 3: { + message.onClose = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenLink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.OpenLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.OpenLink} OpenLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenLink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenLink message. + * @function verify + * @memberof google.apps.card.v1.OpenLink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenLink.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.openAs != null && message.hasOwnProperty("openAs")) + switch (message.openAs) { + default: + return "openAs: enum value expected"; + case 0: + case 1: + break; + } + if (message.onClose != null && message.hasOwnProperty("onClose")) + switch (message.onClose) { + default: + return "onClose: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an OpenLink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.OpenLink + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.OpenLink} OpenLink + */ + OpenLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.OpenLink) + return object; + var message = new $root.google.apps.card.v1.OpenLink(); + if (object.url != null) + message.url = String(object.url); + switch (object.openAs) { + default: + if (typeof object.openAs === "number") { + message.openAs = object.openAs; + break; + } + break; + case "FULL_SIZE": + case 0: + message.openAs = 0; + break; + case "OVERLAY": + case 1: + message.openAs = 1; + break; + } + switch (object.onClose) { + default: + if (typeof object.onClose === "number") { + message.onClose = object.onClose; + break; + } + break; + case "NOTHING": + case 0: + message.onClose = 0; + break; + case "RELOAD": + case 1: + message.onClose = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an OpenLink message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.OpenLink + * @static + * @param {google.apps.card.v1.OpenLink} message OpenLink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenLink.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + object.openAs = options.enums === String ? "FULL_SIZE" : 0; + object.onClose = options.enums === String ? "NOTHING" : 0; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.openAs != null && message.hasOwnProperty("openAs")) + object.openAs = options.enums === String ? $root.google.apps.card.v1.OpenLink.OpenAs[message.openAs] === undefined ? message.openAs : $root.google.apps.card.v1.OpenLink.OpenAs[message.openAs] : message.openAs; + if (message.onClose != null && message.hasOwnProperty("onClose")) + object.onClose = options.enums === String ? $root.google.apps.card.v1.OpenLink.OnClose[message.onClose] === undefined ? message.onClose : $root.google.apps.card.v1.OpenLink.OnClose[message.onClose] : message.onClose; + return object; + }; + + /** + * Converts this OpenLink to JSON. + * @function toJSON + * @memberof google.apps.card.v1.OpenLink + * @instance + * @returns {Object.} JSON object + */ + OpenLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenLink + * @function getTypeUrl + * @memberof google.apps.card.v1.OpenLink + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.OpenLink"; + }; + + /** + * OpenAs enum. + * @name google.apps.card.v1.OpenLink.OpenAs + * @enum {number} + * @property {number} FULL_SIZE=0 FULL_SIZE value + * @property {number} OVERLAY=1 OVERLAY value + */ + OpenLink.OpenAs = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_SIZE"] = 0; + values[valuesById[1] = "OVERLAY"] = 1; + return values; + })(); + + /** + * OnClose enum. + * @name google.apps.card.v1.OpenLink.OnClose + * @enum {number} + * @property {number} NOTHING=0 NOTHING value + * @property {number} RELOAD=1 RELOAD value + */ + OpenLink.OnClose = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NOTHING"] = 0; + values[valuesById[1] = "RELOAD"] = 1; + return values; + })(); + + return OpenLink; + })(); + + v1.Action = (function() { + + /** + * Properties of an Action. + * @memberof google.apps.card.v1 + * @interface IAction + * @property {string|null} ["function"] Action function + * @property {Array.|null} [parameters] Action parameters + * @property {google.apps.card.v1.Action.LoadIndicator|null} [loadIndicator] Action loadIndicator + * @property {boolean|null} [persistValues] Action persistValues + * @property {google.apps.card.v1.Action.Interaction|null} [interaction] Action interaction + */ + + /** + * Constructs a new Action. + * @memberof google.apps.card.v1 + * @classdesc Represents an Action. + * @implements IAction + * @constructor + * @param {google.apps.card.v1.IAction=} [properties] Properties to set + */ + function Action(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Action function. + * @member {string} function + * @memberof google.apps.card.v1.Action + * @instance + */ + Action.prototype["function"] = ""; + + /** + * Action parameters. + * @member {Array.} parameters + * @memberof google.apps.card.v1.Action + * @instance + */ + Action.prototype.parameters = $util.emptyArray; + + /** + * Action loadIndicator. + * @member {google.apps.card.v1.Action.LoadIndicator} loadIndicator + * @memberof google.apps.card.v1.Action + * @instance + */ + Action.prototype.loadIndicator = 0; + + /** + * Action persistValues. + * @member {boolean} persistValues + * @memberof google.apps.card.v1.Action + * @instance + */ + Action.prototype.persistValues = false; + + /** + * Action interaction. + * @member {google.apps.card.v1.Action.Interaction} interaction + * @memberof google.apps.card.v1.Action + * @instance + */ + Action.prototype.interaction = 0; + + /** + * Creates a new Action instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Action + * @static + * @param {google.apps.card.v1.IAction=} [properties] Properties to set + * @returns {google.apps.card.v1.Action} Action instance + */ + Action.create = function create(properties) { + return new Action(properties); + }; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.apps.card.v1.Action.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Action + * @static + * @param {google.apps.card.v1.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message["function"] != null && Object.hasOwnProperty.call(message, "function")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message["function"]); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.apps.card.v1.Action.ActionParameter.encode(message.parameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.loadIndicator != null && Object.hasOwnProperty.call(message, "loadIndicator")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.loadIndicator); + if (message.persistValues != null && Object.hasOwnProperty.call(message, "persistValues")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.persistValues); + if (message.interaction != null && Object.hasOwnProperty.call(message, "interaction")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.interaction); + return writer; + }; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.apps.card.v1.Action.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Action + * @static + * @param {google.apps.card.v1.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Action message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Action(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message["function"] = reader.string(); + break; + } + case 2: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.apps.card.v1.Action.ActionParameter.decode(reader, reader.uint32())); + break; + } + case 3: { + message.loadIndicator = reader.int32(); + break; + } + case 4: { + message.persistValues = reader.bool(); + break; + } + case 5: { + message.interaction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Action message. + * @function verify + * @memberof google.apps.card.v1.Action + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Action.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message["function"] != null && message.hasOwnProperty("function")) + if (!$util.isString(message["function"])) + return "function: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.apps.card.v1.Action.ActionParameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + if (message.loadIndicator != null && message.hasOwnProperty("loadIndicator")) + switch (message.loadIndicator) { + default: + return "loadIndicator: enum value expected"; + case 0: + case 1: + break; + } + if (message.persistValues != null && message.hasOwnProperty("persistValues")) + if (typeof message.persistValues !== "boolean") + return "persistValues: boolean expected"; + if (message.interaction != null && message.hasOwnProperty("interaction")) + switch (message.interaction) { + default: + return "interaction: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Action + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Action} Action + */ + Action.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Action) + return object; + var message = new $root.google.apps.card.v1.Action(); + if (object["function"] != null) + message["function"] = String(object["function"]); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.apps.card.v1.Action.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.apps.card.v1.Action.parameters: object expected"); + message.parameters[i] = $root.google.apps.card.v1.Action.ActionParameter.fromObject(object.parameters[i]); + } + } + switch (object.loadIndicator) { + default: + if (typeof object.loadIndicator === "number") { + message.loadIndicator = object.loadIndicator; + break; + } + break; + case "SPINNER": + case 0: + message.loadIndicator = 0; + break; + case "NONE": + case 1: + message.loadIndicator = 1; + break; + } + if (object.persistValues != null) + message.persistValues = Boolean(object.persistValues); + switch (object.interaction) { + default: + if (typeof object.interaction === "number") { + message.interaction = object.interaction; + break; + } + break; + case "INTERACTION_UNSPECIFIED": + case 0: + message.interaction = 0; + break; + case "OPEN_DIALOG": + case 1: + message.interaction = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Action + * @static + * @param {google.apps.card.v1.Action} message Action + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Action.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (options.defaults) { + object["function"] = ""; + object.loadIndicator = options.enums === String ? "SPINNER" : 0; + object.persistValues = false; + object.interaction = options.enums === String ? "INTERACTION_UNSPECIFIED" : 0; + } + if (message["function"] != null && message.hasOwnProperty("function")) + object["function"] = message["function"]; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.apps.card.v1.Action.ActionParameter.toObject(message.parameters[j], options); + } + if (message.loadIndicator != null && message.hasOwnProperty("loadIndicator")) + object.loadIndicator = options.enums === String ? $root.google.apps.card.v1.Action.LoadIndicator[message.loadIndicator] === undefined ? message.loadIndicator : $root.google.apps.card.v1.Action.LoadIndicator[message.loadIndicator] : message.loadIndicator; + if (message.persistValues != null && message.hasOwnProperty("persistValues")) + object.persistValues = message.persistValues; + if (message.interaction != null && message.hasOwnProperty("interaction")) + object.interaction = options.enums === String ? $root.google.apps.card.v1.Action.Interaction[message.interaction] === undefined ? message.interaction : $root.google.apps.card.v1.Action.Interaction[message.interaction] : message.interaction; + return object; + }; + + /** + * Converts this Action to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Action + * @instance + * @returns {Object.} JSON object + */ + Action.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Action + * @function getTypeUrl + * @memberof google.apps.card.v1.Action + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Action"; + }; + + Action.ActionParameter = (function() { + + /** + * Properties of an ActionParameter. + * @memberof google.apps.card.v1.Action + * @interface IActionParameter + * @property {string|null} [key] ActionParameter key + * @property {string|null} [value] ActionParameter value + */ + + /** + * Constructs a new ActionParameter. + * @memberof google.apps.card.v1.Action + * @classdesc Represents an ActionParameter. + * @implements IActionParameter + * @constructor + * @param {google.apps.card.v1.Action.IActionParameter=} [properties] Properties to set + */ + function ActionParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActionParameter key. + * @member {string} key + * @memberof google.apps.card.v1.Action.ActionParameter + * @instance + */ + ActionParameter.prototype.key = ""; + + /** + * ActionParameter value. + * @member {string} value + * @memberof google.apps.card.v1.Action.ActionParameter + * @instance + */ + ActionParameter.prototype.value = ""; + + /** + * Creates a new ActionParameter instance using the specified properties. + * @function create + * @memberof google.apps.card.v1.Action.ActionParameter + * @static + * @param {google.apps.card.v1.Action.IActionParameter=} [properties] Properties to set + * @returns {google.apps.card.v1.Action.ActionParameter} ActionParameter instance + */ + ActionParameter.create = function create(properties) { + return new ActionParameter(properties); + }; + + /** + * Encodes the specified ActionParameter message. Does not implicitly {@link google.apps.card.v1.Action.ActionParameter.verify|verify} messages. + * @function encode + * @memberof google.apps.card.v1.Action.ActionParameter + * @static + * @param {google.apps.card.v1.Action.IActionParameter} message ActionParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified ActionParameter message, length delimited. Does not implicitly {@link google.apps.card.v1.Action.ActionParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.card.v1.Action.ActionParameter + * @static + * @param {google.apps.card.v1.Action.IActionParameter} message ActionParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionParameter message from the specified reader or buffer. + * @function decode + * @memberof google.apps.card.v1.Action.ActionParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.card.v1.Action.ActionParameter} ActionParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionParameter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.card.v1.Action.ActionParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.card.v1.Action.ActionParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.card.v1.Action.ActionParameter} ActionParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionParameter message. + * @function verify + * @memberof google.apps.card.v1.Action.ActionParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an ActionParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.card.v1.Action.ActionParameter + * @static + * @param {Object.} object Plain object + * @returns {google.apps.card.v1.Action.ActionParameter} ActionParameter + */ + ActionParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.card.v1.Action.ActionParameter) + return object; + var message = new $root.google.apps.card.v1.Action.ActionParameter(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an ActionParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.card.v1.Action.ActionParameter + * @static + * @param {google.apps.card.v1.Action.ActionParameter} message ActionParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.value = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this ActionParameter to JSON. + * @function toJSON + * @memberof google.apps.card.v1.Action.ActionParameter + * @instance + * @returns {Object.} JSON object + */ + ActionParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActionParameter + * @function getTypeUrl + * @memberof google.apps.card.v1.Action.ActionParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActionParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.card.v1.Action.ActionParameter"; + }; + + return ActionParameter; + })(); + + /** + * LoadIndicator enum. + * @name google.apps.card.v1.Action.LoadIndicator + * @enum {number} + * @property {number} SPINNER=0 SPINNER value + * @property {number} NONE=1 NONE value + */ + Action.LoadIndicator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPINNER"] = 0; + values[valuesById[1] = "NONE"] = 1; + return values; + })(); + + /** + * Interaction enum. + * @name google.apps.card.v1.Action.Interaction + * @enum {number} + * @property {number} INTERACTION_UNSPECIFIED=0 INTERACTION_UNSPECIFIED value + * @property {number} OPEN_DIALOG=1 OPEN_DIALOG value + */ + Action.Interaction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPEN_DIALOG"] = 1; + return values; + })(); + + return Action; + })(); + + return v1; + })(); + + return card; + })(); + + return apps; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Color = (function() { + + /** + * Properties of a Color. + * @memberof google.type + * @interface IColor + * @property {number|null} [red] Color red + * @property {number|null} [green] Color green + * @property {number|null} [blue] Color blue + * @property {google.protobuf.IFloatValue|null} [alpha] Color alpha + */ + + /** + * Constructs a new Color. + * @memberof google.type + * @classdesc Represents a Color. + * @implements IColor + * @constructor + * @param {google.type.IColor=} [properties] Properties to set + */ + function Color(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Color red. + * @member {number} red + * @memberof google.type.Color + * @instance + */ + Color.prototype.red = 0; + + /** + * Color green. + * @member {number} green + * @memberof google.type.Color + * @instance + */ + Color.prototype.green = 0; + + /** + * Color blue. + * @member {number} blue + * @memberof google.type.Color + * @instance + */ + Color.prototype.blue = 0; + + /** + * Color alpha. + * @member {google.protobuf.IFloatValue|null|undefined} alpha + * @memberof google.type.Color + * @instance + */ + Color.prototype.alpha = null; + + /** + * Creates a new Color instance using the specified properties. + * @function create + * @memberof google.type.Color + * @static + * @param {google.type.IColor=} [properties] Properties to set + * @returns {google.type.Color} Color instance + */ + Color.create = function create(properties) { + return new Color(properties); + }; + + /** + * Encodes the specified Color message. Does not implicitly {@link google.type.Color.verify|verify} messages. + * @function encode + * @memberof google.type.Color + * @static + * @param {google.type.IColor} message Color message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Color.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.red != null && Object.hasOwnProperty.call(message, "red")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.red); + if (message.green != null && Object.hasOwnProperty.call(message, "green")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.green); + if (message.blue != null && Object.hasOwnProperty.call(message, "blue")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.blue); + if (message.alpha != null && Object.hasOwnProperty.call(message, "alpha")) + $root.google.protobuf.FloatValue.encode(message.alpha, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Color message, length delimited. Does not implicitly {@link google.type.Color.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Color + * @static + * @param {google.type.IColor} message Color message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Color.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Color message from the specified reader or buffer. + * @function decode + * @memberof google.type.Color + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Color} Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Color.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Color(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.red = reader.float(); + break; + } + case 2: { + message.green = reader.float(); + break; + } + case 3: { + message.blue = reader.float(); + break; + } + case 4: { + message.alpha = $root.google.protobuf.FloatValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Color message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Color + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Color} Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Color.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Color message. + * @function verify + * @memberof google.type.Color + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Color.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.red != null && message.hasOwnProperty("red")) + if (typeof message.red !== "number") + return "red: number expected"; + if (message.green != null && message.hasOwnProperty("green")) + if (typeof message.green !== "number") + return "green: number expected"; + if (message.blue != null && message.hasOwnProperty("blue")) + if (typeof message.blue !== "number") + return "blue: number expected"; + if (message.alpha != null && message.hasOwnProperty("alpha")) { + var error = $root.google.protobuf.FloatValue.verify(message.alpha); + if (error) + return "alpha." + error; + } + return null; + }; + + /** + * Creates a Color message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Color + * @static + * @param {Object.} object Plain object + * @returns {google.type.Color} Color + */ + Color.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Color) + return object; + var message = new $root.google.type.Color(); + if (object.red != null) + message.red = Number(object.red); + if (object.green != null) + message.green = Number(object.green); + if (object.blue != null) + message.blue = Number(object.blue); + if (object.alpha != null) { + if (typeof object.alpha !== "object") + throw TypeError(".google.type.Color.alpha: object expected"); + message.alpha = $root.google.protobuf.FloatValue.fromObject(object.alpha); + } + return message; + }; + + /** + * Creates a plain object from a Color message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Color + * @static + * @param {google.type.Color} message Color + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Color.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.red = 0; + object.green = 0; + object.blue = 0; + object.alpha = null; + } + if (message.red != null && message.hasOwnProperty("red")) + object.red = options.json && !isFinite(message.red) ? String(message.red) : message.red; + if (message.green != null && message.hasOwnProperty("green")) + object.green = options.json && !isFinite(message.green) ? String(message.green) : message.green; + if (message.blue != null && message.hasOwnProperty("blue")) + object.blue = options.json && !isFinite(message.blue) ? String(message.blue) : message.blue; + if (message.alpha != null && message.hasOwnProperty("alpha")) + object.alpha = $root.google.protobuf.FloatValue.toObject(message.alpha, options); + return object; + }; + + /** + * Converts this Color to JSON. + * @function toJSON + * @memberof google.type.Color + * @instance + * @returns {Object.} JSON object + */ + Color.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Color + * @function getTypeUrl + * @memberof google.type.Color + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Color.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Color"; + }; + + return Color; + })(); + + return type; + })(); + + google.chat = (function() { + + /** + * Namespace chat. + * @memberof google + * @namespace + */ + var chat = {}; + + chat.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.chat + * @namespace + */ + var v1 = {}; + + v1.ActionStatus = (function() { + + /** + * Properties of an ActionStatus. + * @memberof google.chat.v1 + * @interface IActionStatus + * @property {google.rpc.Code|null} [statusCode] ActionStatus statusCode + * @property {string|null} [userFacingMessage] ActionStatus userFacingMessage + */ + + /** + * Constructs a new ActionStatus. + * @memberof google.chat.v1 + * @classdesc Represents an ActionStatus. + * @implements IActionStatus + * @constructor + * @param {google.chat.v1.IActionStatus=} [properties] Properties to set + */ + function ActionStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActionStatus statusCode. + * @member {google.rpc.Code} statusCode + * @memberof google.chat.v1.ActionStatus + * @instance + */ + ActionStatus.prototype.statusCode = 0; + + /** + * ActionStatus userFacingMessage. + * @member {string} userFacingMessage + * @memberof google.chat.v1.ActionStatus + * @instance + */ + ActionStatus.prototype.userFacingMessage = ""; + + /** + * Creates a new ActionStatus instance using the specified properties. + * @function create + * @memberof google.chat.v1.ActionStatus + * @static + * @param {google.chat.v1.IActionStatus=} [properties] Properties to set + * @returns {google.chat.v1.ActionStatus} ActionStatus instance + */ + ActionStatus.create = function create(properties) { + return new ActionStatus(properties); + }; + + /** + * Encodes the specified ActionStatus message. Does not implicitly {@link google.chat.v1.ActionStatus.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ActionStatus + * @static + * @param {google.chat.v1.IActionStatus} message ActionStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.statusCode != null && Object.hasOwnProperty.call(message, "statusCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.statusCode); + if (message.userFacingMessage != null && Object.hasOwnProperty.call(message, "userFacingMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userFacingMessage); + return writer; + }; + + /** + * Encodes the specified ActionStatus message, length delimited. Does not implicitly {@link google.chat.v1.ActionStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ActionStatus + * @static + * @param {google.chat.v1.IActionStatus} message ActionStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionStatus message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ActionStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ActionStatus} ActionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ActionStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.statusCode = reader.int32(); + break; + } + case 2: { + message.userFacingMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ActionStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ActionStatus} ActionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionStatus message. + * @function verify + * @memberof google.chat.v1.ActionStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.statusCode != null && message.hasOwnProperty("statusCode")) + switch (message.statusCode) { + default: + return "statusCode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 16: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.userFacingMessage != null && message.hasOwnProperty("userFacingMessage")) + if (!$util.isString(message.userFacingMessage)) + return "userFacingMessage: string expected"; + return null; + }; + + /** + * Creates an ActionStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ActionStatus + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ActionStatus} ActionStatus + */ + ActionStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ActionStatus) + return object; + var message = new $root.google.chat.v1.ActionStatus(); + switch (object.statusCode) { + default: + if (typeof object.statusCode === "number") { + message.statusCode = object.statusCode; + break; + } + break; + case "OK": + case 0: + message.statusCode = 0; + break; + case "CANCELLED": + case 1: + message.statusCode = 1; + break; + case "UNKNOWN": + case 2: + message.statusCode = 2; + break; + case "INVALID_ARGUMENT": + case 3: + message.statusCode = 3; + break; + case "DEADLINE_EXCEEDED": + case 4: + message.statusCode = 4; + break; + case "NOT_FOUND": + case 5: + message.statusCode = 5; + break; + case "ALREADY_EXISTS": + case 6: + message.statusCode = 6; + break; + case "PERMISSION_DENIED": + case 7: + message.statusCode = 7; + break; + case "UNAUTHENTICATED": + case 16: + message.statusCode = 16; + break; + case "RESOURCE_EXHAUSTED": + case 8: + message.statusCode = 8; + break; + case "FAILED_PRECONDITION": + case 9: + message.statusCode = 9; + break; + case "ABORTED": + case 10: + message.statusCode = 10; + break; + case "OUT_OF_RANGE": + case 11: + message.statusCode = 11; + break; + case "UNIMPLEMENTED": + case 12: + message.statusCode = 12; + break; + case "INTERNAL": + case 13: + message.statusCode = 13; + break; + case "UNAVAILABLE": + case 14: + message.statusCode = 14; + break; + case "DATA_LOSS": + case 15: + message.statusCode = 15; + break; + } + if (object.userFacingMessage != null) + message.userFacingMessage = String(object.userFacingMessage); + return message; + }; + + /** + * Creates a plain object from an ActionStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ActionStatus + * @static + * @param {google.chat.v1.ActionStatus} message ActionStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.statusCode = options.enums === String ? "OK" : 0; + object.userFacingMessage = ""; + } + if (message.statusCode != null && message.hasOwnProperty("statusCode")) + object.statusCode = options.enums === String ? $root.google.rpc.Code[message.statusCode] === undefined ? message.statusCode : $root.google.rpc.Code[message.statusCode] : message.statusCode; + if (message.userFacingMessage != null && message.hasOwnProperty("userFacingMessage")) + object.userFacingMessage = message.userFacingMessage; + return object; + }; + + /** + * Converts this ActionStatus to JSON. + * @function toJSON + * @memberof google.chat.v1.ActionStatus + * @instance + * @returns {Object.} JSON object + */ + ActionStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActionStatus + * @function getTypeUrl + * @memberof google.chat.v1.ActionStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActionStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ActionStatus"; + }; + + return ActionStatus; + })(); + + v1.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.chat.v1 + * @interface IAnnotation + * @property {google.chat.v1.AnnotationType|null} [type] Annotation type + * @property {number|null} [startIndex] Annotation startIndex + * @property {number|null} [length] Annotation length + * @property {google.chat.v1.IUserMentionMetadata|null} [userMention] Annotation userMention + * @property {google.chat.v1.ISlashCommandMetadata|null} [slashCommand] Annotation slashCommand + * @property {google.chat.v1.IRichLinkMetadata|null} [richLinkMetadata] Annotation richLinkMetadata + */ + + /** + * Constructs a new Annotation. + * @memberof google.chat.v1 + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.chat.v1.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + if (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 type. + * @member {google.chat.v1.AnnotationType} type + * @memberof google.chat.v1.Annotation + * @instance + */ + Annotation.prototype.type = 0; + + /** + * Annotation startIndex. + * @member {number|null|undefined} startIndex + * @memberof google.chat.v1.Annotation + * @instance + */ + Annotation.prototype.startIndex = null; + + /** + * Annotation length. + * @member {number} length + * @memberof google.chat.v1.Annotation + * @instance + */ + Annotation.prototype.length = 0; + + /** + * Annotation userMention. + * @member {google.chat.v1.IUserMentionMetadata|null|undefined} userMention + * @memberof google.chat.v1.Annotation + * @instance + */ + Annotation.prototype.userMention = null; + + /** + * Annotation slashCommand. + * @member {google.chat.v1.ISlashCommandMetadata|null|undefined} slashCommand + * @memberof google.chat.v1.Annotation + * @instance + */ + Annotation.prototype.slashCommand = null; + + /** + * Annotation richLinkMetadata. + * @member {google.chat.v1.IRichLinkMetadata|null|undefined} richLinkMetadata + * @memberof google.chat.v1.Annotation + * @instance + */ + Annotation.prototype.richLinkMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Annotation _startIndex. + * @member {"startIndex"|undefined} _startIndex + * @memberof google.chat.v1.Annotation + * @instance + */ + Object.defineProperty(Annotation.prototype, "_startIndex", { + get: $util.oneOfGetter($oneOfFields = ["startIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Annotation metadata. + * @member {"userMention"|"slashCommand"|"richLinkMetadata"|undefined} metadata + * @memberof google.chat.v1.Annotation + * @instance + */ + Object.defineProperty(Annotation.prototype, "metadata", { + get: $util.oneOfGetter($oneOfFields = ["userMention", "slashCommand", "richLinkMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.chat.v1.Annotation + * @static + * @param {google.chat.v1.IAnnotation=} [properties] Properties to set + * @returns {google.chat.v1.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.chat.v1.Annotation.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Annotation + * @static + * @param {google.chat.v1.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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.startIndex); + if (message.length != null && Object.hasOwnProperty.call(message, "length")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.length); + if (message.userMention != null && Object.hasOwnProperty.call(message, "userMention")) + $root.google.chat.v1.UserMentionMetadata.encode(message.userMention, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.slashCommand != null && Object.hasOwnProperty.call(message, "slashCommand")) + $root.google.chat.v1.SlashCommandMetadata.encode(message.slashCommand, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.richLinkMetadata != null && Object.hasOwnProperty.call(message, "richLinkMetadata")) + $root.google.chat.v1.RichLinkMetadata.encode(message.richLinkMetadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.chat.v1.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Annotation + * @static + * @param {google.chat.v1.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.chat.v1.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.startIndex = reader.int32(); + break; + } + case 3: { + message.length = reader.int32(); + break; + } + case 4: { + message.userMention = $root.google.chat.v1.UserMentionMetadata.decode(reader, reader.uint32()); + break; + } + case 5: { + message.slashCommand = $root.google.chat.v1.SlashCommandMetadata.decode(reader, reader.uint32()); + break; + } + case 6: { + message.richLinkMetadata = $root.google.chat.v1.RichLinkMetadata.decode(reader, reader.uint32()); + 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.chat.v1.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.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.chat.v1.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"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.startIndex != null && message.hasOwnProperty("startIndex")) { + properties._startIndex = 1; + if (!$util.isInteger(message.startIndex)) + return "startIndex: integer expected"; + } + if (message.length != null && message.hasOwnProperty("length")) + if (!$util.isInteger(message.length)) + return "length: integer expected"; + if (message.userMention != null && message.hasOwnProperty("userMention")) { + properties.metadata = 1; + { + var error = $root.google.chat.v1.UserMentionMetadata.verify(message.userMention); + if (error) + return "userMention." + error; + } + } + if (message.slashCommand != null && message.hasOwnProperty("slashCommand")) { + if (properties.metadata === 1) + return "metadata: multiple values"; + properties.metadata = 1; + { + var error = $root.google.chat.v1.SlashCommandMetadata.verify(message.slashCommand); + if (error) + return "slashCommand." + error; + } + } + if (message.richLinkMetadata != null && message.hasOwnProperty("richLinkMetadata")) { + if (properties.metadata === 1) + return "metadata: multiple values"; + properties.metadata = 1; + { + var error = $root.google.chat.v1.RichLinkMetadata.verify(message.richLinkMetadata); + if (error) + return "richLinkMetadata." + error; + } + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Annotation) + return object; + var message = new $root.google.chat.v1.Annotation(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "ANNOTATION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "USER_MENTION": + case 1: + message.type = 1; + break; + case "SLASH_COMMAND": + case 2: + message.type = 2; + break; + case "RICH_LINK": + case 3: + message.type = 3; + break; + } + if (object.startIndex != null) + message.startIndex = object.startIndex | 0; + if (object.length != null) + message.length = object.length | 0; + if (object.userMention != null) { + if (typeof object.userMention !== "object") + throw TypeError(".google.chat.v1.Annotation.userMention: object expected"); + message.userMention = $root.google.chat.v1.UserMentionMetadata.fromObject(object.userMention); + } + if (object.slashCommand != null) { + if (typeof object.slashCommand !== "object") + throw TypeError(".google.chat.v1.Annotation.slashCommand: object expected"); + message.slashCommand = $root.google.chat.v1.SlashCommandMetadata.fromObject(object.slashCommand); + } + if (object.richLinkMetadata != null) { + if (typeof object.richLinkMetadata !== "object") + throw TypeError(".google.chat.v1.Annotation.richLinkMetadata: object expected"); + message.richLinkMetadata = $root.google.chat.v1.RichLinkMetadata.fromObject(object.richLinkMetadata); + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Annotation + * @static + * @param {google.chat.v1.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.defaults) { + object.type = options.enums === String ? "ANNOTATION_TYPE_UNSPECIFIED" : 0; + object.length = 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.chat.v1.AnnotationType[message.type] === undefined ? message.type : $root.google.chat.v1.AnnotationType[message.type] : message.type; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) { + object.startIndex = message.startIndex; + if (options.oneofs) + object._startIndex = "startIndex"; + } + if (message.length != null && message.hasOwnProperty("length")) + object.length = message.length; + if (message.userMention != null && message.hasOwnProperty("userMention")) { + object.userMention = $root.google.chat.v1.UserMentionMetadata.toObject(message.userMention, options); + if (options.oneofs) + object.metadata = "userMention"; + } + if (message.slashCommand != null && message.hasOwnProperty("slashCommand")) { + object.slashCommand = $root.google.chat.v1.SlashCommandMetadata.toObject(message.slashCommand, options); + if (options.oneofs) + object.metadata = "slashCommand"; + } + if (message.richLinkMetadata != null && message.hasOwnProperty("richLinkMetadata")) { + object.richLinkMetadata = $root.google.chat.v1.RichLinkMetadata.toObject(message.richLinkMetadata, options); + if (options.oneofs) + object.metadata = "richLinkMetadata"; + } + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.chat.v1.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.chat.v1.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.chat.v1.Annotation"; + }; + + return Annotation; + })(); + + v1.UserMentionMetadata = (function() { + + /** + * Properties of a UserMentionMetadata. + * @memberof google.chat.v1 + * @interface IUserMentionMetadata + * @property {google.chat.v1.IUser|null} [user] UserMentionMetadata user + * @property {google.chat.v1.UserMentionMetadata.Type|null} [type] UserMentionMetadata type + */ + + /** + * Constructs a new UserMentionMetadata. + * @memberof google.chat.v1 + * @classdesc Represents a UserMentionMetadata. + * @implements IUserMentionMetadata + * @constructor + * @param {google.chat.v1.IUserMentionMetadata=} [properties] Properties to set + */ + function UserMentionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserMentionMetadata user. + * @member {google.chat.v1.IUser|null|undefined} user + * @memberof google.chat.v1.UserMentionMetadata + * @instance + */ + UserMentionMetadata.prototype.user = null; + + /** + * UserMentionMetadata type. + * @member {google.chat.v1.UserMentionMetadata.Type} type + * @memberof google.chat.v1.UserMentionMetadata + * @instance + */ + UserMentionMetadata.prototype.type = 0; + + /** + * Creates a new UserMentionMetadata instance using the specified properties. + * @function create + * @memberof google.chat.v1.UserMentionMetadata + * @static + * @param {google.chat.v1.IUserMentionMetadata=} [properties] Properties to set + * @returns {google.chat.v1.UserMentionMetadata} UserMentionMetadata instance + */ + UserMentionMetadata.create = function create(properties) { + return new UserMentionMetadata(properties); + }; + + /** + * Encodes the specified UserMentionMetadata message. Does not implicitly {@link google.chat.v1.UserMentionMetadata.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.UserMentionMetadata + * @static + * @param {google.chat.v1.IUserMentionMetadata} message UserMentionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserMentionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.chat.v1.User.encode(message.user, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + return writer; + }; + + /** + * Encodes the specified UserMentionMetadata message, length delimited. Does not implicitly {@link google.chat.v1.UserMentionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.UserMentionMetadata + * @static + * @param {google.chat.v1.IUserMentionMetadata} message UserMentionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserMentionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserMentionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.UserMentionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.UserMentionMetadata} UserMentionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserMentionMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UserMentionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.user = $root.google.chat.v1.User.decode(reader, reader.uint32()); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserMentionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.UserMentionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.UserMentionMetadata} UserMentionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserMentionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserMentionMetadata message. + * @function verify + * @memberof google.chat.v1.UserMentionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserMentionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.chat.v1.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a UserMentionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.UserMentionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.UserMentionMetadata} UserMentionMetadata + */ + UserMentionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.UserMentionMetadata) + return object; + var message = new $root.google.chat.v1.UserMentionMetadata(); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.chat.v1.UserMentionMetadata.user: object expected"); + message.user = $root.google.chat.v1.User.fromObject(object.user); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ADD": + case 1: + message.type = 1; + break; + case "MENTION": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a UserMentionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.UserMentionMetadata + * @static + * @param {google.chat.v1.UserMentionMetadata} message UserMentionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserMentionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.user = null; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.chat.v1.User.toObject(message.user, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.chat.v1.UserMentionMetadata.Type[message.type] === undefined ? message.type : $root.google.chat.v1.UserMentionMetadata.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this UserMentionMetadata to JSON. + * @function toJSON + * @memberof google.chat.v1.UserMentionMetadata + * @instance + * @returns {Object.} JSON object + */ + UserMentionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserMentionMetadata + * @function getTypeUrl + * @memberof google.chat.v1.UserMentionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserMentionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.UserMentionMetadata"; + }; + + /** + * Type enum. + * @name google.chat.v1.UserMentionMetadata.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} MENTION=2 MENTION value + */ + UserMentionMetadata.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "MENTION"] = 2; + return values; + })(); + + return UserMentionMetadata; + })(); + + v1.SlashCommandMetadata = (function() { + + /** + * Properties of a SlashCommandMetadata. + * @memberof google.chat.v1 + * @interface ISlashCommandMetadata + * @property {google.chat.v1.IUser|null} [bot] SlashCommandMetadata bot + * @property {google.chat.v1.SlashCommandMetadata.Type|null} [type] SlashCommandMetadata type + * @property {string|null} [commandName] SlashCommandMetadata commandName + * @property {number|Long|null} [commandId] SlashCommandMetadata commandId + * @property {boolean|null} [triggersDialog] SlashCommandMetadata triggersDialog + */ + + /** + * Constructs a new SlashCommandMetadata. + * @memberof google.chat.v1 + * @classdesc Represents a SlashCommandMetadata. + * @implements ISlashCommandMetadata + * @constructor + * @param {google.chat.v1.ISlashCommandMetadata=} [properties] Properties to set + */ + function SlashCommandMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SlashCommandMetadata bot. + * @member {google.chat.v1.IUser|null|undefined} bot + * @memberof google.chat.v1.SlashCommandMetadata + * @instance + */ + SlashCommandMetadata.prototype.bot = null; + + /** + * SlashCommandMetadata type. + * @member {google.chat.v1.SlashCommandMetadata.Type} type + * @memberof google.chat.v1.SlashCommandMetadata + * @instance + */ + SlashCommandMetadata.prototype.type = 0; + + /** + * SlashCommandMetadata commandName. + * @member {string} commandName + * @memberof google.chat.v1.SlashCommandMetadata + * @instance + */ + SlashCommandMetadata.prototype.commandName = ""; + + /** + * SlashCommandMetadata commandId. + * @member {number|Long} commandId + * @memberof google.chat.v1.SlashCommandMetadata + * @instance + */ + SlashCommandMetadata.prototype.commandId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SlashCommandMetadata triggersDialog. + * @member {boolean} triggersDialog + * @memberof google.chat.v1.SlashCommandMetadata + * @instance + */ + SlashCommandMetadata.prototype.triggersDialog = false; + + /** + * Creates a new SlashCommandMetadata instance using the specified properties. + * @function create + * @memberof google.chat.v1.SlashCommandMetadata + * @static + * @param {google.chat.v1.ISlashCommandMetadata=} [properties] Properties to set + * @returns {google.chat.v1.SlashCommandMetadata} SlashCommandMetadata instance + */ + SlashCommandMetadata.create = function create(properties) { + return new SlashCommandMetadata(properties); + }; + + /** + * Encodes the specified SlashCommandMetadata message. Does not implicitly {@link google.chat.v1.SlashCommandMetadata.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.SlashCommandMetadata + * @static + * @param {google.chat.v1.ISlashCommandMetadata} message SlashCommandMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlashCommandMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bot != null && Object.hasOwnProperty.call(message, "bot")) + $root.google.chat.v1.User.encode(message.bot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.commandName != null && Object.hasOwnProperty.call(message, "commandName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.commandName); + if (message.commandId != null && Object.hasOwnProperty.call(message, "commandId")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.commandId); + if (message.triggersDialog != null && Object.hasOwnProperty.call(message, "triggersDialog")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.triggersDialog); + return writer; + }; + + /** + * Encodes the specified SlashCommandMetadata message, length delimited. Does not implicitly {@link google.chat.v1.SlashCommandMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.SlashCommandMetadata + * @static + * @param {google.chat.v1.ISlashCommandMetadata} message SlashCommandMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlashCommandMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SlashCommandMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.SlashCommandMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.SlashCommandMetadata} SlashCommandMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlashCommandMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SlashCommandMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bot = $root.google.chat.v1.User.decode(reader, reader.uint32()); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.commandName = reader.string(); + break; + } + case 4: { + message.commandId = reader.int64(); + break; + } + case 5: { + message.triggersDialog = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SlashCommandMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.SlashCommandMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.SlashCommandMetadata} SlashCommandMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlashCommandMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SlashCommandMetadata message. + * @function verify + * @memberof google.chat.v1.SlashCommandMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SlashCommandMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bot != null && message.hasOwnProperty("bot")) { + var error = $root.google.chat.v1.User.verify(message.bot); + if (error) + return "bot." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.commandName != null && message.hasOwnProperty("commandName")) + if (!$util.isString(message.commandName)) + return "commandName: string expected"; + if (message.commandId != null && message.hasOwnProperty("commandId")) + if (!$util.isInteger(message.commandId) && !(message.commandId && $util.isInteger(message.commandId.low) && $util.isInteger(message.commandId.high))) + return "commandId: integer|Long expected"; + if (message.triggersDialog != null && message.hasOwnProperty("triggersDialog")) + if (typeof message.triggersDialog !== "boolean") + return "triggersDialog: boolean expected"; + return null; + }; + + /** + * Creates a SlashCommandMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.SlashCommandMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.SlashCommandMetadata} SlashCommandMetadata + */ + SlashCommandMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SlashCommandMetadata) + return object; + var message = new $root.google.chat.v1.SlashCommandMetadata(); + if (object.bot != null) { + if (typeof object.bot !== "object") + throw TypeError(".google.chat.v1.SlashCommandMetadata.bot: object expected"); + message.bot = $root.google.chat.v1.User.fromObject(object.bot); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ADD": + case 1: + message.type = 1; + break; + case "INVOKE": + case 2: + message.type = 2; + break; + } + if (object.commandName != null) + message.commandName = String(object.commandName); + if (object.commandId != null) + if ($util.Long) + (message.commandId = $util.Long.fromValue(object.commandId)).unsigned = false; + else if (typeof object.commandId === "string") + message.commandId = parseInt(object.commandId, 10); + else if (typeof object.commandId === "number") + message.commandId = object.commandId; + else if (typeof object.commandId === "object") + message.commandId = new $util.LongBits(object.commandId.low >>> 0, object.commandId.high >>> 0).toNumber(); + if (object.triggersDialog != null) + message.triggersDialog = Boolean(object.triggersDialog); + return message; + }; + + /** + * Creates a plain object from a SlashCommandMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.SlashCommandMetadata + * @static + * @param {google.chat.v1.SlashCommandMetadata} message SlashCommandMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SlashCommandMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bot = null; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.commandName = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.commandId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.commandId = options.longs === String ? "0" : 0; + object.triggersDialog = false; + } + if (message.bot != null && message.hasOwnProperty("bot")) + object.bot = $root.google.chat.v1.User.toObject(message.bot, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.chat.v1.SlashCommandMetadata.Type[message.type] === undefined ? message.type : $root.google.chat.v1.SlashCommandMetadata.Type[message.type] : message.type; + if (message.commandName != null && message.hasOwnProperty("commandName")) + object.commandName = message.commandName; + if (message.commandId != null && message.hasOwnProperty("commandId")) + if (typeof message.commandId === "number") + object.commandId = options.longs === String ? String(message.commandId) : message.commandId; + else + object.commandId = options.longs === String ? $util.Long.prototype.toString.call(message.commandId) : options.longs === Number ? new $util.LongBits(message.commandId.low >>> 0, message.commandId.high >>> 0).toNumber() : message.commandId; + if (message.triggersDialog != null && message.hasOwnProperty("triggersDialog")) + object.triggersDialog = message.triggersDialog; + return object; + }; + + /** + * Converts this SlashCommandMetadata to JSON. + * @function toJSON + * @memberof google.chat.v1.SlashCommandMetadata + * @instance + * @returns {Object.} JSON object + */ + SlashCommandMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SlashCommandMetadata + * @function getTypeUrl + * @memberof google.chat.v1.SlashCommandMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SlashCommandMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.SlashCommandMetadata"; + }; + + /** + * Type enum. + * @name google.chat.v1.SlashCommandMetadata.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} INVOKE=2 INVOKE value + */ + SlashCommandMetadata.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "INVOKE"] = 2; + return values; + })(); + + return SlashCommandMetadata; + })(); + + v1.RichLinkMetadata = (function() { + + /** + * Properties of a RichLinkMetadata. + * @memberof google.chat.v1 + * @interface IRichLinkMetadata + * @property {string|null} [uri] RichLinkMetadata uri + * @property {google.chat.v1.RichLinkMetadata.RichLinkType|null} [richLinkType] RichLinkMetadata richLinkType + * @property {google.chat.v1.IDriveLinkData|null} [driveLinkData] RichLinkMetadata driveLinkData + * @property {google.chat.v1.IChatSpaceLinkData|null} [chatSpaceLinkData] RichLinkMetadata chatSpaceLinkData + */ + + /** + * Constructs a new RichLinkMetadata. + * @memberof google.chat.v1 + * @classdesc Represents a RichLinkMetadata. + * @implements IRichLinkMetadata + * @constructor + * @param {google.chat.v1.IRichLinkMetadata=} [properties] Properties to set + */ + function RichLinkMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RichLinkMetadata uri. + * @member {string} uri + * @memberof google.chat.v1.RichLinkMetadata + * @instance + */ + RichLinkMetadata.prototype.uri = ""; + + /** + * RichLinkMetadata richLinkType. + * @member {google.chat.v1.RichLinkMetadata.RichLinkType} richLinkType + * @memberof google.chat.v1.RichLinkMetadata + * @instance + */ + RichLinkMetadata.prototype.richLinkType = 0; + + /** + * RichLinkMetadata driveLinkData. + * @member {google.chat.v1.IDriveLinkData|null|undefined} driveLinkData + * @memberof google.chat.v1.RichLinkMetadata + * @instance + */ + RichLinkMetadata.prototype.driveLinkData = null; + + /** + * RichLinkMetadata chatSpaceLinkData. + * @member {google.chat.v1.IChatSpaceLinkData|null|undefined} chatSpaceLinkData + * @memberof google.chat.v1.RichLinkMetadata + * @instance + */ + RichLinkMetadata.prototype.chatSpaceLinkData = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RichLinkMetadata data. + * @member {"driveLinkData"|"chatSpaceLinkData"|undefined} data + * @memberof google.chat.v1.RichLinkMetadata + * @instance + */ + Object.defineProperty(RichLinkMetadata.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["driveLinkData", "chatSpaceLinkData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RichLinkMetadata instance using the specified properties. + * @function create + * @memberof google.chat.v1.RichLinkMetadata + * @static + * @param {google.chat.v1.IRichLinkMetadata=} [properties] Properties to set + * @returns {google.chat.v1.RichLinkMetadata} RichLinkMetadata instance + */ + RichLinkMetadata.create = function create(properties) { + return new RichLinkMetadata(properties); + }; + + /** + * Encodes the specified RichLinkMetadata message. Does not implicitly {@link google.chat.v1.RichLinkMetadata.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.RichLinkMetadata + * @static + * @param {google.chat.v1.IRichLinkMetadata} message RichLinkMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RichLinkMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.richLinkType != null && Object.hasOwnProperty.call(message, "richLinkType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.richLinkType); + if (message.driveLinkData != null && Object.hasOwnProperty.call(message, "driveLinkData")) + $root.google.chat.v1.DriveLinkData.encode(message.driveLinkData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.chatSpaceLinkData != null && Object.hasOwnProperty.call(message, "chatSpaceLinkData")) + $root.google.chat.v1.ChatSpaceLinkData.encode(message.chatSpaceLinkData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RichLinkMetadata message, length delimited. Does not implicitly {@link google.chat.v1.RichLinkMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.RichLinkMetadata + * @static + * @param {google.chat.v1.IRichLinkMetadata} message RichLinkMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RichLinkMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RichLinkMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.RichLinkMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.RichLinkMetadata} RichLinkMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RichLinkMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.RichLinkMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.richLinkType = reader.int32(); + break; + } + case 3: { + message.driveLinkData = $root.google.chat.v1.DriveLinkData.decode(reader, reader.uint32()); + break; + } + case 4: { + message.chatSpaceLinkData = $root.google.chat.v1.ChatSpaceLinkData.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RichLinkMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.RichLinkMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.RichLinkMetadata} RichLinkMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RichLinkMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RichLinkMetadata message. + * @function verify + * @memberof google.chat.v1.RichLinkMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RichLinkMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.richLinkType != null && message.hasOwnProperty("richLinkType")) + switch (message.richLinkType) { + default: + return "richLinkType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.driveLinkData != null && message.hasOwnProperty("driveLinkData")) { + properties.data = 1; + { + var error = $root.google.chat.v1.DriveLinkData.verify(message.driveLinkData); + if (error) + return "driveLinkData." + error; + } + } + if (message.chatSpaceLinkData != null && message.hasOwnProperty("chatSpaceLinkData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.chat.v1.ChatSpaceLinkData.verify(message.chatSpaceLinkData); + if (error) + return "chatSpaceLinkData." + error; + } + } + return null; + }; + + /** + * Creates a RichLinkMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.RichLinkMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.RichLinkMetadata} RichLinkMetadata + */ + RichLinkMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.RichLinkMetadata) + return object; + var message = new $root.google.chat.v1.RichLinkMetadata(); + if (object.uri != null) + message.uri = String(object.uri); + switch (object.richLinkType) { + default: + if (typeof object.richLinkType === "number") { + message.richLinkType = object.richLinkType; + break; + } + break; + case "RICH_LINK_TYPE_UNSPECIFIED": + case 0: + message.richLinkType = 0; + break; + case "DRIVE_FILE": + case 1: + message.richLinkType = 1; + break; + case "CHAT_SPACE": + case 2: + message.richLinkType = 2; + break; + } + if (object.driveLinkData != null) { + if (typeof object.driveLinkData !== "object") + throw TypeError(".google.chat.v1.RichLinkMetadata.driveLinkData: object expected"); + message.driveLinkData = $root.google.chat.v1.DriveLinkData.fromObject(object.driveLinkData); + } + if (object.chatSpaceLinkData != null) { + if (typeof object.chatSpaceLinkData !== "object") + throw TypeError(".google.chat.v1.RichLinkMetadata.chatSpaceLinkData: object expected"); + message.chatSpaceLinkData = $root.google.chat.v1.ChatSpaceLinkData.fromObject(object.chatSpaceLinkData); + } + return message; + }; + + /** + * Creates a plain object from a RichLinkMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.RichLinkMetadata + * @static + * @param {google.chat.v1.RichLinkMetadata} message RichLinkMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RichLinkMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.richLinkType = options.enums === String ? "RICH_LINK_TYPE_UNSPECIFIED" : 0; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.richLinkType != null && message.hasOwnProperty("richLinkType")) + object.richLinkType = options.enums === String ? $root.google.chat.v1.RichLinkMetadata.RichLinkType[message.richLinkType] === undefined ? message.richLinkType : $root.google.chat.v1.RichLinkMetadata.RichLinkType[message.richLinkType] : message.richLinkType; + if (message.driveLinkData != null && message.hasOwnProperty("driveLinkData")) { + object.driveLinkData = $root.google.chat.v1.DriveLinkData.toObject(message.driveLinkData, options); + if (options.oneofs) + object.data = "driveLinkData"; + } + if (message.chatSpaceLinkData != null && message.hasOwnProperty("chatSpaceLinkData")) { + object.chatSpaceLinkData = $root.google.chat.v1.ChatSpaceLinkData.toObject(message.chatSpaceLinkData, options); + if (options.oneofs) + object.data = "chatSpaceLinkData"; + } + return object; + }; + + /** + * Converts this RichLinkMetadata to JSON. + * @function toJSON + * @memberof google.chat.v1.RichLinkMetadata + * @instance + * @returns {Object.} JSON object + */ + RichLinkMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RichLinkMetadata + * @function getTypeUrl + * @memberof google.chat.v1.RichLinkMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RichLinkMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.RichLinkMetadata"; + }; + + /** + * RichLinkType enum. + * @name google.chat.v1.RichLinkMetadata.RichLinkType + * @enum {number} + * @property {number} RICH_LINK_TYPE_UNSPECIFIED=0 RICH_LINK_TYPE_UNSPECIFIED value + * @property {number} DRIVE_FILE=1 DRIVE_FILE value + * @property {number} CHAT_SPACE=2 CHAT_SPACE value + */ + RichLinkMetadata.RichLinkType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RICH_LINK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRIVE_FILE"] = 1; + values[valuesById[2] = "CHAT_SPACE"] = 2; + return values; + })(); + + return RichLinkMetadata; + })(); + + v1.DriveLinkData = (function() { + + /** + * Properties of a DriveLinkData. + * @memberof google.chat.v1 + * @interface IDriveLinkData + * @property {google.chat.v1.IDriveDataRef|null} [driveDataRef] DriveLinkData driveDataRef + * @property {string|null} [mimeType] DriveLinkData mimeType + */ + + /** + * Constructs a new DriveLinkData. + * @memberof google.chat.v1 + * @classdesc Represents a DriveLinkData. + * @implements IDriveLinkData + * @constructor + * @param {google.chat.v1.IDriveLinkData=} [properties] Properties to set + */ + function DriveLinkData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DriveLinkData driveDataRef. + * @member {google.chat.v1.IDriveDataRef|null|undefined} driveDataRef + * @memberof google.chat.v1.DriveLinkData + * @instance + */ + DriveLinkData.prototype.driveDataRef = null; + + /** + * DriveLinkData mimeType. + * @member {string} mimeType + * @memberof google.chat.v1.DriveLinkData + * @instance + */ + DriveLinkData.prototype.mimeType = ""; + + /** + * Creates a new DriveLinkData instance using the specified properties. + * @function create + * @memberof google.chat.v1.DriveLinkData + * @static + * @param {google.chat.v1.IDriveLinkData=} [properties] Properties to set + * @returns {google.chat.v1.DriveLinkData} DriveLinkData instance + */ + DriveLinkData.create = function create(properties) { + return new DriveLinkData(properties); + }; + + /** + * Encodes the specified DriveLinkData message. Does not implicitly {@link google.chat.v1.DriveLinkData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.DriveLinkData + * @static + * @param {google.chat.v1.IDriveLinkData} message DriveLinkData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DriveLinkData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.driveDataRef != null && Object.hasOwnProperty.call(message, "driveDataRef")) + $root.google.chat.v1.DriveDataRef.encode(message.driveDataRef, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified DriveLinkData message, length delimited. Does not implicitly {@link google.chat.v1.DriveLinkData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.DriveLinkData + * @static + * @param {google.chat.v1.IDriveLinkData} message DriveLinkData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DriveLinkData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DriveLinkData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.DriveLinkData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.DriveLinkData} DriveLinkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DriveLinkData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DriveLinkData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.driveDataRef = $root.google.chat.v1.DriveDataRef.decode(reader, reader.uint32()); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DriveLinkData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.DriveLinkData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.DriveLinkData} DriveLinkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DriveLinkData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DriveLinkData message. + * @function verify + * @memberof google.chat.v1.DriveLinkData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DriveLinkData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.driveDataRef != null && message.hasOwnProperty("driveDataRef")) { + var error = $root.google.chat.v1.DriveDataRef.verify(message.driveDataRef); + if (error) + return "driveDataRef." + error; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a DriveLinkData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.DriveLinkData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.DriveLinkData} DriveLinkData + */ + DriveLinkData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DriveLinkData) + return object; + var message = new $root.google.chat.v1.DriveLinkData(); + if (object.driveDataRef != null) { + if (typeof object.driveDataRef !== "object") + throw TypeError(".google.chat.v1.DriveLinkData.driveDataRef: object expected"); + message.driveDataRef = $root.google.chat.v1.DriveDataRef.fromObject(object.driveDataRef); + } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a DriveLinkData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.DriveLinkData + * @static + * @param {google.chat.v1.DriveLinkData} message DriveLinkData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DriveLinkData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.driveDataRef = null; + object.mimeType = ""; + } + if (message.driveDataRef != null && message.hasOwnProperty("driveDataRef")) + object.driveDataRef = $root.google.chat.v1.DriveDataRef.toObject(message.driveDataRef, options); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this DriveLinkData to JSON. + * @function toJSON + * @memberof google.chat.v1.DriveLinkData + * @instance + * @returns {Object.} JSON object + */ + DriveLinkData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DriveLinkData + * @function getTypeUrl + * @memberof google.chat.v1.DriveLinkData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DriveLinkData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.DriveLinkData"; + }; + + return DriveLinkData; + })(); + + v1.ChatSpaceLinkData = (function() { + + /** + * Properties of a ChatSpaceLinkData. + * @memberof google.chat.v1 + * @interface IChatSpaceLinkData + * @property {string|null} [space] ChatSpaceLinkData space + * @property {string|null} [thread] ChatSpaceLinkData thread + * @property {string|null} [message] ChatSpaceLinkData message + */ + + /** + * Constructs a new ChatSpaceLinkData. + * @memberof google.chat.v1 + * @classdesc Represents a ChatSpaceLinkData. + * @implements IChatSpaceLinkData + * @constructor + * @param {google.chat.v1.IChatSpaceLinkData=} [properties] Properties to set + */ + function ChatSpaceLinkData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChatSpaceLinkData space. + * @member {string} space + * @memberof google.chat.v1.ChatSpaceLinkData + * @instance + */ + ChatSpaceLinkData.prototype.space = ""; + + /** + * ChatSpaceLinkData thread. + * @member {string} thread + * @memberof google.chat.v1.ChatSpaceLinkData + * @instance + */ + ChatSpaceLinkData.prototype.thread = ""; + + /** + * ChatSpaceLinkData message. + * @member {string} message + * @memberof google.chat.v1.ChatSpaceLinkData + * @instance + */ + ChatSpaceLinkData.prototype.message = ""; + + /** + * Creates a new ChatSpaceLinkData instance using the specified properties. + * @function create + * @memberof google.chat.v1.ChatSpaceLinkData + * @static + * @param {google.chat.v1.IChatSpaceLinkData=} [properties] Properties to set + * @returns {google.chat.v1.ChatSpaceLinkData} ChatSpaceLinkData instance + */ + ChatSpaceLinkData.create = function create(properties) { + return new ChatSpaceLinkData(properties); + }; + + /** + * Encodes the specified ChatSpaceLinkData message. Does not implicitly {@link google.chat.v1.ChatSpaceLinkData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ChatSpaceLinkData + * @static + * @param {google.chat.v1.IChatSpaceLinkData} message ChatSpaceLinkData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChatSpaceLinkData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.space != null && Object.hasOwnProperty.call(message, "space")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.space); + if (message.thread != null && Object.hasOwnProperty.call(message, "thread")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.thread); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.message); + return writer; + }; + + /** + * Encodes the specified ChatSpaceLinkData message, length delimited. Does not implicitly {@link google.chat.v1.ChatSpaceLinkData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ChatSpaceLinkData + * @static + * @param {google.chat.v1.IChatSpaceLinkData} message ChatSpaceLinkData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChatSpaceLinkData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChatSpaceLinkData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ChatSpaceLinkData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ChatSpaceLinkData} ChatSpaceLinkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChatSpaceLinkData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ChatSpaceLinkData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.space = reader.string(); + break; + } + case 2: { + message.thread = reader.string(); + break; + } + case 3: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChatSpaceLinkData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ChatSpaceLinkData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ChatSpaceLinkData} ChatSpaceLinkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChatSpaceLinkData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChatSpaceLinkData message. + * @function verify + * @memberof google.chat.v1.ChatSpaceLinkData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChatSpaceLinkData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.space != null && message.hasOwnProperty("space")) + if (!$util.isString(message.space)) + return "space: string expected"; + if (message.thread != null && message.hasOwnProperty("thread")) + if (!$util.isString(message.thread)) + return "thread: string expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a ChatSpaceLinkData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ChatSpaceLinkData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ChatSpaceLinkData} ChatSpaceLinkData + */ + ChatSpaceLinkData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ChatSpaceLinkData) + return object; + var message = new $root.google.chat.v1.ChatSpaceLinkData(); + if (object.space != null) + message.space = String(object.space); + if (object.thread != null) + message.thread = String(object.thread); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a ChatSpaceLinkData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ChatSpaceLinkData + * @static + * @param {google.chat.v1.ChatSpaceLinkData} message ChatSpaceLinkData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChatSpaceLinkData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.space = ""; + object.thread = ""; + object.message = ""; + } + if (message.space != null && message.hasOwnProperty("space")) + object.space = message.space; + if (message.thread != null && message.hasOwnProperty("thread")) + object.thread = message.thread; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this ChatSpaceLinkData to JSON. + * @function toJSON + * @memberof google.chat.v1.ChatSpaceLinkData + * @instance + * @returns {Object.} JSON object + */ + ChatSpaceLinkData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChatSpaceLinkData + * @function getTypeUrl + * @memberof google.chat.v1.ChatSpaceLinkData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChatSpaceLinkData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ChatSpaceLinkData"; + }; + + return ChatSpaceLinkData; + })(); + + /** + * AnnotationType enum. + * @name google.chat.v1.AnnotationType + * @enum {number} + * @property {number} ANNOTATION_TYPE_UNSPECIFIED=0 ANNOTATION_TYPE_UNSPECIFIED value + * @property {number} USER_MENTION=1 USER_MENTION value + * @property {number} SLASH_COMMAND=2 SLASH_COMMAND value + * @property {number} RICH_LINK=3 RICH_LINK value + */ + v1.AnnotationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANNOTATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_MENTION"] = 1; + values[valuesById[2] = "SLASH_COMMAND"] = 2; + values[valuesById[3] = "RICH_LINK"] = 3; + return values; + })(); + + v1.Attachment = (function() { + + /** + * Properties of an Attachment. + * @memberof google.chat.v1 + * @interface IAttachment + * @property {string|null} [name] Attachment name + * @property {string|null} [contentName] Attachment contentName + * @property {string|null} [contentType] Attachment contentType + * @property {google.chat.v1.IAttachmentDataRef|null} [attachmentDataRef] Attachment attachmentDataRef + * @property {google.chat.v1.IDriveDataRef|null} [driveDataRef] Attachment driveDataRef + * @property {string|null} [thumbnailUri] Attachment thumbnailUri + * @property {string|null} [downloadUri] Attachment downloadUri + * @property {google.chat.v1.Attachment.Source|null} [source] Attachment source + */ + + /** + * Constructs a new Attachment. + * @memberof google.chat.v1 + * @classdesc Represents an Attachment. + * @implements IAttachment + * @constructor + * @param {google.chat.v1.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.chat.v1.Attachment + * @instance + */ + Attachment.prototype.name = ""; + + /** + * Attachment contentName. + * @member {string} contentName + * @memberof google.chat.v1.Attachment + * @instance + */ + Attachment.prototype.contentName = ""; + + /** + * Attachment contentType. + * @member {string} contentType + * @memberof google.chat.v1.Attachment + * @instance + */ + Attachment.prototype.contentType = ""; + + /** + * Attachment attachmentDataRef. + * @member {google.chat.v1.IAttachmentDataRef|null|undefined} attachmentDataRef + * @memberof google.chat.v1.Attachment + * @instance + */ + Attachment.prototype.attachmentDataRef = null; + + /** + * Attachment driveDataRef. + * @member {google.chat.v1.IDriveDataRef|null|undefined} driveDataRef + * @memberof google.chat.v1.Attachment + * @instance + */ + Attachment.prototype.driveDataRef = null; + + /** + * Attachment thumbnailUri. + * @member {string} thumbnailUri + * @memberof google.chat.v1.Attachment + * @instance + */ + Attachment.prototype.thumbnailUri = ""; + + /** + * Attachment downloadUri. + * @member {string} downloadUri + * @memberof google.chat.v1.Attachment + * @instance + */ + Attachment.prototype.downloadUri = ""; + + /** + * Attachment source. + * @member {google.chat.v1.Attachment.Source} source + * @memberof google.chat.v1.Attachment + * @instance + */ + Attachment.prototype.source = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Attachment dataRef. + * @member {"attachmentDataRef"|"driveDataRef"|undefined} dataRef + * @memberof google.chat.v1.Attachment + * @instance + */ + Object.defineProperty(Attachment.prototype, "dataRef", { + get: $util.oneOfGetter($oneOfFields = ["attachmentDataRef", "driveDataRef"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Attachment instance using the specified properties. + * @function create + * @memberof google.chat.v1.Attachment + * @static + * @param {google.chat.v1.IAttachment=} [properties] Properties to set + * @returns {google.chat.v1.Attachment} Attachment instance + */ + Attachment.create = function create(properties) { + return new Attachment(properties); + }; + + /** + * Encodes the specified Attachment message. Does not implicitly {@link google.chat.v1.Attachment.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Attachment + * @static + * @param {google.chat.v1.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.contentName != null && Object.hasOwnProperty.call(message, "contentName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.contentName); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.contentType); + if (message.attachmentDataRef != null && Object.hasOwnProperty.call(message, "attachmentDataRef")) + $root.google.chat.v1.AttachmentDataRef.encode(message.attachmentDataRef, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.thumbnailUri != null && Object.hasOwnProperty.call(message, "thumbnailUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.thumbnailUri); + if (message.downloadUri != null && Object.hasOwnProperty.call(message, "downloadUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.downloadUri); + if (message.driveDataRef != null && Object.hasOwnProperty.call(message, "driveDataRef")) + $root.google.chat.v1.DriveDataRef.encode(message.driveDataRef, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.source); + return writer; + }; + + /** + * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.chat.v1.Attachment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Attachment + * @static + * @param {google.chat.v1.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.chat.v1.Attachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Attachment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.contentName = reader.string(); + break; + } + case 3: { + message.contentType = reader.string(); + break; + } + case 4: { + message.attachmentDataRef = $root.google.chat.v1.AttachmentDataRef.decode(reader, reader.uint32()); + break; + } + case 7: { + message.driveDataRef = $root.google.chat.v1.DriveDataRef.decode(reader, reader.uint32()); + break; + } + case 5: { + message.thumbnailUri = reader.string(); + break; + } + case 6: { + message.downloadUri = reader.string(); + break; + } + case 9: { + message.source = reader.int32(); + 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.chat.v1.Attachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.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.chat.v1.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"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.contentName != null && message.hasOwnProperty("contentName")) + if (!$util.isString(message.contentName)) + return "contentName: string expected"; + if (message.contentType != null && message.hasOwnProperty("contentType")) + if (!$util.isString(message.contentType)) + return "contentType: string expected"; + if (message.attachmentDataRef != null && message.hasOwnProperty("attachmentDataRef")) { + properties.dataRef = 1; + { + var error = $root.google.chat.v1.AttachmentDataRef.verify(message.attachmentDataRef); + if (error) + return "attachmentDataRef." + error; + } + } + if (message.driveDataRef != null && message.hasOwnProperty("driveDataRef")) { + if (properties.dataRef === 1) + return "dataRef: multiple values"; + properties.dataRef = 1; + { + var error = $root.google.chat.v1.DriveDataRef.verify(message.driveDataRef); + if (error) + return "driveDataRef." + error; + } + } + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + if (!$util.isString(message.thumbnailUri)) + return "thumbnailUri: string expected"; + if (message.downloadUri != null && message.hasOwnProperty("downloadUri")) + if (!$util.isString(message.downloadUri)) + return "downloadUri: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Attachment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Attachment + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Attachment} Attachment + */ + Attachment.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Attachment) + return object; + var message = new $root.google.chat.v1.Attachment(); + if (object.name != null) + message.name = String(object.name); + if (object.contentName != null) + message.contentName = String(object.contentName); + if (object.contentType != null) + message.contentType = String(object.contentType); + if (object.attachmentDataRef != null) { + if (typeof object.attachmentDataRef !== "object") + throw TypeError(".google.chat.v1.Attachment.attachmentDataRef: object expected"); + message.attachmentDataRef = $root.google.chat.v1.AttachmentDataRef.fromObject(object.attachmentDataRef); + } + if (object.driveDataRef != null) { + if (typeof object.driveDataRef !== "object") + throw TypeError(".google.chat.v1.Attachment.driveDataRef: object expected"); + message.driveDataRef = $root.google.chat.v1.DriveDataRef.fromObject(object.driveDataRef); + } + if (object.thumbnailUri != null) + message.thumbnailUri = String(object.thumbnailUri); + if (object.downloadUri != null) + message.downloadUri = String(object.downloadUri); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "DRIVE_FILE": + case 1: + message.source = 1; + break; + case "UPLOADED_CONTENT": + case 2: + message.source = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Attachment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Attachment + * @static + * @param {google.chat.v1.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.contentName = ""; + object.contentType = ""; + object.thumbnailUri = ""; + object.downloadUri = ""; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.contentName != null && message.hasOwnProperty("contentName")) + object.contentName = message.contentName; + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = message.contentType; + if (message.attachmentDataRef != null && message.hasOwnProperty("attachmentDataRef")) { + object.attachmentDataRef = $root.google.chat.v1.AttachmentDataRef.toObject(message.attachmentDataRef, options); + if (options.oneofs) + object.dataRef = "attachmentDataRef"; + } + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + object.thumbnailUri = message.thumbnailUri; + if (message.downloadUri != null && message.hasOwnProperty("downloadUri")) + object.downloadUri = message.downloadUri; + if (message.driveDataRef != null && message.hasOwnProperty("driveDataRef")) { + object.driveDataRef = $root.google.chat.v1.DriveDataRef.toObject(message.driveDataRef, options); + if (options.oneofs) + object.dataRef = "driveDataRef"; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.chat.v1.Attachment.Source[message.source] === undefined ? message.source : $root.google.chat.v1.Attachment.Source[message.source] : message.source; + return object; + }; + + /** + * Converts this Attachment to JSON. + * @function toJSON + * @memberof google.chat.v1.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.chat.v1.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.chat.v1.Attachment"; + }; + + /** + * Source enum. + * @name google.chat.v1.Attachment.Source + * @enum {number} + * @property {number} SOURCE_UNSPECIFIED=0 SOURCE_UNSPECIFIED value + * @property {number} DRIVE_FILE=1 DRIVE_FILE value + * @property {number} UPLOADED_CONTENT=2 UPLOADED_CONTENT value + */ + Attachment.Source = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRIVE_FILE"] = 1; + values[valuesById[2] = "UPLOADED_CONTENT"] = 2; + return values; + })(); + + return Attachment; + })(); + + v1.DriveDataRef = (function() { + + /** + * Properties of a DriveDataRef. + * @memberof google.chat.v1 + * @interface IDriveDataRef + * @property {string|null} [driveFileId] DriveDataRef driveFileId + */ + + /** + * Constructs a new DriveDataRef. + * @memberof google.chat.v1 + * @classdesc Represents a DriveDataRef. + * @implements IDriveDataRef + * @constructor + * @param {google.chat.v1.IDriveDataRef=} [properties] Properties to set + */ + function DriveDataRef(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DriveDataRef driveFileId. + * @member {string} driveFileId + * @memberof google.chat.v1.DriveDataRef + * @instance + */ + DriveDataRef.prototype.driveFileId = ""; + + /** + * Creates a new DriveDataRef instance using the specified properties. + * @function create + * @memberof google.chat.v1.DriveDataRef + * @static + * @param {google.chat.v1.IDriveDataRef=} [properties] Properties to set + * @returns {google.chat.v1.DriveDataRef} DriveDataRef instance + */ + DriveDataRef.create = function create(properties) { + return new DriveDataRef(properties); + }; + + /** + * Encodes the specified DriveDataRef message. Does not implicitly {@link google.chat.v1.DriveDataRef.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.DriveDataRef + * @static + * @param {google.chat.v1.IDriveDataRef} message DriveDataRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DriveDataRef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.driveFileId != null && Object.hasOwnProperty.call(message, "driveFileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.driveFileId); + return writer; + }; + + /** + * Encodes the specified DriveDataRef message, length delimited. Does not implicitly {@link google.chat.v1.DriveDataRef.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.DriveDataRef + * @static + * @param {google.chat.v1.IDriveDataRef} message DriveDataRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DriveDataRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DriveDataRef message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.DriveDataRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.DriveDataRef} DriveDataRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DriveDataRef.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DriveDataRef(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.driveFileId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DriveDataRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.DriveDataRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.DriveDataRef} DriveDataRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DriveDataRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DriveDataRef message. + * @function verify + * @memberof google.chat.v1.DriveDataRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DriveDataRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.driveFileId != null && message.hasOwnProperty("driveFileId")) + if (!$util.isString(message.driveFileId)) + return "driveFileId: string expected"; + return null; + }; + + /** + * Creates a DriveDataRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.DriveDataRef + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.DriveDataRef} DriveDataRef + */ + DriveDataRef.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DriveDataRef) + return object; + var message = new $root.google.chat.v1.DriveDataRef(); + if (object.driveFileId != null) + message.driveFileId = String(object.driveFileId); + return message; + }; + + /** + * Creates a plain object from a DriveDataRef message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.DriveDataRef + * @static + * @param {google.chat.v1.DriveDataRef} message DriveDataRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DriveDataRef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.driveFileId = ""; + if (message.driveFileId != null && message.hasOwnProperty("driveFileId")) + object.driveFileId = message.driveFileId; + return object; + }; + + /** + * Converts this DriveDataRef to JSON. + * @function toJSON + * @memberof google.chat.v1.DriveDataRef + * @instance + * @returns {Object.} JSON object + */ + DriveDataRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DriveDataRef + * @function getTypeUrl + * @memberof google.chat.v1.DriveDataRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DriveDataRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.DriveDataRef"; + }; + + return DriveDataRef; + })(); + + v1.AttachmentDataRef = (function() { + + /** + * Properties of an AttachmentDataRef. + * @memberof google.chat.v1 + * @interface IAttachmentDataRef + * @property {string|null} [resourceName] AttachmentDataRef resourceName + * @property {string|null} [attachmentUploadToken] AttachmentDataRef attachmentUploadToken + */ + + /** + * Constructs a new AttachmentDataRef. + * @memberof google.chat.v1 + * @classdesc Represents an AttachmentDataRef. + * @implements IAttachmentDataRef + * @constructor + * @param {google.chat.v1.IAttachmentDataRef=} [properties] Properties to set + */ + function AttachmentDataRef(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachmentDataRef resourceName. + * @member {string} resourceName + * @memberof google.chat.v1.AttachmentDataRef + * @instance + */ + AttachmentDataRef.prototype.resourceName = ""; + + /** + * AttachmentDataRef attachmentUploadToken. + * @member {string} attachmentUploadToken + * @memberof google.chat.v1.AttachmentDataRef + * @instance + */ + AttachmentDataRef.prototype.attachmentUploadToken = ""; + + /** + * Creates a new AttachmentDataRef instance using the specified properties. + * @function create + * @memberof google.chat.v1.AttachmentDataRef + * @static + * @param {google.chat.v1.IAttachmentDataRef=} [properties] Properties to set + * @returns {google.chat.v1.AttachmentDataRef} AttachmentDataRef instance + */ + AttachmentDataRef.create = function create(properties) { + return new AttachmentDataRef(properties); + }; + + /** + * Encodes the specified AttachmentDataRef message. Does not implicitly {@link google.chat.v1.AttachmentDataRef.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.AttachmentDataRef + * @static + * @param {google.chat.v1.IAttachmentDataRef} message AttachmentDataRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachmentDataRef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + if (message.attachmentUploadToken != null && Object.hasOwnProperty.call(message, "attachmentUploadToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.attachmentUploadToken); + return writer; + }; + + /** + * Encodes the specified AttachmentDataRef message, length delimited. Does not implicitly {@link google.chat.v1.AttachmentDataRef.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.AttachmentDataRef + * @static + * @param {google.chat.v1.IAttachmentDataRef} message AttachmentDataRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachmentDataRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachmentDataRef message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.AttachmentDataRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.AttachmentDataRef} AttachmentDataRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachmentDataRef.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.AttachmentDataRef(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resourceName = reader.string(); + break; + } + case 2: { + message.attachmentUploadToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachmentDataRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.AttachmentDataRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.AttachmentDataRef} AttachmentDataRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachmentDataRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachmentDataRef message. + * @function verify + * @memberof google.chat.v1.AttachmentDataRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachmentDataRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.attachmentUploadToken != null && message.hasOwnProperty("attachmentUploadToken")) + if (!$util.isString(message.attachmentUploadToken)) + return "attachmentUploadToken: string expected"; + return null; + }; + + /** + * Creates an AttachmentDataRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.AttachmentDataRef + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.AttachmentDataRef} AttachmentDataRef + */ + AttachmentDataRef.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.AttachmentDataRef) + return object; + var message = new $root.google.chat.v1.AttachmentDataRef(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.attachmentUploadToken != null) + message.attachmentUploadToken = String(object.attachmentUploadToken); + return message; + }; + + /** + * Creates a plain object from an AttachmentDataRef message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.AttachmentDataRef + * @static + * @param {google.chat.v1.AttachmentDataRef} message AttachmentDataRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachmentDataRef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceName = ""; + object.attachmentUploadToken = ""; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.attachmentUploadToken != null && message.hasOwnProperty("attachmentUploadToken")) + object.attachmentUploadToken = message.attachmentUploadToken; + return object; + }; + + /** + * Converts this AttachmentDataRef to JSON. + * @function toJSON + * @memberof google.chat.v1.AttachmentDataRef + * @instance + * @returns {Object.} JSON object + */ + AttachmentDataRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttachmentDataRef + * @function getTypeUrl + * @memberof google.chat.v1.AttachmentDataRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttachmentDataRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.AttachmentDataRef"; + }; + + return AttachmentDataRef; + })(); + + v1.GetAttachmentRequest = (function() { + + /** + * Properties of a GetAttachmentRequest. + * @memberof google.chat.v1 + * @interface IGetAttachmentRequest + * @property {string|null} [name] GetAttachmentRequest name + */ + + /** + * Constructs a new GetAttachmentRequest. + * @memberof google.chat.v1 + * @classdesc Represents a GetAttachmentRequest. + * @implements IGetAttachmentRequest + * @constructor + * @param {google.chat.v1.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.chat.v1.GetAttachmentRequest + * @instance + */ + GetAttachmentRequest.prototype.name = ""; + + /** + * Creates a new GetAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.GetAttachmentRequest + * @static + * @param {google.chat.v1.IGetAttachmentRequest=} [properties] Properties to set + * @returns {google.chat.v1.GetAttachmentRequest} GetAttachmentRequest instance + */ + GetAttachmentRequest.create = function create(properties) { + return new GetAttachmentRequest(properties); + }; + + /** + * Encodes the specified GetAttachmentRequest message. Does not implicitly {@link google.chat.v1.GetAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.GetAttachmentRequest + * @static + * @param {google.chat.v1.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.chat.v1.GetAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.GetAttachmentRequest + * @static + * @param {google.chat.v1.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.chat.v1.GetAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetAttachmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.GetAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.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.chat.v1.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.chat.v1.GetAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.GetAttachmentRequest} GetAttachmentRequest + */ + GetAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.GetAttachmentRequest) + return object; + var message = new $root.google.chat.v1.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.chat.v1.GetAttachmentRequest + * @static + * @param {google.chat.v1.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.chat.v1.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.chat.v1.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.chat.v1.GetAttachmentRequest"; + }; + + return GetAttachmentRequest; + })(); + + v1.UploadAttachmentRequest = (function() { + + /** + * Properties of an UploadAttachmentRequest. + * @memberof google.chat.v1 + * @interface IUploadAttachmentRequest + * @property {string|null} [parent] UploadAttachmentRequest parent + * @property {string|null} [filename] UploadAttachmentRequest filename + */ + + /** + * Constructs a new UploadAttachmentRequest. + * @memberof google.chat.v1 + * @classdesc Represents an UploadAttachmentRequest. + * @implements IUploadAttachmentRequest + * @constructor + * @param {google.chat.v1.IUploadAttachmentRequest=} [properties] Properties to set + */ + function UploadAttachmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UploadAttachmentRequest parent. + * @member {string} parent + * @memberof google.chat.v1.UploadAttachmentRequest + * @instance + */ + UploadAttachmentRequest.prototype.parent = ""; + + /** + * UploadAttachmentRequest filename. + * @member {string} filename + * @memberof google.chat.v1.UploadAttachmentRequest + * @instance + */ + UploadAttachmentRequest.prototype.filename = ""; + + /** + * Creates a new UploadAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.UploadAttachmentRequest + * @static + * @param {google.chat.v1.IUploadAttachmentRequest=} [properties] Properties to set + * @returns {google.chat.v1.UploadAttachmentRequest} UploadAttachmentRequest instance + */ + UploadAttachmentRequest.create = function create(properties) { + return new UploadAttachmentRequest(properties); + }; + + /** + * Encodes the specified UploadAttachmentRequest message. Does not implicitly {@link google.chat.v1.UploadAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.UploadAttachmentRequest + * @static + * @param {google.chat.v1.IUploadAttachmentRequest} message UploadAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadAttachmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filename); + return writer; + }; + + /** + * Encodes the specified UploadAttachmentRequest message, length delimited. Does not implicitly {@link google.chat.v1.UploadAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.UploadAttachmentRequest + * @static + * @param {google.chat.v1.IUploadAttachmentRequest} message UploadAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UploadAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.UploadAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.UploadAttachmentRequest} UploadAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadAttachmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UploadAttachmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.filename = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UploadAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.UploadAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.UploadAttachmentRequest} UploadAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UploadAttachmentRequest message. + * @function verify + * @memberof google.chat.v1.UploadAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UploadAttachmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filename != null && message.hasOwnProperty("filename")) + if (!$util.isString(message.filename)) + return "filename: string expected"; + return null; + }; + + /** + * Creates an UploadAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.UploadAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.UploadAttachmentRequest} UploadAttachmentRequest + */ + UploadAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.UploadAttachmentRequest) + return object; + var message = new $root.google.chat.v1.UploadAttachmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filename != null) + message.filename = String(object.filename); + return message; + }; + + /** + * Creates a plain object from an UploadAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.UploadAttachmentRequest + * @static + * @param {google.chat.v1.UploadAttachmentRequest} message UploadAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UploadAttachmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filename = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filename != null && message.hasOwnProperty("filename")) + object.filename = message.filename; + return object; + }; + + /** + * Converts this UploadAttachmentRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.UploadAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + UploadAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UploadAttachmentRequest + * @function getTypeUrl + * @memberof google.chat.v1.UploadAttachmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UploadAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.UploadAttachmentRequest"; + }; + + return UploadAttachmentRequest; + })(); + + v1.UploadAttachmentResponse = (function() { + + /** + * Properties of an UploadAttachmentResponse. + * @memberof google.chat.v1 + * @interface IUploadAttachmentResponse + * @property {google.chat.v1.IAttachmentDataRef|null} [attachmentDataRef] UploadAttachmentResponse attachmentDataRef + */ + + /** + * Constructs a new UploadAttachmentResponse. + * @memberof google.chat.v1 + * @classdesc Represents an UploadAttachmentResponse. + * @implements IUploadAttachmentResponse + * @constructor + * @param {google.chat.v1.IUploadAttachmentResponse=} [properties] Properties to set + */ + function UploadAttachmentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UploadAttachmentResponse attachmentDataRef. + * @member {google.chat.v1.IAttachmentDataRef|null|undefined} attachmentDataRef + * @memberof google.chat.v1.UploadAttachmentResponse + * @instance + */ + UploadAttachmentResponse.prototype.attachmentDataRef = null; + + /** + * Creates a new UploadAttachmentResponse instance using the specified properties. + * @function create + * @memberof google.chat.v1.UploadAttachmentResponse + * @static + * @param {google.chat.v1.IUploadAttachmentResponse=} [properties] Properties to set + * @returns {google.chat.v1.UploadAttachmentResponse} UploadAttachmentResponse instance + */ + UploadAttachmentResponse.create = function create(properties) { + return new UploadAttachmentResponse(properties); + }; + + /** + * Encodes the specified UploadAttachmentResponse message. Does not implicitly {@link google.chat.v1.UploadAttachmentResponse.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.UploadAttachmentResponse + * @static + * @param {google.chat.v1.IUploadAttachmentResponse} message UploadAttachmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadAttachmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachmentDataRef != null && Object.hasOwnProperty.call(message, "attachmentDataRef")) + $root.google.chat.v1.AttachmentDataRef.encode(message.attachmentDataRef, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UploadAttachmentResponse message, length delimited. Does not implicitly {@link google.chat.v1.UploadAttachmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.UploadAttachmentResponse + * @static + * @param {google.chat.v1.IUploadAttachmentResponse} message UploadAttachmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadAttachmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UploadAttachmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.UploadAttachmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.UploadAttachmentResponse} UploadAttachmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadAttachmentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UploadAttachmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attachmentDataRef = $root.google.chat.v1.AttachmentDataRef.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UploadAttachmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.UploadAttachmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.UploadAttachmentResponse} UploadAttachmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadAttachmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UploadAttachmentResponse message. + * @function verify + * @memberof google.chat.v1.UploadAttachmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UploadAttachmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachmentDataRef != null && message.hasOwnProperty("attachmentDataRef")) { + var error = $root.google.chat.v1.AttachmentDataRef.verify(message.attachmentDataRef); + if (error) + return "attachmentDataRef." + error; + } + return null; + }; + + /** + * Creates an UploadAttachmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.UploadAttachmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.UploadAttachmentResponse} UploadAttachmentResponse + */ + UploadAttachmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.UploadAttachmentResponse) + return object; + var message = new $root.google.chat.v1.UploadAttachmentResponse(); + if (object.attachmentDataRef != null) { + if (typeof object.attachmentDataRef !== "object") + throw TypeError(".google.chat.v1.UploadAttachmentResponse.attachmentDataRef: object expected"); + message.attachmentDataRef = $root.google.chat.v1.AttachmentDataRef.fromObject(object.attachmentDataRef); + } + return message; + }; + + /** + * Creates a plain object from an UploadAttachmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.UploadAttachmentResponse + * @static + * @param {google.chat.v1.UploadAttachmentResponse} message UploadAttachmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UploadAttachmentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.attachmentDataRef = null; + if (message.attachmentDataRef != null && message.hasOwnProperty("attachmentDataRef")) + object.attachmentDataRef = $root.google.chat.v1.AttachmentDataRef.toObject(message.attachmentDataRef, options); + return object; + }; + + /** + * Converts this UploadAttachmentResponse to JSON. + * @function toJSON + * @memberof google.chat.v1.UploadAttachmentResponse + * @instance + * @returns {Object.} JSON object + */ + UploadAttachmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UploadAttachmentResponse + * @function getTypeUrl + * @memberof google.chat.v1.UploadAttachmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UploadAttachmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.UploadAttachmentResponse"; + }; + + return UploadAttachmentResponse; + })(); + + v1.User = (function() { + + /** + * Properties of a User. + * @memberof google.chat.v1 + * @interface IUser + * @property {string|null} [name] User name + * @property {string|null} [displayName] User displayName + * @property {string|null} [domainId] User domainId + * @property {google.chat.v1.User.Type|null} [type] User type + * @property {boolean|null} [isAnonymous] User isAnonymous + */ + + /** + * Constructs a new User. + * @memberof google.chat.v1 + * @classdesc Represents a User. + * @implements IUser + * @constructor + * @param {google.chat.v1.IUser=} [properties] Properties to set + */ + function User(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * User name. + * @member {string} name + * @memberof google.chat.v1.User + * @instance + */ + User.prototype.name = ""; + + /** + * User displayName. + * @member {string} displayName + * @memberof google.chat.v1.User + * @instance + */ + User.prototype.displayName = ""; + + /** + * User domainId. + * @member {string} domainId + * @memberof google.chat.v1.User + * @instance + */ + User.prototype.domainId = ""; + + /** + * User type. + * @member {google.chat.v1.User.Type} type + * @memberof google.chat.v1.User + * @instance + */ + User.prototype.type = 0; + + /** + * User isAnonymous. + * @member {boolean} isAnonymous + * @memberof google.chat.v1.User + * @instance + */ + User.prototype.isAnonymous = false; + + /** + * Creates a new User instance using the specified properties. + * @function create + * @memberof google.chat.v1.User + * @static + * @param {google.chat.v1.IUser=} [properties] Properties to set + * @returns {google.chat.v1.User} User instance + */ + User.create = function create(properties) { + return new User(properties); + }; + + /** + * Encodes the specified User message. Does not implicitly {@link google.chat.v1.User.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.User + * @static + * @param {google.chat.v1.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.domainId != null && Object.hasOwnProperty.call(message, "domainId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.domainId); + if (message.isAnonymous != null && Object.hasOwnProperty.call(message, "isAnonymous")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isAnonymous); + return writer; + }; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.chat.v1.User.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.User + * @static + * @param {google.chat.v1.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a User message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.User(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 6: { + message.domainId = reader.string(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 7: { + message.isAnonymous = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a User message. + * @function verify + * @memberof google.chat.v1.User + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + User.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.domainId != null && message.hasOwnProperty("domainId")) + if (!$util.isString(message.domainId)) + return "domainId: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.isAnonymous != null && message.hasOwnProperty("isAnonymous")) + if (typeof message.isAnonymous !== "boolean") + return "isAnonymous: boolean expected"; + return null; + }; + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.User + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.User} User + */ + User.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.User) + return object; + var message = new $root.google.chat.v1.User(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.domainId != null) + message.domainId = String(object.domainId); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "HUMAN": + case 1: + message.type = 1; + break; + case "BOT": + case 2: + message.type = 2; + break; + } + if (object.isAnonymous != null) + message.isAnonymous = Boolean(object.isAnonymous); + return message; + }; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.User + * @static + * @param {google.chat.v1.User} message User + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + User.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.domainId = ""; + object.isAnonymous = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.chat.v1.User.Type[message.type] === undefined ? message.type : $root.google.chat.v1.User.Type[message.type] : message.type; + if (message.domainId != null && message.hasOwnProperty("domainId")) + object.domainId = message.domainId; + if (message.isAnonymous != null && message.hasOwnProperty("isAnonymous")) + object.isAnonymous = message.isAnonymous; + return object; + }; + + /** + * Converts this User to JSON. + * @function toJSON + * @memberof google.chat.v1.User + * @instance + * @returns {Object.} JSON object + */ + User.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for User + * @function getTypeUrl + * @memberof google.chat.v1.User + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.User"; + }; + + /** + * Type enum. + * @name google.chat.v1.User.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} HUMAN=1 HUMAN value + * @property {number} BOT=2 BOT value + */ + User.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HUMAN"] = 1; + values[valuesById[2] = "BOT"] = 2; + return values; + })(); + + return User; + })(); + + v1.ChatService = (function() { + + /** + * Constructs a new ChatService service. + * @memberof google.chat.v1 + * @classdesc Represents a ChatService + * @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 ChatService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ChatService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ChatService; + + /** + * Creates new ChatService service using the specified rpc implementation. + * @function create + * @memberof google.chat.v1.ChatService + * @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 {ChatService} RPC service. Useful where requests and/or responses are streamed. + */ + ChatService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.chat.v1.ChatService|createMessage}. + * @memberof google.chat.v1.ChatService + * @typedef CreateMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Message} [response] Message + */ + + /** + * Calls CreateMessage. + * @function createMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateMessageRequest} request CreateMessageRequest message or plain object + * @param {google.chat.v1.ChatService.CreateMessageCallback} callback Node-style callback called with the error, if any, and Message + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.createMessage = function createMessage(request, callback) { + return this.rpcCall(createMessage, $root.google.chat.v1.CreateMessageRequest, $root.google.chat.v1.Message, request, callback); + }, "name", { value: "CreateMessage" }); + + /** + * Calls CreateMessage. + * @function createMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateMessageRequest} request CreateMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|listMessages}. + * @memberof google.chat.v1.ChatService + * @typedef ListMessagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.ListMessagesResponse} [response] ListMessagesResponse + */ + + /** + * Calls ListMessages. + * @function listMessages + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListMessagesRequest} request ListMessagesRequest message or plain object + * @param {google.chat.v1.ChatService.ListMessagesCallback} callback Node-style callback called with the error, if any, and ListMessagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.listMessages = function listMessages(request, callback) { + return this.rpcCall(listMessages, $root.google.chat.v1.ListMessagesRequest, $root.google.chat.v1.ListMessagesResponse, request, callback); + }, "name", { value: "ListMessages" }); + + /** + * Calls ListMessages. + * @function listMessages + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListMessagesRequest} request ListMessagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|listMemberships}. + * @memberof google.chat.v1.ChatService + * @typedef ListMembershipsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.ListMembershipsResponse} [response] ListMembershipsResponse + */ + + /** + * Calls ListMemberships. + * @function listMemberships + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListMembershipsRequest} request ListMembershipsRequest message or plain object + * @param {google.chat.v1.ChatService.ListMembershipsCallback} callback Node-style callback called with the error, if any, and ListMembershipsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.listMemberships = function listMemberships(request, callback) { + return this.rpcCall(listMemberships, $root.google.chat.v1.ListMembershipsRequest, $root.google.chat.v1.ListMembershipsResponse, request, callback); + }, "name", { value: "ListMemberships" }); + + /** + * Calls ListMemberships. + * @function listMemberships + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListMembershipsRequest} request ListMembershipsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|getMembership}. + * @memberof google.chat.v1.ChatService + * @typedef GetMembershipCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Membership} [response] Membership + */ + + /** + * Calls GetMembership. + * @function getMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetMembershipRequest} request GetMembershipRequest message or plain object + * @param {google.chat.v1.ChatService.GetMembershipCallback} callback Node-style callback called with the error, if any, and Membership + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.getMembership = function getMembership(request, callback) { + return this.rpcCall(getMembership, $root.google.chat.v1.GetMembershipRequest, $root.google.chat.v1.Membership, request, callback); + }, "name", { value: "GetMembership" }); + + /** + * Calls GetMembership. + * @function getMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetMembershipRequest} request GetMembershipRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|getMessage}. + * @memberof google.chat.v1.ChatService + * @typedef GetMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Message} [response] Message + */ + + /** + * Calls GetMessage. + * @function getMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetMessageRequest} request GetMessageRequest message or plain object + * @param {google.chat.v1.ChatService.GetMessageCallback} callback Node-style callback called with the error, if any, and Message + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.getMessage = function getMessage(request, callback) { + return this.rpcCall(getMessage, $root.google.chat.v1.GetMessageRequest, $root.google.chat.v1.Message, request, callback); + }, "name", { value: "GetMessage" }); + + /** + * Calls GetMessage. + * @function getMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetMessageRequest} request GetMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|updateMessage}. + * @memberof google.chat.v1.ChatService + * @typedef UpdateMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Message} [response] Message + */ + + /** + * Calls UpdateMessage. + * @function updateMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUpdateMessageRequest} request UpdateMessageRequest message or plain object + * @param {google.chat.v1.ChatService.UpdateMessageCallback} callback Node-style callback called with the error, if any, and Message + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.updateMessage = function updateMessage(request, callback) { + return this.rpcCall(updateMessage, $root.google.chat.v1.UpdateMessageRequest, $root.google.chat.v1.Message, request, callback); + }, "name", { value: "UpdateMessage" }); + + /** + * Calls UpdateMessage. + * @function updateMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUpdateMessageRequest} request UpdateMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|deleteMessage}. + * @memberof google.chat.v1.ChatService + * @typedef DeleteMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteMessage. + * @function deleteMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteMessageRequest} request DeleteMessageRequest message or plain object + * @param {google.chat.v1.ChatService.DeleteMessageCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.deleteMessage = function deleteMessage(request, callback) { + return this.rpcCall(deleteMessage, $root.google.chat.v1.DeleteMessageRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteMessage" }); + + /** + * Calls DeleteMessage. + * @function deleteMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteMessageRequest} request DeleteMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|getAttachment}. + * @memberof google.chat.v1.ChatService + * @typedef GetAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Attachment} [response] Attachment + */ + + /** + * Calls GetAttachment. + * @function getAttachment + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetAttachmentRequest} request GetAttachmentRequest message or plain object + * @param {google.chat.v1.ChatService.GetAttachmentCallback} callback Node-style callback called with the error, if any, and Attachment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.getAttachment = function getAttachment(request, callback) { + return this.rpcCall(getAttachment, $root.google.chat.v1.GetAttachmentRequest, $root.google.chat.v1.Attachment, request, callback); + }, "name", { value: "GetAttachment" }); + + /** + * Calls GetAttachment. + * @function getAttachment + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetAttachmentRequest} request GetAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|uploadAttachment}. + * @memberof google.chat.v1.ChatService + * @typedef UploadAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.UploadAttachmentResponse} [response] UploadAttachmentResponse + */ + + /** + * Calls UploadAttachment. + * @function uploadAttachment + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUploadAttachmentRequest} request UploadAttachmentRequest message or plain object + * @param {google.chat.v1.ChatService.UploadAttachmentCallback} callback Node-style callback called with the error, if any, and UploadAttachmentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.uploadAttachment = function uploadAttachment(request, callback) { + return this.rpcCall(uploadAttachment, $root.google.chat.v1.UploadAttachmentRequest, $root.google.chat.v1.UploadAttachmentResponse, request, callback); + }, "name", { value: "UploadAttachment" }); + + /** + * Calls UploadAttachment. + * @function uploadAttachment + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUploadAttachmentRequest} request UploadAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|listSpaces}. + * @memberof google.chat.v1.ChatService + * @typedef ListSpacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.ListSpacesResponse} [response] ListSpacesResponse + */ + + /** + * Calls ListSpaces. + * @function listSpaces + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListSpacesRequest} request ListSpacesRequest message or plain object + * @param {google.chat.v1.ChatService.ListSpacesCallback} callback Node-style callback called with the error, if any, and ListSpacesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.listSpaces = function listSpaces(request, callback) { + return this.rpcCall(listSpaces, $root.google.chat.v1.ListSpacesRequest, $root.google.chat.v1.ListSpacesResponse, request, callback); + }, "name", { value: "ListSpaces" }); + + /** + * Calls ListSpaces. + * @function listSpaces + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListSpacesRequest} request ListSpacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|searchSpaces}. + * @memberof google.chat.v1.ChatService + * @typedef SearchSpacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.SearchSpacesResponse} [response] SearchSpacesResponse + */ + + /** + * Calls SearchSpaces. + * @function searchSpaces + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ISearchSpacesRequest} request SearchSpacesRequest message or plain object + * @param {google.chat.v1.ChatService.SearchSpacesCallback} callback Node-style callback called with the error, if any, and SearchSpacesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.searchSpaces = function searchSpaces(request, callback) { + return this.rpcCall(searchSpaces, $root.google.chat.v1.SearchSpacesRequest, $root.google.chat.v1.SearchSpacesResponse, request, callback); + }, "name", { value: "SearchSpaces" }); + + /** + * Calls SearchSpaces. + * @function searchSpaces + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ISearchSpacesRequest} request SearchSpacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|getSpace}. + * @memberof google.chat.v1.ChatService + * @typedef GetSpaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Space} [response] Space + */ + + /** + * Calls GetSpace. + * @function getSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetSpaceRequest} request GetSpaceRequest message or plain object + * @param {google.chat.v1.ChatService.GetSpaceCallback} callback Node-style callback called with the error, if any, and Space + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.getSpace = function getSpace(request, callback) { + return this.rpcCall(getSpace, $root.google.chat.v1.GetSpaceRequest, $root.google.chat.v1.Space, request, callback); + }, "name", { value: "GetSpace" }); + + /** + * Calls GetSpace. + * @function getSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetSpaceRequest} request GetSpaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|createSpace}. + * @memberof google.chat.v1.ChatService + * @typedef CreateSpaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Space} [response] Space + */ + + /** + * Calls CreateSpace. + * @function createSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateSpaceRequest} request CreateSpaceRequest message or plain object + * @param {google.chat.v1.ChatService.CreateSpaceCallback} callback Node-style callback called with the error, if any, and Space + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.createSpace = function createSpace(request, callback) { + return this.rpcCall(createSpace, $root.google.chat.v1.CreateSpaceRequest, $root.google.chat.v1.Space, request, callback); + }, "name", { value: "CreateSpace" }); + + /** + * Calls CreateSpace. + * @function createSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateSpaceRequest} request CreateSpaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|setUpSpace}. + * @memberof google.chat.v1.ChatService + * @typedef SetUpSpaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Space} [response] Space + */ + + /** + * Calls SetUpSpace. + * @function setUpSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ISetUpSpaceRequest} request SetUpSpaceRequest message or plain object + * @param {google.chat.v1.ChatService.SetUpSpaceCallback} callback Node-style callback called with the error, if any, and Space + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.setUpSpace = function setUpSpace(request, callback) { + return this.rpcCall(setUpSpace, $root.google.chat.v1.SetUpSpaceRequest, $root.google.chat.v1.Space, request, callback); + }, "name", { value: "SetUpSpace" }); + + /** + * Calls SetUpSpace. + * @function setUpSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ISetUpSpaceRequest} request SetUpSpaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|updateSpace}. + * @memberof google.chat.v1.ChatService + * @typedef UpdateSpaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Space} [response] Space + */ + + /** + * Calls UpdateSpace. + * @function updateSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUpdateSpaceRequest} request UpdateSpaceRequest message or plain object + * @param {google.chat.v1.ChatService.UpdateSpaceCallback} callback Node-style callback called with the error, if any, and Space + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.updateSpace = function updateSpace(request, callback) { + return this.rpcCall(updateSpace, $root.google.chat.v1.UpdateSpaceRequest, $root.google.chat.v1.Space, request, callback); + }, "name", { value: "UpdateSpace" }); + + /** + * Calls UpdateSpace. + * @function updateSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUpdateSpaceRequest} request UpdateSpaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|deleteSpace}. + * @memberof google.chat.v1.ChatService + * @typedef DeleteSpaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSpace. + * @function deleteSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteSpaceRequest} request DeleteSpaceRequest message or plain object + * @param {google.chat.v1.ChatService.DeleteSpaceCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.deleteSpace = function deleteSpace(request, callback) { + return this.rpcCall(deleteSpace, $root.google.chat.v1.DeleteSpaceRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSpace" }); + + /** + * Calls DeleteSpace. + * @function deleteSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteSpaceRequest} request DeleteSpaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|completeImportSpace}. + * @memberof google.chat.v1.ChatService + * @typedef CompleteImportSpaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.CompleteImportSpaceResponse} [response] CompleteImportSpaceResponse + */ + + /** + * Calls CompleteImportSpace. + * @function completeImportSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICompleteImportSpaceRequest} request CompleteImportSpaceRequest message or plain object + * @param {google.chat.v1.ChatService.CompleteImportSpaceCallback} callback Node-style callback called with the error, if any, and CompleteImportSpaceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.completeImportSpace = function completeImportSpace(request, callback) { + return this.rpcCall(completeImportSpace, $root.google.chat.v1.CompleteImportSpaceRequest, $root.google.chat.v1.CompleteImportSpaceResponse, request, callback); + }, "name", { value: "CompleteImportSpace" }); + + /** + * Calls CompleteImportSpace. + * @function completeImportSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICompleteImportSpaceRequest} request CompleteImportSpaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|findDirectMessage}. + * @memberof google.chat.v1.ChatService + * @typedef FindDirectMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Space} [response] Space + */ + + /** + * Calls FindDirectMessage. + * @function findDirectMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IFindDirectMessageRequest} request FindDirectMessageRequest message or plain object + * @param {google.chat.v1.ChatService.FindDirectMessageCallback} callback Node-style callback called with the error, if any, and Space + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.findDirectMessage = function findDirectMessage(request, callback) { + return this.rpcCall(findDirectMessage, $root.google.chat.v1.FindDirectMessageRequest, $root.google.chat.v1.Space, request, callback); + }, "name", { value: "FindDirectMessage" }); + + /** + * Calls FindDirectMessage. + * @function findDirectMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IFindDirectMessageRequest} request FindDirectMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|createMembership}. + * @memberof google.chat.v1.ChatService + * @typedef CreateMembershipCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Membership} [response] Membership + */ + + /** + * Calls CreateMembership. + * @function createMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateMembershipRequest} request CreateMembershipRequest message or plain object + * @param {google.chat.v1.ChatService.CreateMembershipCallback} callback Node-style callback called with the error, if any, and Membership + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.createMembership = function createMembership(request, callback) { + return this.rpcCall(createMembership, $root.google.chat.v1.CreateMembershipRequest, $root.google.chat.v1.Membership, request, callback); + }, "name", { value: "CreateMembership" }); + + /** + * Calls CreateMembership. + * @function createMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateMembershipRequest} request CreateMembershipRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|updateMembership}. + * @memberof google.chat.v1.ChatService + * @typedef UpdateMembershipCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Membership} [response] Membership + */ + + /** + * Calls UpdateMembership. + * @function updateMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUpdateMembershipRequest} request UpdateMembershipRequest message or plain object + * @param {google.chat.v1.ChatService.UpdateMembershipCallback} callback Node-style callback called with the error, if any, and Membership + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.updateMembership = function updateMembership(request, callback) { + return this.rpcCall(updateMembership, $root.google.chat.v1.UpdateMembershipRequest, $root.google.chat.v1.Membership, request, callback); + }, "name", { value: "UpdateMembership" }); + + /** + * Calls UpdateMembership. + * @function updateMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUpdateMembershipRequest} request UpdateMembershipRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|deleteMembership}. + * @memberof google.chat.v1.ChatService + * @typedef DeleteMembershipCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Membership} [response] Membership + */ + + /** + * Calls DeleteMembership. + * @function deleteMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteMembershipRequest} request DeleteMembershipRequest message or plain object + * @param {google.chat.v1.ChatService.DeleteMembershipCallback} callback Node-style callback called with the error, if any, and Membership + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.deleteMembership = function deleteMembership(request, callback) { + return this.rpcCall(deleteMembership, $root.google.chat.v1.DeleteMembershipRequest, $root.google.chat.v1.Membership, request, callback); + }, "name", { value: "DeleteMembership" }); + + /** + * Calls DeleteMembership. + * @function deleteMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteMembershipRequest} request DeleteMembershipRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|createReaction}. + * @memberof google.chat.v1.ChatService + * @typedef CreateReactionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Reaction} [response] Reaction + */ + + /** + * Calls CreateReaction. + * @function createReaction + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateReactionRequest} request CreateReactionRequest message or plain object + * @param {google.chat.v1.ChatService.CreateReactionCallback} callback Node-style callback called with the error, if any, and Reaction + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.createReaction = function createReaction(request, callback) { + return this.rpcCall(createReaction, $root.google.chat.v1.CreateReactionRequest, $root.google.chat.v1.Reaction, request, callback); + }, "name", { value: "CreateReaction" }); + + /** + * Calls CreateReaction. + * @function createReaction + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateReactionRequest} request CreateReactionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|listReactions}. + * @memberof google.chat.v1.ChatService + * @typedef ListReactionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.ListReactionsResponse} [response] ListReactionsResponse + */ + + /** + * Calls ListReactions. + * @function listReactions + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListReactionsRequest} request ListReactionsRequest message or plain object + * @param {google.chat.v1.ChatService.ListReactionsCallback} callback Node-style callback called with the error, if any, and ListReactionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.listReactions = function listReactions(request, callback) { + return this.rpcCall(listReactions, $root.google.chat.v1.ListReactionsRequest, $root.google.chat.v1.ListReactionsResponse, request, callback); + }, "name", { value: "ListReactions" }); + + /** + * Calls ListReactions. + * @function listReactions + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListReactionsRequest} request ListReactionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|deleteReaction}. + * @memberof google.chat.v1.ChatService + * @typedef DeleteReactionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteReaction. + * @function deleteReaction + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteReactionRequest} request DeleteReactionRequest message or plain object + * @param {google.chat.v1.ChatService.DeleteReactionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.deleteReaction = function deleteReaction(request, callback) { + return this.rpcCall(deleteReaction, $root.google.chat.v1.DeleteReactionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteReaction" }); + + /** + * Calls DeleteReaction. + * @function deleteReaction + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteReactionRequest} request DeleteReactionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|getSpaceReadState}. + * @memberof google.chat.v1.ChatService + * @typedef GetSpaceReadStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.SpaceReadState} [response] SpaceReadState + */ + + /** + * Calls GetSpaceReadState. + * @function getSpaceReadState + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetSpaceReadStateRequest} request GetSpaceReadStateRequest message or plain object + * @param {google.chat.v1.ChatService.GetSpaceReadStateCallback} callback Node-style callback called with the error, if any, and SpaceReadState + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.getSpaceReadState = function getSpaceReadState(request, callback) { + return this.rpcCall(getSpaceReadState, $root.google.chat.v1.GetSpaceReadStateRequest, $root.google.chat.v1.SpaceReadState, request, callback); + }, "name", { value: "GetSpaceReadState" }); + + /** + * Calls GetSpaceReadState. + * @function getSpaceReadState + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetSpaceReadStateRequest} request GetSpaceReadStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|updateSpaceReadState}. + * @memberof google.chat.v1.ChatService + * @typedef UpdateSpaceReadStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.SpaceReadState} [response] SpaceReadState + */ + + /** + * Calls UpdateSpaceReadState. + * @function updateSpaceReadState + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUpdateSpaceReadStateRequest} request UpdateSpaceReadStateRequest message or plain object + * @param {google.chat.v1.ChatService.UpdateSpaceReadStateCallback} callback Node-style callback called with the error, if any, and SpaceReadState + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.updateSpaceReadState = function updateSpaceReadState(request, callback) { + return this.rpcCall(updateSpaceReadState, $root.google.chat.v1.UpdateSpaceReadStateRequest, $root.google.chat.v1.SpaceReadState, request, callback); + }, "name", { value: "UpdateSpaceReadState" }); + + /** + * Calls UpdateSpaceReadState. + * @function updateSpaceReadState + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUpdateSpaceReadStateRequest} request UpdateSpaceReadStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|getThreadReadState}. + * @memberof google.chat.v1.ChatService + * @typedef GetThreadReadStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.ThreadReadState} [response] ThreadReadState + */ + + /** + * Calls GetThreadReadState. + * @function getThreadReadState + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetThreadReadStateRequest} request GetThreadReadStateRequest message or plain object + * @param {google.chat.v1.ChatService.GetThreadReadStateCallback} callback Node-style callback called with the error, if any, and ThreadReadState + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.getThreadReadState = function getThreadReadState(request, callback) { + return this.rpcCall(getThreadReadState, $root.google.chat.v1.GetThreadReadStateRequest, $root.google.chat.v1.ThreadReadState, request, callback); + }, "name", { value: "GetThreadReadState" }); + + /** + * Calls GetThreadReadState. + * @function getThreadReadState + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetThreadReadStateRequest} request GetThreadReadStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|getSpaceEvent}. + * @memberof google.chat.v1.ChatService + * @typedef GetSpaceEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.SpaceEvent} [response] SpaceEvent + */ + + /** + * Calls GetSpaceEvent. + * @function getSpaceEvent + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetSpaceEventRequest} request GetSpaceEventRequest message or plain object + * @param {google.chat.v1.ChatService.GetSpaceEventCallback} callback Node-style callback called with the error, if any, and SpaceEvent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.getSpaceEvent = function getSpaceEvent(request, callback) { + return this.rpcCall(getSpaceEvent, $root.google.chat.v1.GetSpaceEventRequest, $root.google.chat.v1.SpaceEvent, request, callback); + }, "name", { value: "GetSpaceEvent" }); + + /** + * Calls GetSpaceEvent. + * @function getSpaceEvent + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetSpaceEventRequest} request GetSpaceEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.chat.v1.ChatService|listSpaceEvents}. + * @memberof google.chat.v1.ChatService + * @typedef ListSpaceEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.ListSpaceEventsResponse} [response] ListSpaceEventsResponse + */ + + /** + * Calls ListSpaceEvents. + * @function listSpaceEvents + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListSpaceEventsRequest} request ListSpaceEventsRequest message or plain object + * @param {google.chat.v1.ChatService.ListSpaceEventsCallback} callback Node-style callback called with the error, if any, and ListSpaceEventsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.listSpaceEvents = function listSpaceEvents(request, callback) { + return this.rpcCall(listSpaceEvents, $root.google.chat.v1.ListSpaceEventsRequest, $root.google.chat.v1.ListSpaceEventsResponse, request, callback); + }, "name", { value: "ListSpaceEvents" }); + + /** + * Calls ListSpaceEvents. + * @function listSpaceEvents + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListSpaceEventsRequest} request ListSpaceEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ChatService; + })(); + + v1.Membership = (function() { + + /** + * Properties of a Membership. + * @memberof google.chat.v1 + * @interface IMembership + * @property {string|null} [name] Membership name + * @property {google.chat.v1.Membership.MembershipState|null} [state] Membership state + * @property {google.chat.v1.Membership.MembershipRole|null} [role] Membership role + * @property {google.chat.v1.IUser|null} [member] Membership member + * @property {google.chat.v1.IGroup|null} [groupMember] Membership groupMember + * @property {google.protobuf.ITimestamp|null} [createTime] Membership createTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Membership deleteTime + */ + + /** + * Constructs a new Membership. + * @memberof google.chat.v1 + * @classdesc Represents a Membership. + * @implements IMembership + * @constructor + * @param {google.chat.v1.IMembership=} [properties] Properties to set + */ + function Membership(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Membership name. + * @member {string} name + * @memberof google.chat.v1.Membership + * @instance + */ + Membership.prototype.name = ""; + + /** + * Membership state. + * @member {google.chat.v1.Membership.MembershipState} state + * @memberof google.chat.v1.Membership + * @instance + */ + Membership.prototype.state = 0; + + /** + * Membership role. + * @member {google.chat.v1.Membership.MembershipRole} role + * @memberof google.chat.v1.Membership + * @instance + */ + Membership.prototype.role = 0; + + /** + * Membership member. + * @member {google.chat.v1.IUser|null|undefined} member + * @memberof google.chat.v1.Membership + * @instance + */ + Membership.prototype.member = null; + + /** + * Membership groupMember. + * @member {google.chat.v1.IGroup|null|undefined} groupMember + * @memberof google.chat.v1.Membership + * @instance + */ + Membership.prototype.groupMember = null; + + /** + * Membership createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.chat.v1.Membership + * @instance + */ + Membership.prototype.createTime = null; + + /** + * Membership deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.chat.v1.Membership + * @instance + */ + Membership.prototype.deleteTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Membership memberType. + * @member {"member"|"groupMember"|undefined} memberType + * @memberof google.chat.v1.Membership + * @instance + */ + Object.defineProperty(Membership.prototype, "memberType", { + get: $util.oneOfGetter($oneOfFields = ["member", "groupMember"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Membership instance using the specified properties. + * @function create + * @memberof google.chat.v1.Membership + * @static + * @param {google.chat.v1.IMembership=} [properties] Properties to set + * @returns {google.chat.v1.Membership} Membership instance + */ + Membership.create = function create(properties) { + return new Membership(properties); + }; + + /** + * Encodes the specified Membership message. Does not implicitly {@link google.chat.v1.Membership.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Membership + * @static + * @param {google.chat.v1.IMembership} message Membership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Membership.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + $root.google.chat.v1.User.encode(message.member, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.groupMember != null && Object.hasOwnProperty.call(message, "groupMember")) + $root.google.chat.v1.Group.encode(message.groupMember, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.role); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Membership message, length delimited. Does not implicitly {@link google.chat.v1.Membership.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Membership + * @static + * @param {google.chat.v1.IMembership} message Membership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Membership.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Membership message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Membership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Membership} Membership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Membership.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Membership(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 7: { + message.role = reader.int32(); + break; + } + case 3: { + message.member = $root.google.chat.v1.User.decode(reader, reader.uint32()); + break; + } + case 5: { + message.groupMember = $root.google.chat.v1.Group.decode(reader, reader.uint32()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Membership message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Membership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Membership} Membership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Membership.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Membership message. + * @function verify + * @memberof google.chat.v1.Membership + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Membership.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + switch (message.role) { + default: + return "role: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.member != null && message.hasOwnProperty("member")) { + properties.memberType = 1; + { + var error = $root.google.chat.v1.User.verify(message.member); + if (error) + return "member." + error; + } + } + if (message.groupMember != null && message.hasOwnProperty("groupMember")) { + if (properties.memberType === 1) + return "memberType: multiple values"; + properties.memberType = 1; + { + var error = $root.google.chat.v1.Group.verify(message.groupMember); + if (error) + return "groupMember." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + return null; + }; + + /** + * Creates a Membership message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Membership + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Membership} Membership + */ + Membership.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Membership) + return object; + var message = new $root.google.chat.v1.Membership(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "MEMBERSHIP_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "JOINED": + case 1: + message.state = 1; + break; + case "INVITED": + case 2: + message.state = 2; + break; + case "NOT_A_MEMBER": + case 3: + message.state = 3; + break; + } + switch (object.role) { + default: + if (typeof object.role === "number") { + message.role = object.role; + break; + } + break; + case "MEMBERSHIP_ROLE_UNSPECIFIED": + case 0: + message.role = 0; + break; + case "ROLE_MEMBER": + case 1: + message.role = 1; + break; + case "ROLE_MANAGER": + case 2: + message.role = 2; + break; + } + if (object.member != null) { + if (typeof object.member !== "object") + throw TypeError(".google.chat.v1.Membership.member: object expected"); + message.member = $root.google.chat.v1.User.fromObject(object.member); + } + if (object.groupMember != null) { + if (typeof object.groupMember !== "object") + throw TypeError(".google.chat.v1.Membership.groupMember: object expected"); + message.groupMember = $root.google.chat.v1.Group.fromObject(object.groupMember); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.chat.v1.Membership.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.chat.v1.Membership.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + return message; + }; + + /** + * Creates a plain object from a Membership message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Membership + * @static + * @param {google.chat.v1.Membership} message Membership + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Membership.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "MEMBERSHIP_STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.role = options.enums === String ? "MEMBERSHIP_ROLE_UNSPECIFIED" : 0; + object.deleteTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.chat.v1.Membership.MembershipState[message.state] === undefined ? message.state : $root.google.chat.v1.Membership.MembershipState[message.state] : message.state; + if (message.member != null && message.hasOwnProperty("member")) { + object.member = $root.google.chat.v1.User.toObject(message.member, options); + if (options.oneofs) + object.memberType = "member"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.groupMember != null && message.hasOwnProperty("groupMember")) { + object.groupMember = $root.google.chat.v1.Group.toObject(message.groupMember, options); + if (options.oneofs) + object.memberType = "groupMember"; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = options.enums === String ? $root.google.chat.v1.Membership.MembershipRole[message.role] === undefined ? message.role : $root.google.chat.v1.Membership.MembershipRole[message.role] : message.role; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + return object; + }; + + /** + * Converts this Membership to JSON. + * @function toJSON + * @memberof google.chat.v1.Membership + * @instance + * @returns {Object.} JSON object + */ + Membership.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Membership + * @function getTypeUrl + * @memberof google.chat.v1.Membership + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Membership.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Membership"; + }; + + /** + * MembershipState enum. + * @name google.chat.v1.Membership.MembershipState + * @enum {number} + * @property {number} MEMBERSHIP_STATE_UNSPECIFIED=0 MEMBERSHIP_STATE_UNSPECIFIED value + * @property {number} JOINED=1 JOINED value + * @property {number} INVITED=2 INVITED value + * @property {number} NOT_A_MEMBER=3 NOT_A_MEMBER value + */ + Membership.MembershipState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMBERSHIP_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOINED"] = 1; + values[valuesById[2] = "INVITED"] = 2; + values[valuesById[3] = "NOT_A_MEMBER"] = 3; + return values; + })(); + + /** + * MembershipRole enum. + * @name google.chat.v1.Membership.MembershipRole + * @enum {number} + * @property {number} MEMBERSHIP_ROLE_UNSPECIFIED=0 MEMBERSHIP_ROLE_UNSPECIFIED value + * @property {number} ROLE_MEMBER=1 ROLE_MEMBER value + * @property {number} ROLE_MANAGER=2 ROLE_MANAGER value + */ + Membership.MembershipRole = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMBERSHIP_ROLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ROLE_MEMBER"] = 1; + values[valuesById[2] = "ROLE_MANAGER"] = 2; + return values; + })(); + + return Membership; + })(); + + v1.CreateMembershipRequest = (function() { + + /** + * Properties of a CreateMembershipRequest. + * @memberof google.chat.v1 + * @interface ICreateMembershipRequest + * @property {string|null} [parent] CreateMembershipRequest parent + * @property {google.chat.v1.IMembership|null} [membership] CreateMembershipRequest membership + * @property {boolean|null} [useAdminAccess] CreateMembershipRequest useAdminAccess + */ + + /** + * Constructs a new CreateMembershipRequest. + * @memberof google.chat.v1 + * @classdesc Represents a CreateMembershipRequest. + * @implements ICreateMembershipRequest + * @constructor + * @param {google.chat.v1.ICreateMembershipRequest=} [properties] Properties to set + */ + function CreateMembershipRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMembershipRequest parent. + * @member {string} parent + * @memberof google.chat.v1.CreateMembershipRequest + * @instance + */ + CreateMembershipRequest.prototype.parent = ""; + + /** + * CreateMembershipRequest membership. + * @member {google.chat.v1.IMembership|null|undefined} membership + * @memberof google.chat.v1.CreateMembershipRequest + * @instance + */ + CreateMembershipRequest.prototype.membership = null; + + /** + * CreateMembershipRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.CreateMembershipRequest + * @instance + */ + CreateMembershipRequest.prototype.useAdminAccess = false; + + /** + * Creates a new CreateMembershipRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.CreateMembershipRequest + * @static + * @param {google.chat.v1.ICreateMembershipRequest=} [properties] Properties to set + * @returns {google.chat.v1.CreateMembershipRequest} CreateMembershipRequest instance + */ + CreateMembershipRequest.create = function create(properties) { + return new CreateMembershipRequest(properties); + }; + + /** + * Encodes the specified CreateMembershipRequest message. Does not implicitly {@link google.chat.v1.CreateMembershipRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CreateMembershipRequest + * @static + * @param {google.chat.v1.ICreateMembershipRequest} message CreateMembershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMembershipRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + $root.google.chat.v1.Membership.encode(message.membership, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.useAdminAccess); + return writer; + }; + + /** + * Encodes the specified CreateMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateMembershipRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CreateMembershipRequest + * @static + * @param {google.chat.v1.ICreateMembershipRequest} message CreateMembershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMembershipRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMembershipRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CreateMembershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CreateMembershipRequest} CreateMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMembershipRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CreateMembershipRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); + break; + } + case 5: { + message.useAdminAccess = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMembershipRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CreateMembershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CreateMembershipRequest} CreateMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMembershipRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMembershipRequest message. + * @function verify + * @memberof google.chat.v1.CreateMembershipRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMembershipRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.membership != null && message.hasOwnProperty("membership")) { + var error = $root.google.chat.v1.Membership.verify(message.membership); + if (error) + return "membership." + error; + } + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; + return null; + }; + + /** + * Creates a CreateMembershipRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CreateMembershipRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CreateMembershipRequest} CreateMembershipRequest + */ + CreateMembershipRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CreateMembershipRequest) + return object; + var message = new $root.google.chat.v1.CreateMembershipRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.membership != null) { + if (typeof object.membership !== "object") + throw TypeError(".google.chat.v1.CreateMembershipRequest.membership: object expected"); + message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); + } + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); + return message; + }; + + /** + * Creates a plain object from a CreateMembershipRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CreateMembershipRequest + * @static + * @param {google.chat.v1.CreateMembershipRequest} message CreateMembershipRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMembershipRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.membership = null; + object.useAdminAccess = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; + return object; + }; + + /** + * Converts this CreateMembershipRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.CreateMembershipRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMembershipRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMembershipRequest + * @function getTypeUrl + * @memberof google.chat.v1.CreateMembershipRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMembershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CreateMembershipRequest"; + }; + + return CreateMembershipRequest; + })(); + + v1.UpdateMembershipRequest = (function() { + + /** + * Properties of an UpdateMembershipRequest. + * @memberof google.chat.v1 + * @interface IUpdateMembershipRequest + * @property {google.chat.v1.IMembership|null} [membership] UpdateMembershipRequest membership + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMembershipRequest updateMask + * @property {boolean|null} [useAdminAccess] UpdateMembershipRequest useAdminAccess + */ + + /** + * Constructs a new UpdateMembershipRequest. + * @memberof google.chat.v1 + * @classdesc Represents an UpdateMembershipRequest. + * @implements IUpdateMembershipRequest + * @constructor + * @param {google.chat.v1.IUpdateMembershipRequest=} [properties] Properties to set + */ + function UpdateMembershipRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMembershipRequest membership. + * @member {google.chat.v1.IMembership|null|undefined} membership + * @memberof google.chat.v1.UpdateMembershipRequest + * @instance + */ + UpdateMembershipRequest.prototype.membership = null; + + /** + * UpdateMembershipRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.chat.v1.UpdateMembershipRequest + * @instance + */ + UpdateMembershipRequest.prototype.updateMask = null; + + /** + * UpdateMembershipRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.UpdateMembershipRequest + * @instance + */ + UpdateMembershipRequest.prototype.useAdminAccess = false; + + /** + * Creates a new UpdateMembershipRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.UpdateMembershipRequest + * @static + * @param {google.chat.v1.IUpdateMembershipRequest=} [properties] Properties to set + * @returns {google.chat.v1.UpdateMembershipRequest} UpdateMembershipRequest instance + */ + UpdateMembershipRequest.create = function create(properties) { + return new UpdateMembershipRequest(properties); + }; + + /** + * Encodes the specified UpdateMembershipRequest message. Does not implicitly {@link google.chat.v1.UpdateMembershipRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.UpdateMembershipRequest + * @static + * @param {google.chat.v1.IUpdateMembershipRequest} message UpdateMembershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMembershipRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + $root.google.chat.v1.Membership.encode(message.membership, 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(); + if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.useAdminAccess); + return writer; + }; + + /** + * Encodes the specified UpdateMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateMembershipRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.UpdateMembershipRequest + * @static + * @param {google.chat.v1.IUpdateMembershipRequest} message UpdateMembershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMembershipRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMembershipRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.UpdateMembershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.UpdateMembershipRequest} UpdateMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMembershipRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UpdateMembershipRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.useAdminAccess = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMembershipRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.UpdateMembershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.UpdateMembershipRequest} UpdateMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMembershipRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMembershipRequest message. + * @function verify + * @memberof google.chat.v1.UpdateMembershipRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMembershipRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.membership != null && message.hasOwnProperty("membership")) { + var error = $root.google.chat.v1.Membership.verify(message.membership); + if (error) + return "membership." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; + return null; + }; + + /** + * Creates an UpdateMembershipRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.UpdateMembershipRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.UpdateMembershipRequest} UpdateMembershipRequest + */ + UpdateMembershipRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.UpdateMembershipRequest) + return object; + var message = new $root.google.chat.v1.UpdateMembershipRequest(); + if (object.membership != null) { + if (typeof object.membership !== "object") + throw TypeError(".google.chat.v1.UpdateMembershipRequest.membership: object expected"); + message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.chat.v1.UpdateMembershipRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); + return message; + }; + + /** + * Creates a plain object from an UpdateMembershipRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.UpdateMembershipRequest + * @static + * @param {google.chat.v1.UpdateMembershipRequest} message UpdateMembershipRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMembershipRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.membership = null; + object.updateMask = null; + object.useAdminAccess = false; + } + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; + return object; + }; + + /** + * Converts this UpdateMembershipRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.UpdateMembershipRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMembershipRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMembershipRequest + * @function getTypeUrl + * @memberof google.chat.v1.UpdateMembershipRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMembershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.UpdateMembershipRequest"; + }; + + return UpdateMembershipRequest; + })(); + + v1.ListMembershipsRequest = (function() { + + /** + * Properties of a ListMembershipsRequest. + * @memberof google.chat.v1 + * @interface IListMembershipsRequest + * @property {string|null} [parent] ListMembershipsRequest parent + * @property {number|null} [pageSize] ListMembershipsRequest pageSize + * @property {string|null} [pageToken] ListMembershipsRequest pageToken + * @property {string|null} [filter] ListMembershipsRequest filter + * @property {boolean|null} [showGroups] ListMembershipsRequest showGroups + * @property {boolean|null} [showInvited] ListMembershipsRequest showInvited + * @property {boolean|null} [useAdminAccess] ListMembershipsRequest useAdminAccess + */ + + /** + * Constructs a new ListMembershipsRequest. + * @memberof google.chat.v1 + * @classdesc Represents a ListMembershipsRequest. + * @implements IListMembershipsRequest + * @constructor + * @param {google.chat.v1.IListMembershipsRequest=} [properties] Properties to set + */ + function ListMembershipsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMembershipsRequest parent. + * @member {string} parent + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + */ + ListMembershipsRequest.prototype.parent = ""; + + /** + * ListMembershipsRequest pageSize. + * @member {number} pageSize + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + */ + ListMembershipsRequest.prototype.pageSize = 0; + + /** + * ListMembershipsRequest pageToken. + * @member {string} pageToken + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + */ + ListMembershipsRequest.prototype.pageToken = ""; + + /** + * ListMembershipsRequest filter. + * @member {string} filter + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + */ + ListMembershipsRequest.prototype.filter = ""; + + /** + * ListMembershipsRequest showGroups. + * @member {boolean} showGroups + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + */ + ListMembershipsRequest.prototype.showGroups = false; + + /** + * ListMembershipsRequest showInvited. + * @member {boolean} showInvited + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + */ + ListMembershipsRequest.prototype.showInvited = false; + + /** + * ListMembershipsRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + */ + ListMembershipsRequest.prototype.useAdminAccess = false; + + /** + * Creates a new ListMembershipsRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListMembershipsRequest + * @static + * @param {google.chat.v1.IListMembershipsRequest=} [properties] Properties to set + * @returns {google.chat.v1.ListMembershipsRequest} ListMembershipsRequest instance + */ + ListMembershipsRequest.create = function create(properties) { + return new ListMembershipsRequest(properties); + }; + + /** + * Encodes the specified ListMembershipsRequest message. Does not implicitly {@link google.chat.v1.ListMembershipsRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListMembershipsRequest + * @static + * @param {google.chat.v1.IListMembershipsRequest} message ListMembershipsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMembershipsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.showGroups != null && Object.hasOwnProperty.call(message, "showGroups")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.showGroups); + if (message.showInvited != null && Object.hasOwnProperty.call(message, "showInvited")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.showInvited); + if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.useAdminAccess); + return writer; + }; + + /** + * Encodes the specified ListMembershipsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListMembershipsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListMembershipsRequest + * @static + * @param {google.chat.v1.IListMembershipsRequest} message ListMembershipsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMembershipsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMembershipsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListMembershipsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListMembershipsRequest} ListMembershipsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMembershipsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListMembershipsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + case 6: { + message.showGroups = reader.bool(); + break; + } + case 7: { + message.showInvited = reader.bool(); + break; + } + case 8: { + message.useAdminAccess = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMembershipsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListMembershipsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListMembershipsRequest} ListMembershipsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMembershipsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMembershipsRequest message. + * @function verify + * @memberof google.chat.v1.ListMembershipsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMembershipsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.showGroups != null && message.hasOwnProperty("showGroups")) + if (typeof message.showGroups !== "boolean") + return "showGroups: boolean expected"; + if (message.showInvited != null && message.hasOwnProperty("showInvited")) + if (typeof message.showInvited !== "boolean") + return "showInvited: boolean expected"; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; + return null; + }; + + /** + * Creates a ListMembershipsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListMembershipsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListMembershipsRequest} ListMembershipsRequest + */ + ListMembershipsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListMembershipsRequest) + return object; + var message = new $root.google.chat.v1.ListMembershipsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.showGroups != null) + message.showGroups = Boolean(object.showGroups); + if (object.showInvited != null) + message.showInvited = Boolean(object.showInvited); + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); + return message; + }; + + /** + * Creates a plain object from a ListMembershipsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListMembershipsRequest + * @static + * @param {google.chat.v1.ListMembershipsRequest} message ListMembershipsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMembershipsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.showGroups = false; + object.showInvited = false; + object.useAdminAccess = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.showGroups != null && message.hasOwnProperty("showGroups")) + object.showGroups = message.showGroups; + if (message.showInvited != null && message.hasOwnProperty("showInvited")) + object.showInvited = message.showInvited; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; + return object; + }; + + /** + * Converts this ListMembershipsRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMembershipsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMembershipsRequest + * @function getTypeUrl + * @memberof google.chat.v1.ListMembershipsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMembershipsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListMembershipsRequest"; + }; + + return ListMembershipsRequest; + })(); + + v1.ListMembershipsResponse = (function() { + + /** + * Properties of a ListMembershipsResponse. + * @memberof google.chat.v1 + * @interface IListMembershipsResponse + * @property {Array.|null} [memberships] ListMembershipsResponse memberships + * @property {string|null} [nextPageToken] ListMembershipsResponse nextPageToken + */ + + /** + * Constructs a new ListMembershipsResponse. + * @memberof google.chat.v1 + * @classdesc Represents a ListMembershipsResponse. + * @implements IListMembershipsResponse + * @constructor + * @param {google.chat.v1.IListMembershipsResponse=} [properties] Properties to set + */ + function ListMembershipsResponse(properties) { + this.memberships = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMembershipsResponse memberships. + * @member {Array.} memberships + * @memberof google.chat.v1.ListMembershipsResponse + * @instance + */ + ListMembershipsResponse.prototype.memberships = $util.emptyArray; + + /** + * ListMembershipsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.chat.v1.ListMembershipsResponse + * @instance + */ + ListMembershipsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMembershipsResponse instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListMembershipsResponse + * @static + * @param {google.chat.v1.IListMembershipsResponse=} [properties] Properties to set + * @returns {google.chat.v1.ListMembershipsResponse} ListMembershipsResponse instance + */ + ListMembershipsResponse.create = function create(properties) { + return new ListMembershipsResponse(properties); + }; + + /** + * Encodes the specified ListMembershipsResponse message. Does not implicitly {@link google.chat.v1.ListMembershipsResponse.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListMembershipsResponse + * @static + * @param {google.chat.v1.IListMembershipsResponse} message ListMembershipsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMembershipsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memberships != null && message.memberships.length) + for (var i = 0; i < message.memberships.length; ++i) + $root.google.chat.v1.Membership.encode(message.memberships[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 ListMembershipsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListMembershipsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListMembershipsResponse + * @static + * @param {google.chat.v1.IListMembershipsResponse} message ListMembershipsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMembershipsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMembershipsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListMembershipsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListMembershipsResponse} ListMembershipsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMembershipsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListMembershipsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.memberships && message.memberships.length)) + message.memberships = []; + message.memberships.push($root.google.chat.v1.Membership.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMembershipsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListMembershipsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListMembershipsResponse} ListMembershipsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMembershipsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMembershipsResponse message. + * @function verify + * @memberof google.chat.v1.ListMembershipsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMembershipsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memberships != null && message.hasOwnProperty("memberships")) { + if (!Array.isArray(message.memberships)) + return "memberships: array expected"; + for (var i = 0; i < message.memberships.length; ++i) { + var error = $root.google.chat.v1.Membership.verify(message.memberships[i]); + if (error) + return "memberships." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMembershipsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListMembershipsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListMembershipsResponse} ListMembershipsResponse + */ + ListMembershipsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListMembershipsResponse) + return object; + var message = new $root.google.chat.v1.ListMembershipsResponse(); + if (object.memberships) { + if (!Array.isArray(object.memberships)) + throw TypeError(".google.chat.v1.ListMembershipsResponse.memberships: array expected"); + message.memberships = []; + for (var i = 0; i < object.memberships.length; ++i) { + if (typeof object.memberships[i] !== "object") + throw TypeError(".google.chat.v1.ListMembershipsResponse.memberships: object expected"); + message.memberships[i] = $root.google.chat.v1.Membership.fromObject(object.memberships[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMembershipsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListMembershipsResponse + * @static + * @param {google.chat.v1.ListMembershipsResponse} message ListMembershipsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMembershipsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.memberships = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.memberships && message.memberships.length) { + object.memberships = []; + for (var j = 0; j < message.memberships.length; ++j) + object.memberships[j] = $root.google.chat.v1.Membership.toObject(message.memberships[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMembershipsResponse to JSON. + * @function toJSON + * @memberof google.chat.v1.ListMembershipsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMembershipsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMembershipsResponse + * @function getTypeUrl + * @memberof google.chat.v1.ListMembershipsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMembershipsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListMembershipsResponse"; + }; + + return ListMembershipsResponse; + })(); + + v1.GetMembershipRequest = (function() { + + /** + * Properties of a GetMembershipRequest. + * @memberof google.chat.v1 + * @interface IGetMembershipRequest + * @property {string|null} [name] GetMembershipRequest name + * @property {boolean|null} [useAdminAccess] GetMembershipRequest useAdminAccess + */ + + /** + * Constructs a new GetMembershipRequest. + * @memberof google.chat.v1 + * @classdesc Represents a GetMembershipRequest. + * @implements IGetMembershipRequest + * @constructor + * @param {google.chat.v1.IGetMembershipRequest=} [properties] Properties to set + */ + function GetMembershipRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMembershipRequest name. + * @member {string} name + * @memberof google.chat.v1.GetMembershipRequest + * @instance + */ + GetMembershipRequest.prototype.name = ""; + + /** + * GetMembershipRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.GetMembershipRequest + * @instance + */ + GetMembershipRequest.prototype.useAdminAccess = false; + + /** + * Creates a new GetMembershipRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {google.chat.v1.IGetMembershipRequest=} [properties] Properties to set + * @returns {google.chat.v1.GetMembershipRequest} GetMembershipRequest instance + */ + GetMembershipRequest.create = function create(properties) { + return new GetMembershipRequest(properties); + }; + + /** + * Encodes the specified GetMembershipRequest message. Does not implicitly {@link google.chat.v1.GetMembershipRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {google.chat.v1.IGetMembershipRequest} message GetMembershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMembershipRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.useAdminAccess); + return writer; + }; + + /** + * Encodes the specified GetMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetMembershipRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {google.chat.v1.IGetMembershipRequest} message GetMembershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMembershipRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMembershipRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.GetMembershipRequest} GetMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMembershipRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetMembershipRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.useAdminAccess = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMembershipRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.GetMembershipRequest} GetMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMembershipRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMembershipRequest message. + * @function verify + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMembershipRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; + return null; + }; + + /** + * Creates a GetMembershipRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.GetMembershipRequest} GetMembershipRequest + */ + GetMembershipRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.GetMembershipRequest) + return object; + var message = new $root.google.chat.v1.GetMembershipRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); + return message; + }; + + /** + * Creates a plain object from a GetMembershipRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {google.chat.v1.GetMembershipRequest} message GetMembershipRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMembershipRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.useAdminAccess = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; + return object; + }; + + /** + * Converts this GetMembershipRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.GetMembershipRequest + * @instance + * @returns {Object.} JSON object + */ + GetMembershipRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMembershipRequest + * @function getTypeUrl + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMembershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.GetMembershipRequest"; + }; + + return GetMembershipRequest; + })(); + + v1.DeleteMembershipRequest = (function() { + + /** + * Properties of a DeleteMembershipRequest. + * @memberof google.chat.v1 + * @interface IDeleteMembershipRequest + * @property {string|null} [name] DeleteMembershipRequest name + * @property {boolean|null} [useAdminAccess] DeleteMembershipRequest useAdminAccess + */ + + /** + * Constructs a new DeleteMembershipRequest. + * @memberof google.chat.v1 + * @classdesc Represents a DeleteMembershipRequest. + * @implements IDeleteMembershipRequest + * @constructor + * @param {google.chat.v1.IDeleteMembershipRequest=} [properties] Properties to set + */ + function DeleteMembershipRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteMembershipRequest name. + * @member {string} name + * @memberof google.chat.v1.DeleteMembershipRequest + * @instance + */ + DeleteMembershipRequest.prototype.name = ""; + + /** + * DeleteMembershipRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.DeleteMembershipRequest + * @instance + */ + DeleteMembershipRequest.prototype.useAdminAccess = false; + + /** + * Creates a new DeleteMembershipRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.DeleteMembershipRequest + * @static + * @param {google.chat.v1.IDeleteMembershipRequest=} [properties] Properties to set + * @returns {google.chat.v1.DeleteMembershipRequest} DeleteMembershipRequest instance + */ + DeleteMembershipRequest.create = function create(properties) { + return new DeleteMembershipRequest(properties); + }; + + /** + * Encodes the specified DeleteMembershipRequest message. Does not implicitly {@link google.chat.v1.DeleteMembershipRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.DeleteMembershipRequest + * @static + * @param {google.chat.v1.IDeleteMembershipRequest} message DeleteMembershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMembershipRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useAdminAccess); + return writer; + }; + + /** + * Encodes the specified DeleteMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteMembershipRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.DeleteMembershipRequest + * @static + * @param {google.chat.v1.IDeleteMembershipRequest} message DeleteMembershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMembershipRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteMembershipRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.DeleteMembershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.DeleteMembershipRequest} DeleteMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMembershipRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeleteMembershipRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.useAdminAccess = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteMembershipRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.DeleteMembershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.DeleteMembershipRequest} DeleteMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMembershipRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMembershipRequest message. + * @function verify + * @memberof google.chat.v1.DeleteMembershipRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMembershipRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; + return null; + }; + + /** + * Creates a DeleteMembershipRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.DeleteMembershipRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.DeleteMembershipRequest} DeleteMembershipRequest + */ + DeleteMembershipRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DeleteMembershipRequest) + return object; + var message = new $root.google.chat.v1.DeleteMembershipRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); + return message; + }; + + /** + * Creates a plain object from a DeleteMembershipRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.DeleteMembershipRequest + * @static + * @param {google.chat.v1.DeleteMembershipRequest} message DeleteMembershipRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMembershipRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.useAdminAccess = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; + return object; + }; + + /** + * Converts this DeleteMembershipRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.DeleteMembershipRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMembershipRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMembershipRequest + * @function getTypeUrl + * @memberof google.chat.v1.DeleteMembershipRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMembershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.DeleteMembershipRequest"; + }; + + return DeleteMembershipRequest; + })(); + + v1.Group = (function() { + + /** + * Properties of a Group. + * @memberof google.chat.v1 + * @interface IGroup + * @property {string|null} [name] Group name + */ + + /** + * Constructs a new Group. + * @memberof google.chat.v1 + * @classdesc Represents a Group. + * @implements IGroup + * @constructor + * @param {google.chat.v1.IGroup=} [properties] Properties to set + */ + function Group(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Group name. + * @member {string} name + * @memberof google.chat.v1.Group + * @instance + */ + Group.prototype.name = ""; + + /** + * Creates a new Group instance using the specified properties. + * @function create + * @memberof google.chat.v1.Group + * @static + * @param {google.chat.v1.IGroup=} [properties] Properties to set + * @returns {google.chat.v1.Group} Group instance + */ + Group.create = function create(properties) { + return new Group(properties); + }; + + /** + * Encodes the specified Group message. Does not implicitly {@link google.chat.v1.Group.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Group + * @static + * @param {google.chat.v1.IGroup} message Group message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Group.encode = function encode(message, writer) { + 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 Group message, length delimited. Does not implicitly {@link google.chat.v1.Group.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Group + * @static + * @param {google.chat.v1.IGroup} message Group message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Group.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Group message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Group + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Group} Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Group.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Group(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Group message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Group + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Group} Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Group.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Group message. + * @function verify + * @memberof google.chat.v1.Group + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Group.verify = function verify(message) { + if (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 Group message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Group + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Group} Group + */ + Group.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Group) + return object; + var message = new $root.google.chat.v1.Group(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Group message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Group + * @static + * @param {google.chat.v1.Group} message Group + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Group.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 Group to JSON. + * @function toJSON + * @memberof google.chat.v1.Group + * @instance + * @returns {Object.} JSON object + */ + Group.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Group + * @function getTypeUrl + * @memberof google.chat.v1.Group + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Group.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Group"; + }; + + return Group; + })(); + + v1.Message = (function() { + + /** + * Properties of a Message. + * @memberof google.chat.v1 + * @interface IMessage + * @property {string|null} [name] Message name + * @property {google.chat.v1.IUser|null} [sender] Message sender + * @property {google.protobuf.ITimestamp|null} [createTime] Message createTime + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] Message lastUpdateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Message deleteTime + * @property {string|null} [text] Message text + * @property {string|null} [formattedText] Message formattedText + * @property {Array.|null} [cards] Message cards + * @property {Array.|null} [cardsV2] Message cardsV2 + * @property {Array.|null} [annotations] Message annotations + * @property {google.chat.v1.IThread|null} [thread] Message thread + * @property {google.chat.v1.ISpace|null} [space] Message space + * @property {string|null} [fallbackText] Message fallbackText + * @property {google.chat.v1.IActionResponse|null} [actionResponse] Message actionResponse + * @property {string|null} [argumentText] Message argumentText + * @property {google.chat.v1.ISlashCommand|null} [slashCommand] Message slashCommand + * @property {Array.|null} [attachment] Message attachment + * @property {google.chat.v1.IMatchedUrl|null} [matchedUrl] Message matchedUrl + * @property {boolean|null} [threadReply] Message threadReply + * @property {string|null} [clientAssignedMessageId] Message clientAssignedMessageId + * @property {Array.|null} [emojiReactionSummaries] Message emojiReactionSummaries + * @property {google.chat.v1.IUser|null} [privateMessageViewer] Message privateMessageViewer + * @property {google.chat.v1.IDeletionMetadata|null} [deletionMetadata] Message deletionMetadata + * @property {google.chat.v1.IQuotedMessageMetadata|null} [quotedMessageMetadata] Message quotedMessageMetadata + * @property {Array.|null} [attachedGifs] Message attachedGifs + * @property {Array.|null} [accessoryWidgets] Message accessoryWidgets + */ + + /** + * Constructs a new Message. + * @memberof google.chat.v1 + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.chat.v1.IMessage=} [properties] Properties to set + */ + function Message(properties) { + this.cards = []; + this.cardsV2 = []; + this.annotations = []; + this.attachment = []; + this.emojiReactionSummaries = []; + this.attachedGifs = []; + this.accessoryWidgets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Message name. + * @member {string} name + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.name = ""; + + /** + * Message sender. + * @member {google.chat.v1.IUser|null|undefined} sender + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.sender = null; + + /** + * Message createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.createTime = null; + + /** + * Message lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.lastUpdateTime = null; + + /** + * Message deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.deleteTime = null; + + /** + * Message text. + * @member {string} text + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.text = ""; + + /** + * Message formattedText. + * @member {string} formattedText + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.formattedText = ""; + + /** + * Message cards. + * @member {Array.} cards + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.cards = $util.emptyArray; + + /** + * Message cardsV2. + * @member {Array.} cardsV2 + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.cardsV2 = $util.emptyArray; + + /** + * Message annotations. + * @member {Array.} annotations + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.annotations = $util.emptyArray; + + /** + * Message thread. + * @member {google.chat.v1.IThread|null|undefined} thread + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.thread = null; + + /** + * Message space. + * @member {google.chat.v1.ISpace|null|undefined} space + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.space = null; + + /** + * Message fallbackText. + * @member {string} fallbackText + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.fallbackText = ""; + + /** + * Message actionResponse. + * @member {google.chat.v1.IActionResponse|null|undefined} actionResponse + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.actionResponse = null; + + /** + * Message argumentText. + * @member {string} argumentText + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.argumentText = ""; + + /** + * Message slashCommand. + * @member {google.chat.v1.ISlashCommand|null|undefined} slashCommand + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.slashCommand = null; + + /** + * Message attachment. + * @member {Array.} attachment + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.attachment = $util.emptyArray; + + /** + * Message matchedUrl. + * @member {google.chat.v1.IMatchedUrl|null|undefined} matchedUrl + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.matchedUrl = null; + + /** + * Message threadReply. + * @member {boolean} threadReply + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.threadReply = false; + + /** + * Message clientAssignedMessageId. + * @member {string} clientAssignedMessageId + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.clientAssignedMessageId = ""; + + /** + * Message emojiReactionSummaries. + * @member {Array.} emojiReactionSummaries + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.emojiReactionSummaries = $util.emptyArray; + + /** + * Message privateMessageViewer. + * @member {google.chat.v1.IUser|null|undefined} privateMessageViewer + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.privateMessageViewer = null; + + /** + * Message deletionMetadata. + * @member {google.chat.v1.IDeletionMetadata|null|undefined} deletionMetadata + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.deletionMetadata = null; + + /** + * Message quotedMessageMetadata. + * @member {google.chat.v1.IQuotedMessageMetadata|null|undefined} quotedMessageMetadata + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.quotedMessageMetadata = null; + + /** + * Message attachedGifs. + * @member {Array.} attachedGifs + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.attachedGifs = $util.emptyArray; + + /** + * Message accessoryWidgets. + * @member {Array.} accessoryWidgets + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.accessoryWidgets = $util.emptyArray; + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.chat.v1.Message + * @static + * @param {google.chat.v1.IMessage=} [properties] Properties to set + * @returns {google.chat.v1.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.chat.v1.Message.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Message + * @static + * @param {google.chat.v1.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) + $root.google.chat.v1.User.encode(message.sender, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.text); + if (message.cards != null && message.cards.length) + for (var i = 0; i < message.cards.length; ++i) + $root.google.chat.v1.ContextualAddOnMarkup.Card.encode(message.cards[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.annotations != null && message.annotations.length) + for (var i = 0; i < message.annotations.length; ++i) + $root.google.chat.v1.Annotation.encode(message.annotations[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.thread != null && Object.hasOwnProperty.call(message, "thread")) + $root.google.chat.v1.Thread.encode(message.thread, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.space != null && Object.hasOwnProperty.call(message, "space")) + $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.fallbackText != null && Object.hasOwnProperty.call(message, "fallbackText")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.fallbackText); + if (message.actionResponse != null && Object.hasOwnProperty.call(message, "actionResponse")) + $root.google.chat.v1.ActionResponse.encode(message.actionResponse, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.argumentText != null && Object.hasOwnProperty.call(message, "argumentText")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.argumentText); + if (message.slashCommand != null && Object.hasOwnProperty.call(message, "slashCommand")) + $root.google.chat.v1.SlashCommand.encode(message.slashCommand, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.attachment != null && message.attachment.length) + for (var i = 0; i < message.attachment.length; ++i) + $root.google.chat.v1.Attachment.encode(message.attachment[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.matchedUrl != null && Object.hasOwnProperty.call(message, "matchedUrl")) + $root.google.chat.v1.MatchedUrl.encode(message.matchedUrl, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.cardsV2 != null && message.cardsV2.length) + for (var i = 0; i < message.cardsV2.length; ++i) + $root.google.chat.v1.CardWithId.encode(message.cardsV2[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.threadReply != null && Object.hasOwnProperty.call(message, "threadReply")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.threadReply); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.clientAssignedMessageId != null && Object.hasOwnProperty.call(message, "clientAssignedMessageId")) + writer.uint32(/* id 32, wireType 2 =*/258).string(message.clientAssignedMessageId); + if (message.emojiReactionSummaries != null && message.emojiReactionSummaries.length) + for (var i = 0; i < message.emojiReactionSummaries.length; ++i) + $root.google.chat.v1.EmojiReactionSummary.encode(message.emojiReactionSummaries[i], writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.privateMessageViewer != null && Object.hasOwnProperty.call(message, "privateMessageViewer")) + $root.google.chat.v1.User.encode(message.privateMessageViewer, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + if (message.deletionMetadata != null && Object.hasOwnProperty.call(message, "deletionMetadata")) + $root.google.chat.v1.DeletionMetadata.encode(message.deletionMetadata, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + if (message.quotedMessageMetadata != null && Object.hasOwnProperty.call(message, "quotedMessageMetadata")) + $root.google.chat.v1.QuotedMessageMetadata.encode(message.quotedMessageMetadata, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.attachedGifs != null && message.attachedGifs.length) + for (var i = 0; i < message.attachedGifs.length; ++i) + $root.google.chat.v1.AttachedGif.encode(message.attachedGifs[i], writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.formattedText != null && Object.hasOwnProperty.call(message, "formattedText")) + writer.uint32(/* id 43, wireType 2 =*/346).string(message.formattedText); + if (message.accessoryWidgets != null && message.accessoryWidgets.length) + for (var i = 0; i < message.accessoryWidgets.length; ++i) + $root.google.chat.v1.AccessoryWidget.encode(message.accessoryWidgets[i], writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.chat.v1.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Message + * @static + * @param {google.chat.v1.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sender = $root.google.chat.v1.User.decode(reader, reader.uint32()); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 23: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 26: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.text = reader.string(); + break; + } + case 43: { + message.formattedText = reader.string(); + break; + } + case 5: { + if (!(message.cards && message.cards.length)) + message.cards = []; + message.cards.push($root.google.chat.v1.ContextualAddOnMarkup.Card.decode(reader, reader.uint32())); + break; + } + case 22: { + if (!(message.cardsV2 && message.cardsV2.length)) + message.cardsV2 = []; + message.cardsV2.push($root.google.chat.v1.CardWithId.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.annotations && message.annotations.length)) + message.annotations = []; + message.annotations.push($root.google.chat.v1.Annotation.decode(reader, reader.uint32())); + break; + } + case 11: { + message.thread = $root.google.chat.v1.Thread.decode(reader, reader.uint32()); + break; + } + case 12: { + message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); + break; + } + case 13: { + message.fallbackText = reader.string(); + break; + } + case 14: { + message.actionResponse = $root.google.chat.v1.ActionResponse.decode(reader, reader.uint32()); + break; + } + case 15: { + message.argumentText = reader.string(); + break; + } + case 17: { + message.slashCommand = $root.google.chat.v1.SlashCommand.decode(reader, reader.uint32()); + break; + } + case 18: { + if (!(message.attachment && message.attachment.length)) + message.attachment = []; + message.attachment.push($root.google.chat.v1.Attachment.decode(reader, reader.uint32())); + break; + } + case 20: { + message.matchedUrl = $root.google.chat.v1.MatchedUrl.decode(reader, reader.uint32()); + break; + } + case 25: { + message.threadReply = reader.bool(); + break; + } + case 32: { + message.clientAssignedMessageId = reader.string(); + break; + } + case 33: { + if (!(message.emojiReactionSummaries && message.emojiReactionSummaries.length)) + message.emojiReactionSummaries = []; + message.emojiReactionSummaries.push($root.google.chat.v1.EmojiReactionSummary.decode(reader, reader.uint32())); + break; + } + case 36: { + message.privateMessageViewer = $root.google.chat.v1.User.decode(reader, reader.uint32()); + break; + } + case 38: { + message.deletionMetadata = $root.google.chat.v1.DeletionMetadata.decode(reader, reader.uint32()); + break; + } + case 39: { + message.quotedMessageMetadata = $root.google.chat.v1.QuotedMessageMetadata.decode(reader, reader.uint32()); + break; + } + case 42: { + if (!(message.attachedGifs && message.attachedGifs.length)) + message.attachedGifs = []; + message.attachedGifs.push($root.google.chat.v1.AttachedGif.decode(reader, reader.uint32())); + break; + } + case 44: { + if (!(message.accessoryWidgets && message.accessoryWidgets.length)) + message.accessoryWidgets = []; + message.accessoryWidgets.push($root.google.chat.v1.AccessoryWidget.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof google.chat.v1.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.sender != null && message.hasOwnProperty("sender")) { + var error = $root.google.chat.v1.User.verify(message.sender); + if (error) + return "sender." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.formattedText != null && message.hasOwnProperty("formattedText")) + if (!$util.isString(message.formattedText)) + return "formattedText: string expected"; + if (message.cards != null && message.hasOwnProperty("cards")) { + if (!Array.isArray(message.cards)) + return "cards: array expected"; + for (var i = 0; i < message.cards.length; ++i) { + var error = $root.google.chat.v1.ContextualAddOnMarkup.Card.verify(message.cards[i]); + if (error) + return "cards." + error; + } + } + if (message.cardsV2 != null && message.hasOwnProperty("cardsV2")) { + if (!Array.isArray(message.cardsV2)) + return "cardsV2: array expected"; + for (var i = 0; i < message.cardsV2.length; ++i) { + var error = $root.google.chat.v1.CardWithId.verify(message.cardsV2[i]); + if (error) + return "cardsV2." + error; + } + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!Array.isArray(message.annotations)) + return "annotations: array expected"; + for (var i = 0; i < message.annotations.length; ++i) { + var error = $root.google.chat.v1.Annotation.verify(message.annotations[i]); + if (error) + return "annotations." + error; + } + } + if (message.thread != null && message.hasOwnProperty("thread")) { + var error = $root.google.chat.v1.Thread.verify(message.thread); + if (error) + return "thread." + error; + } + if (message.space != null && message.hasOwnProperty("space")) { + var error = $root.google.chat.v1.Space.verify(message.space); + if (error) + return "space." + error; + } + if (message.fallbackText != null && message.hasOwnProperty("fallbackText")) + if (!$util.isString(message.fallbackText)) + return "fallbackText: string expected"; + if (message.actionResponse != null && message.hasOwnProperty("actionResponse")) { + var error = $root.google.chat.v1.ActionResponse.verify(message.actionResponse); + if (error) + return "actionResponse." + error; + } + if (message.argumentText != null && message.hasOwnProperty("argumentText")) + if (!$util.isString(message.argumentText)) + return "argumentText: string expected"; + if (message.slashCommand != null && message.hasOwnProperty("slashCommand")) { + var error = $root.google.chat.v1.SlashCommand.verify(message.slashCommand); + if (error) + return "slashCommand." + error; + } + if (message.attachment != null && message.hasOwnProperty("attachment")) { + if (!Array.isArray(message.attachment)) + return "attachment: array expected"; + for (var i = 0; i < message.attachment.length; ++i) { + var error = $root.google.chat.v1.Attachment.verify(message.attachment[i]); + if (error) + return "attachment." + error; + } + } + if (message.matchedUrl != null && message.hasOwnProperty("matchedUrl")) { + var error = $root.google.chat.v1.MatchedUrl.verify(message.matchedUrl); + if (error) + return "matchedUrl." + error; + } + if (message.threadReply != null && message.hasOwnProperty("threadReply")) + if (typeof message.threadReply !== "boolean") + return "threadReply: boolean expected"; + if (message.clientAssignedMessageId != null && message.hasOwnProperty("clientAssignedMessageId")) + if (!$util.isString(message.clientAssignedMessageId)) + return "clientAssignedMessageId: string expected"; + if (message.emojiReactionSummaries != null && message.hasOwnProperty("emojiReactionSummaries")) { + if (!Array.isArray(message.emojiReactionSummaries)) + return "emojiReactionSummaries: array expected"; + for (var i = 0; i < message.emojiReactionSummaries.length; ++i) { + var error = $root.google.chat.v1.EmojiReactionSummary.verify(message.emojiReactionSummaries[i]); + if (error) + return "emojiReactionSummaries." + error; + } + } + if (message.privateMessageViewer != null && message.hasOwnProperty("privateMessageViewer")) { + var error = $root.google.chat.v1.User.verify(message.privateMessageViewer); + if (error) + return "privateMessageViewer." + error; + } + if (message.deletionMetadata != null && message.hasOwnProperty("deletionMetadata")) { + var error = $root.google.chat.v1.DeletionMetadata.verify(message.deletionMetadata); + if (error) + return "deletionMetadata." + error; + } + if (message.quotedMessageMetadata != null && message.hasOwnProperty("quotedMessageMetadata")) { + var error = $root.google.chat.v1.QuotedMessageMetadata.verify(message.quotedMessageMetadata); + if (error) + return "quotedMessageMetadata." + error; + } + if (message.attachedGifs != null && message.hasOwnProperty("attachedGifs")) { + if (!Array.isArray(message.attachedGifs)) + return "attachedGifs: array expected"; + for (var i = 0; i < message.attachedGifs.length; ++i) { + var error = $root.google.chat.v1.AttachedGif.verify(message.attachedGifs[i]); + if (error) + return "attachedGifs." + error; + } + } + if (message.accessoryWidgets != null && message.hasOwnProperty("accessoryWidgets")) { + if (!Array.isArray(message.accessoryWidgets)) + return "accessoryWidgets: array expected"; + for (var i = 0; i < message.accessoryWidgets.length; ++i) { + var error = $root.google.chat.v1.AccessoryWidget.verify(message.accessoryWidgets[i]); + if (error) + return "accessoryWidgets." + error; + } + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Message + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Message) + return object; + var message = new $root.google.chat.v1.Message(); + if (object.name != null) + message.name = String(object.name); + if (object.sender != null) { + if (typeof object.sender !== "object") + throw TypeError(".google.chat.v1.Message.sender: object expected"); + message.sender = $root.google.chat.v1.User.fromObject(object.sender); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.chat.v1.Message.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.chat.v1.Message.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.chat.v1.Message.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.text != null) + message.text = String(object.text); + if (object.formattedText != null) + message.formattedText = String(object.formattedText); + if (object.cards) { + if (!Array.isArray(object.cards)) + throw TypeError(".google.chat.v1.Message.cards: array expected"); + message.cards = []; + for (var i = 0; i < object.cards.length; ++i) { + if (typeof object.cards[i] !== "object") + throw TypeError(".google.chat.v1.Message.cards: object expected"); + message.cards[i] = $root.google.chat.v1.ContextualAddOnMarkup.Card.fromObject(object.cards[i]); + } + } + if (object.cardsV2) { + if (!Array.isArray(object.cardsV2)) + throw TypeError(".google.chat.v1.Message.cardsV2: array expected"); + message.cardsV2 = []; + for (var i = 0; i < object.cardsV2.length; ++i) { + if (typeof object.cardsV2[i] !== "object") + throw TypeError(".google.chat.v1.Message.cardsV2: object expected"); + message.cardsV2[i] = $root.google.chat.v1.CardWithId.fromObject(object.cardsV2[i]); + } + } + if (object.annotations) { + if (!Array.isArray(object.annotations)) + throw TypeError(".google.chat.v1.Message.annotations: array expected"); + message.annotations = []; + for (var i = 0; i < object.annotations.length; ++i) { + if (typeof object.annotations[i] !== "object") + throw TypeError(".google.chat.v1.Message.annotations: object expected"); + message.annotations[i] = $root.google.chat.v1.Annotation.fromObject(object.annotations[i]); + } + } + if (object.thread != null) { + if (typeof object.thread !== "object") + throw TypeError(".google.chat.v1.Message.thread: object expected"); + message.thread = $root.google.chat.v1.Thread.fromObject(object.thread); + } + if (object.space != null) { + if (typeof object.space !== "object") + throw TypeError(".google.chat.v1.Message.space: object expected"); + message.space = $root.google.chat.v1.Space.fromObject(object.space); + } + if (object.fallbackText != null) + message.fallbackText = String(object.fallbackText); + if (object.actionResponse != null) { + if (typeof object.actionResponse !== "object") + throw TypeError(".google.chat.v1.Message.actionResponse: object expected"); + message.actionResponse = $root.google.chat.v1.ActionResponse.fromObject(object.actionResponse); + } + if (object.argumentText != null) + message.argumentText = String(object.argumentText); + if (object.slashCommand != null) { + if (typeof object.slashCommand !== "object") + throw TypeError(".google.chat.v1.Message.slashCommand: object expected"); + message.slashCommand = $root.google.chat.v1.SlashCommand.fromObject(object.slashCommand); + } + if (object.attachment) { + if (!Array.isArray(object.attachment)) + throw TypeError(".google.chat.v1.Message.attachment: array expected"); + message.attachment = []; + for (var i = 0; i < object.attachment.length; ++i) { + if (typeof object.attachment[i] !== "object") + throw TypeError(".google.chat.v1.Message.attachment: object expected"); + message.attachment[i] = $root.google.chat.v1.Attachment.fromObject(object.attachment[i]); + } + } + if (object.matchedUrl != null) { + if (typeof object.matchedUrl !== "object") + throw TypeError(".google.chat.v1.Message.matchedUrl: object expected"); + message.matchedUrl = $root.google.chat.v1.MatchedUrl.fromObject(object.matchedUrl); + } + if (object.threadReply != null) + message.threadReply = Boolean(object.threadReply); + if (object.clientAssignedMessageId != null) + message.clientAssignedMessageId = String(object.clientAssignedMessageId); + if (object.emojiReactionSummaries) { + if (!Array.isArray(object.emojiReactionSummaries)) + throw TypeError(".google.chat.v1.Message.emojiReactionSummaries: array expected"); + message.emojiReactionSummaries = []; + for (var i = 0; i < object.emojiReactionSummaries.length; ++i) { + if (typeof object.emojiReactionSummaries[i] !== "object") + throw TypeError(".google.chat.v1.Message.emojiReactionSummaries: object expected"); + message.emojiReactionSummaries[i] = $root.google.chat.v1.EmojiReactionSummary.fromObject(object.emojiReactionSummaries[i]); + } + } + if (object.privateMessageViewer != null) { + if (typeof object.privateMessageViewer !== "object") + throw TypeError(".google.chat.v1.Message.privateMessageViewer: object expected"); + message.privateMessageViewer = $root.google.chat.v1.User.fromObject(object.privateMessageViewer); + } + if (object.deletionMetadata != null) { + if (typeof object.deletionMetadata !== "object") + throw TypeError(".google.chat.v1.Message.deletionMetadata: object expected"); + message.deletionMetadata = $root.google.chat.v1.DeletionMetadata.fromObject(object.deletionMetadata); + } + if (object.quotedMessageMetadata != null) { + if (typeof object.quotedMessageMetadata !== "object") + throw TypeError(".google.chat.v1.Message.quotedMessageMetadata: object expected"); + message.quotedMessageMetadata = $root.google.chat.v1.QuotedMessageMetadata.fromObject(object.quotedMessageMetadata); + } + if (object.attachedGifs) { + if (!Array.isArray(object.attachedGifs)) + throw TypeError(".google.chat.v1.Message.attachedGifs: array expected"); + message.attachedGifs = []; + for (var i = 0; i < object.attachedGifs.length; ++i) { + if (typeof object.attachedGifs[i] !== "object") + throw TypeError(".google.chat.v1.Message.attachedGifs: object expected"); + message.attachedGifs[i] = $root.google.chat.v1.AttachedGif.fromObject(object.attachedGifs[i]); + } + } + if (object.accessoryWidgets) { + if (!Array.isArray(object.accessoryWidgets)) + throw TypeError(".google.chat.v1.Message.accessoryWidgets: array expected"); + message.accessoryWidgets = []; + for (var i = 0; i < object.accessoryWidgets.length; ++i) { + if (typeof object.accessoryWidgets[i] !== "object") + throw TypeError(".google.chat.v1.Message.accessoryWidgets: object expected"); + message.accessoryWidgets[i] = $root.google.chat.v1.AccessoryWidget.fromObject(object.accessoryWidgets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Message + * @static + * @param {google.chat.v1.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.cards = []; + object.annotations = []; + object.attachment = []; + object.cardsV2 = []; + object.emojiReactionSummaries = []; + object.attachedGifs = []; + object.accessoryWidgets = []; + } + if (options.defaults) { + object.name = ""; + object.sender = null; + object.createTime = null; + object.text = ""; + object.thread = null; + object.space = null; + object.fallbackText = ""; + object.actionResponse = null; + object.argumentText = ""; + object.slashCommand = null; + object.matchedUrl = null; + object.lastUpdateTime = null; + object.threadReply = false; + object.deleteTime = null; + object.clientAssignedMessageId = ""; + object.privateMessageViewer = null; + object.deletionMetadata = null; + object.quotedMessageMetadata = null; + object.formattedText = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sender != null && message.hasOwnProperty("sender")) + object.sender = $root.google.chat.v1.User.toObject(message.sender, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.cards && message.cards.length) { + object.cards = []; + for (var j = 0; j < message.cards.length; ++j) + object.cards[j] = $root.google.chat.v1.ContextualAddOnMarkup.Card.toObject(message.cards[j], options); + } + if (message.annotations && message.annotations.length) { + object.annotations = []; + for (var j = 0; j < message.annotations.length; ++j) + object.annotations[j] = $root.google.chat.v1.Annotation.toObject(message.annotations[j], options); + } + if (message.thread != null && message.hasOwnProperty("thread")) + object.thread = $root.google.chat.v1.Thread.toObject(message.thread, options); + if (message.space != null && message.hasOwnProperty("space")) + object.space = $root.google.chat.v1.Space.toObject(message.space, options); + if (message.fallbackText != null && message.hasOwnProperty("fallbackText")) + object.fallbackText = message.fallbackText; + if (message.actionResponse != null && message.hasOwnProperty("actionResponse")) + object.actionResponse = $root.google.chat.v1.ActionResponse.toObject(message.actionResponse, options); + if (message.argumentText != null && message.hasOwnProperty("argumentText")) + object.argumentText = message.argumentText; + if (message.slashCommand != null && message.hasOwnProperty("slashCommand")) + object.slashCommand = $root.google.chat.v1.SlashCommand.toObject(message.slashCommand, options); + if (message.attachment && message.attachment.length) { + object.attachment = []; + for (var j = 0; j < message.attachment.length; ++j) + object.attachment[j] = $root.google.chat.v1.Attachment.toObject(message.attachment[j], options); + } + if (message.matchedUrl != null && message.hasOwnProperty("matchedUrl")) + object.matchedUrl = $root.google.chat.v1.MatchedUrl.toObject(message.matchedUrl, options); + if (message.cardsV2 && message.cardsV2.length) { + object.cardsV2 = []; + for (var j = 0; j < message.cardsV2.length; ++j) + object.cardsV2[j] = $root.google.chat.v1.CardWithId.toObject(message.cardsV2[j], options); + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.threadReply != null && message.hasOwnProperty("threadReply")) + object.threadReply = message.threadReply; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.clientAssignedMessageId != null && message.hasOwnProperty("clientAssignedMessageId")) + object.clientAssignedMessageId = message.clientAssignedMessageId; + if (message.emojiReactionSummaries && message.emojiReactionSummaries.length) { + object.emojiReactionSummaries = []; + for (var j = 0; j < message.emojiReactionSummaries.length; ++j) + object.emojiReactionSummaries[j] = $root.google.chat.v1.EmojiReactionSummary.toObject(message.emojiReactionSummaries[j], options); + } + if (message.privateMessageViewer != null && message.hasOwnProperty("privateMessageViewer")) + object.privateMessageViewer = $root.google.chat.v1.User.toObject(message.privateMessageViewer, options); + if (message.deletionMetadata != null && message.hasOwnProperty("deletionMetadata")) + object.deletionMetadata = $root.google.chat.v1.DeletionMetadata.toObject(message.deletionMetadata, options); + if (message.quotedMessageMetadata != null && message.hasOwnProperty("quotedMessageMetadata")) + object.quotedMessageMetadata = $root.google.chat.v1.QuotedMessageMetadata.toObject(message.quotedMessageMetadata, options); + if (message.attachedGifs && message.attachedGifs.length) { + object.attachedGifs = []; + for (var j = 0; j < message.attachedGifs.length; ++j) + object.attachedGifs[j] = $root.google.chat.v1.AttachedGif.toObject(message.attachedGifs[j], options); + } + if (message.formattedText != null && message.hasOwnProperty("formattedText")) + object.formattedText = message.formattedText; + if (message.accessoryWidgets && message.accessoryWidgets.length) { + object.accessoryWidgets = []; + for (var j = 0; j < message.accessoryWidgets.length; ++j) + object.accessoryWidgets[j] = $root.google.chat.v1.AccessoryWidget.toObject(message.accessoryWidgets[j], options); + } + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.chat.v1.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Message + * @function getTypeUrl + * @memberof google.chat.v1.Message + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Message"; + }; + + return Message; + })(); + + v1.AttachedGif = (function() { + + /** + * Properties of an AttachedGif. + * @memberof google.chat.v1 + * @interface IAttachedGif + * @property {string|null} [uri] AttachedGif uri + */ + + /** + * Constructs a new AttachedGif. + * @memberof google.chat.v1 + * @classdesc Represents an AttachedGif. + * @implements IAttachedGif + * @constructor + * @param {google.chat.v1.IAttachedGif=} [properties] Properties to set + */ + function AttachedGif(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachedGif uri. + * @member {string} uri + * @memberof google.chat.v1.AttachedGif + * @instance + */ + AttachedGif.prototype.uri = ""; + + /** + * Creates a new AttachedGif instance using the specified properties. + * @function create + * @memberof google.chat.v1.AttachedGif + * @static + * @param {google.chat.v1.IAttachedGif=} [properties] Properties to set + * @returns {google.chat.v1.AttachedGif} AttachedGif instance + */ + AttachedGif.create = function create(properties) { + return new AttachedGif(properties); + }; + + /** + * Encodes the specified AttachedGif message. Does not implicitly {@link google.chat.v1.AttachedGif.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.AttachedGif + * @static + * @param {google.chat.v1.IAttachedGif} message AttachedGif message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedGif.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified AttachedGif message, length delimited. Does not implicitly {@link google.chat.v1.AttachedGif.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.AttachedGif + * @static + * @param {google.chat.v1.IAttachedGif} message AttachedGif message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedGif.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachedGif message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.AttachedGif + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.AttachedGif} AttachedGif + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedGif.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.AttachedGif(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachedGif message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.AttachedGif + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.AttachedGif} AttachedGif + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedGif.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachedGif message. + * @function verify + * @memberof google.chat.v1.AttachedGif + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachedGif.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates an AttachedGif message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.AttachedGif + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.AttachedGif} AttachedGif + */ + AttachedGif.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.AttachedGif) + return object; + var message = new $root.google.chat.v1.AttachedGif(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from an AttachedGif message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.AttachedGif + * @static + * @param {google.chat.v1.AttachedGif} message AttachedGif + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachedGif.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this AttachedGif to JSON. + * @function toJSON + * @memberof google.chat.v1.AttachedGif + * @instance + * @returns {Object.} JSON object + */ + AttachedGif.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttachedGif + * @function getTypeUrl + * @memberof google.chat.v1.AttachedGif + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttachedGif.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.AttachedGif"; + }; + + return AttachedGif; + })(); + + v1.QuotedMessageMetadata = (function() { + + /** + * Properties of a QuotedMessageMetadata. + * @memberof google.chat.v1 + * @interface IQuotedMessageMetadata + * @property {string|null} [name] QuotedMessageMetadata name + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] QuotedMessageMetadata lastUpdateTime + */ + + /** + * Constructs a new QuotedMessageMetadata. + * @memberof google.chat.v1 + * @classdesc Represents a QuotedMessageMetadata. + * @implements IQuotedMessageMetadata + * @constructor + * @param {google.chat.v1.IQuotedMessageMetadata=} [properties] Properties to set + */ + function QuotedMessageMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuotedMessageMetadata name. + * @member {string} name + * @memberof google.chat.v1.QuotedMessageMetadata + * @instance + */ + QuotedMessageMetadata.prototype.name = ""; + + /** + * QuotedMessageMetadata lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.chat.v1.QuotedMessageMetadata + * @instance + */ + QuotedMessageMetadata.prototype.lastUpdateTime = null; + + /** + * Creates a new QuotedMessageMetadata instance using the specified properties. + * @function create + * @memberof google.chat.v1.QuotedMessageMetadata + * @static + * @param {google.chat.v1.IQuotedMessageMetadata=} [properties] Properties to set + * @returns {google.chat.v1.QuotedMessageMetadata} QuotedMessageMetadata instance + */ + QuotedMessageMetadata.create = function create(properties) { + return new QuotedMessageMetadata(properties); + }; + + /** + * Encodes the specified QuotedMessageMetadata message. Does not implicitly {@link google.chat.v1.QuotedMessageMetadata.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.QuotedMessageMetadata + * @static + * @param {google.chat.v1.IQuotedMessageMetadata} message QuotedMessageMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotedMessageMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuotedMessageMetadata message, length delimited. Does not implicitly {@link google.chat.v1.QuotedMessageMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.QuotedMessageMetadata + * @static + * @param {google.chat.v1.IQuotedMessageMetadata} message QuotedMessageMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotedMessageMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuotedMessageMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.QuotedMessageMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.QuotedMessageMetadata} QuotedMessageMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotedMessageMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.QuotedMessageMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuotedMessageMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.QuotedMessageMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.QuotedMessageMetadata} QuotedMessageMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotedMessageMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuotedMessageMetadata message. + * @function verify + * @memberof google.chat.v1.QuotedMessageMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuotedMessageMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; + } + return null; + }; + + /** + * Creates a QuotedMessageMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.QuotedMessageMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.QuotedMessageMetadata} QuotedMessageMetadata + */ + QuotedMessageMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.QuotedMessageMetadata) + return object; + var message = new $root.google.chat.v1.QuotedMessageMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.chat.v1.QuotedMessageMetadata.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + } + return message; + }; + + /** + * Creates a plain object from a QuotedMessageMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.QuotedMessageMetadata + * @static + * @param {google.chat.v1.QuotedMessageMetadata} message QuotedMessageMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuotedMessageMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.lastUpdateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + return object; + }; + + /** + * Converts this QuotedMessageMetadata to JSON. + * @function toJSON + * @memberof google.chat.v1.QuotedMessageMetadata + * @instance + * @returns {Object.} JSON object + */ + QuotedMessageMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuotedMessageMetadata + * @function getTypeUrl + * @memberof google.chat.v1.QuotedMessageMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuotedMessageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.QuotedMessageMetadata"; + }; + + return QuotedMessageMetadata; + })(); + + v1.Thread = (function() { + + /** + * Properties of a Thread. + * @memberof google.chat.v1 + * @interface IThread + * @property {string|null} [name] Thread name + * @property {string|null} [threadKey] Thread threadKey + */ + + /** + * Constructs a new Thread. + * @memberof google.chat.v1 + * @classdesc Represents a Thread. + * @implements IThread + * @constructor + * @param {google.chat.v1.IThread=} [properties] Properties to set + */ + function Thread(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Thread name. + * @member {string} name + * @memberof google.chat.v1.Thread + * @instance + */ + Thread.prototype.name = ""; + + /** + * Thread threadKey. + * @member {string} threadKey + * @memberof google.chat.v1.Thread + * @instance + */ + Thread.prototype.threadKey = ""; + + /** + * Creates a new Thread instance using the specified properties. + * @function create + * @memberof google.chat.v1.Thread + * @static + * @param {google.chat.v1.IThread=} [properties] Properties to set + * @returns {google.chat.v1.Thread} Thread instance + */ + Thread.create = function create(properties) { + return new Thread(properties); + }; + + /** + * Encodes the specified Thread message. Does not implicitly {@link google.chat.v1.Thread.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Thread + * @static + * @param {google.chat.v1.IThread} message Thread message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Thread.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.threadKey != null && Object.hasOwnProperty.call(message, "threadKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.threadKey); + return writer; + }; + + /** + * Encodes the specified Thread message, length delimited. Does not implicitly {@link google.chat.v1.Thread.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Thread + * @static + * @param {google.chat.v1.IThread} message Thread message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Thread.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Thread message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Thread + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Thread} Thread + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Thread.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Thread(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.threadKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Thread message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Thread + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Thread} Thread + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Thread.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Thread message. + * @function verify + * @memberof google.chat.v1.Thread + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Thread.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.threadKey != null && message.hasOwnProperty("threadKey")) + if (!$util.isString(message.threadKey)) + return "threadKey: string expected"; + return null; + }; + + /** + * Creates a Thread message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Thread + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Thread} Thread + */ + Thread.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Thread) + return object; + var message = new $root.google.chat.v1.Thread(); + if (object.name != null) + message.name = String(object.name); + if (object.threadKey != null) + message.threadKey = String(object.threadKey); + return message; + }; + + /** + * Creates a plain object from a Thread message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Thread + * @static + * @param {google.chat.v1.Thread} message Thread + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Thread.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.threadKey = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.threadKey != null && message.hasOwnProperty("threadKey")) + object.threadKey = message.threadKey; + return object; + }; + + /** + * Converts this Thread to JSON. + * @function toJSON + * @memberof google.chat.v1.Thread + * @instance + * @returns {Object.} JSON object + */ + Thread.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Thread + * @function getTypeUrl + * @memberof google.chat.v1.Thread + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Thread.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Thread"; + }; + + return Thread; + })(); + + v1.ActionResponse = (function() { + + /** + * Properties of an ActionResponse. + * @memberof google.chat.v1 + * @interface IActionResponse + * @property {google.chat.v1.ActionResponse.ResponseType|null} [type] ActionResponse type + * @property {string|null} [url] ActionResponse url + * @property {google.chat.v1.IDialogAction|null} [dialogAction] ActionResponse dialogAction + * @property {google.chat.v1.ActionResponse.IUpdatedWidget|null} [updatedWidget] ActionResponse updatedWidget + */ + + /** + * Constructs a new ActionResponse. + * @memberof google.chat.v1 + * @classdesc Represents an ActionResponse. + * @implements IActionResponse + * @constructor + * @param {google.chat.v1.IActionResponse=} [properties] Properties to set + */ + function ActionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActionResponse type. + * @member {google.chat.v1.ActionResponse.ResponseType} type + * @memberof google.chat.v1.ActionResponse + * @instance + */ + ActionResponse.prototype.type = 0; + + /** + * ActionResponse url. + * @member {string} url + * @memberof google.chat.v1.ActionResponse + * @instance + */ + ActionResponse.prototype.url = ""; + + /** + * ActionResponse dialogAction. + * @member {google.chat.v1.IDialogAction|null|undefined} dialogAction + * @memberof google.chat.v1.ActionResponse + * @instance + */ + ActionResponse.prototype.dialogAction = null; + + /** + * ActionResponse updatedWidget. + * @member {google.chat.v1.ActionResponse.IUpdatedWidget|null|undefined} updatedWidget + * @memberof google.chat.v1.ActionResponse + * @instance + */ + ActionResponse.prototype.updatedWidget = null; + + /** + * Creates a new ActionResponse instance using the specified properties. + * @function create + * @memberof google.chat.v1.ActionResponse + * @static + * @param {google.chat.v1.IActionResponse=} [properties] Properties to set + * @returns {google.chat.v1.ActionResponse} ActionResponse instance + */ + ActionResponse.create = function create(properties) { + return new ActionResponse(properties); + }; + + /** + * Encodes the specified ActionResponse message. Does not implicitly {@link google.chat.v1.ActionResponse.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ActionResponse + * @static + * @param {google.chat.v1.IActionResponse} message ActionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); + if (message.dialogAction != null && Object.hasOwnProperty.call(message, "dialogAction")) + $root.google.chat.v1.DialogAction.encode(message.dialogAction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updatedWidget != null && Object.hasOwnProperty.call(message, "updatedWidget")) + $root.google.chat.v1.ActionResponse.UpdatedWidget.encode(message.updatedWidget, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ActionResponse message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ActionResponse + * @static + * @param {google.chat.v1.IActionResponse} message ActionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ActionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ActionResponse} ActionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ActionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.url = reader.string(); + break; + } + case 3: { + message.dialogAction = $root.google.chat.v1.DialogAction.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updatedWidget = $root.google.chat.v1.ActionResponse.UpdatedWidget.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ActionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ActionResponse} ActionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionResponse message. + * @function verify + * @memberof google.chat.v1.ActionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 6: + case 3: + case 4: + case 7: + break; + } + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.dialogAction != null && message.hasOwnProperty("dialogAction")) { + var error = $root.google.chat.v1.DialogAction.verify(message.dialogAction); + if (error) + return "dialogAction." + error; + } + if (message.updatedWidget != null && message.hasOwnProperty("updatedWidget")) { + var error = $root.google.chat.v1.ActionResponse.UpdatedWidget.verify(message.updatedWidget); + if (error) + return "updatedWidget." + error; + } + return null; + }; + + /** + * Creates an ActionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ActionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ActionResponse} ActionResponse + */ + ActionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ActionResponse) + return object; + var message = new $root.google.chat.v1.ActionResponse(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "NEW_MESSAGE": + case 1: + message.type = 1; + break; + case "UPDATE_MESSAGE": + case 2: + message.type = 2; + break; + case "UPDATE_USER_MESSAGE_CARDS": + case 6: + message.type = 6; + break; + case "REQUEST_CONFIG": + case 3: + message.type = 3; + break; + case "DIALOG": + case 4: + message.type = 4; + break; + case "UPDATE_WIDGET": + case 7: + message.type = 7; + break; + } + if (object.url != null) + message.url = String(object.url); + if (object.dialogAction != null) { + if (typeof object.dialogAction !== "object") + throw TypeError(".google.chat.v1.ActionResponse.dialogAction: object expected"); + message.dialogAction = $root.google.chat.v1.DialogAction.fromObject(object.dialogAction); + } + if (object.updatedWidget != null) { + if (typeof object.updatedWidget !== "object") + throw TypeError(".google.chat.v1.ActionResponse.updatedWidget: object expected"); + message.updatedWidget = $root.google.chat.v1.ActionResponse.UpdatedWidget.fromObject(object.updatedWidget); + } + return message; + }; + + /** + * Creates a plain object from an ActionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ActionResponse + * @static + * @param {google.chat.v1.ActionResponse} message ActionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.url = ""; + object.dialogAction = null; + object.updatedWidget = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.chat.v1.ActionResponse.ResponseType[message.type] === undefined ? message.type : $root.google.chat.v1.ActionResponse.ResponseType[message.type] : message.type; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.dialogAction != null && message.hasOwnProperty("dialogAction")) + object.dialogAction = $root.google.chat.v1.DialogAction.toObject(message.dialogAction, options); + if (message.updatedWidget != null && message.hasOwnProperty("updatedWidget")) + object.updatedWidget = $root.google.chat.v1.ActionResponse.UpdatedWidget.toObject(message.updatedWidget, options); + return object; + }; + + /** + * Converts this ActionResponse to JSON. + * @function toJSON + * @memberof google.chat.v1.ActionResponse + * @instance + * @returns {Object.} JSON object + */ + ActionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActionResponse + * @function getTypeUrl + * @memberof google.chat.v1.ActionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ActionResponse"; + }; + + /** + * ResponseType enum. + * @name google.chat.v1.ActionResponse.ResponseType + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} NEW_MESSAGE=1 NEW_MESSAGE value + * @property {number} UPDATE_MESSAGE=2 UPDATE_MESSAGE value + * @property {number} UPDATE_USER_MESSAGE_CARDS=6 UPDATE_USER_MESSAGE_CARDS value + * @property {number} REQUEST_CONFIG=3 REQUEST_CONFIG value + * @property {number} DIALOG=4 DIALOG value + * @property {number} UPDATE_WIDGET=7 UPDATE_WIDGET value + */ + ActionResponse.ResponseType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEW_MESSAGE"] = 1; + values[valuesById[2] = "UPDATE_MESSAGE"] = 2; + values[valuesById[6] = "UPDATE_USER_MESSAGE_CARDS"] = 6; + values[valuesById[3] = "REQUEST_CONFIG"] = 3; + values[valuesById[4] = "DIALOG"] = 4; + values[valuesById[7] = "UPDATE_WIDGET"] = 7; + return values; + })(); + + ActionResponse.SelectionItems = (function() { + + /** + * Properties of a SelectionItems. + * @memberof google.chat.v1.ActionResponse + * @interface ISelectionItems + * @property {Array.|null} [items] SelectionItems items + */ + + /** + * Constructs a new SelectionItems. + * @memberof google.chat.v1.ActionResponse + * @classdesc Represents a SelectionItems. + * @implements ISelectionItems + * @constructor + * @param {google.chat.v1.ActionResponse.ISelectionItems=} [properties] Properties to set + */ + function SelectionItems(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectionItems items. + * @member {Array.} items + * @memberof google.chat.v1.ActionResponse.SelectionItems + * @instance + */ + SelectionItems.prototype.items = $util.emptyArray; + + /** + * Creates a new SelectionItems instance using the specified properties. + * @function create + * @memberof google.chat.v1.ActionResponse.SelectionItems + * @static + * @param {google.chat.v1.ActionResponse.ISelectionItems=} [properties] Properties to set + * @returns {google.chat.v1.ActionResponse.SelectionItems} SelectionItems instance + */ + SelectionItems.create = function create(properties) { + return new SelectionItems(properties); + }; + + /** + * Encodes the specified SelectionItems message. Does not implicitly {@link google.chat.v1.ActionResponse.SelectionItems.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ActionResponse.SelectionItems + * @static + * @param {google.chat.v1.ActionResponse.ISelectionItems} message SelectionItems message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectionItems.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.apps.card.v1.SelectionInput.SelectionItem.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SelectionItems message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.SelectionItems.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ActionResponse.SelectionItems + * @static + * @param {google.chat.v1.ActionResponse.ISelectionItems} message SelectionItems message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectionItems.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectionItems message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ActionResponse.SelectionItems + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ActionResponse.SelectionItems} SelectionItems + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectionItems.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ActionResponse.SelectionItems(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.apps.card.v1.SelectionInput.SelectionItem.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectionItems message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ActionResponse.SelectionItems + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ActionResponse.SelectionItems} SelectionItems + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectionItems.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectionItems message. + * @function verify + * @memberof google.chat.v1.ActionResponse.SelectionItems + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectionItems.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.apps.card.v1.SelectionInput.SelectionItem.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates a SelectionItems message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ActionResponse.SelectionItems + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ActionResponse.SelectionItems} SelectionItems + */ + SelectionItems.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ActionResponse.SelectionItems) + return object; + var message = new $root.google.chat.v1.ActionResponse.SelectionItems(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.chat.v1.ActionResponse.SelectionItems.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.chat.v1.ActionResponse.SelectionItems.items: object expected"); + message.items[i] = $root.google.apps.card.v1.SelectionInput.SelectionItem.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SelectionItems message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ActionResponse.SelectionItems + * @static + * @param {google.chat.v1.ActionResponse.SelectionItems} message SelectionItems + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectionItems.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.apps.card.v1.SelectionInput.SelectionItem.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this SelectionItems to JSON. + * @function toJSON + * @memberof google.chat.v1.ActionResponse.SelectionItems + * @instance + * @returns {Object.} JSON object + */ + SelectionItems.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectionItems + * @function getTypeUrl + * @memberof google.chat.v1.ActionResponse.SelectionItems + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectionItems.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ActionResponse.SelectionItems"; + }; + + return SelectionItems; + })(); + + ActionResponse.UpdatedWidget = (function() { + + /** + * Properties of an UpdatedWidget. + * @memberof google.chat.v1.ActionResponse + * @interface IUpdatedWidget + * @property {google.chat.v1.ActionResponse.ISelectionItems|null} [suggestions] UpdatedWidget suggestions + * @property {string|null} [widget] UpdatedWidget widget + */ + + /** + * Constructs a new UpdatedWidget. + * @memberof google.chat.v1.ActionResponse + * @classdesc Represents an UpdatedWidget. + * @implements IUpdatedWidget + * @constructor + * @param {google.chat.v1.ActionResponse.IUpdatedWidget=} [properties] Properties to set + */ + function UpdatedWidget(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatedWidget suggestions. + * @member {google.chat.v1.ActionResponse.ISelectionItems|null|undefined} suggestions + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @instance + */ + UpdatedWidget.prototype.suggestions = null; + + /** + * UpdatedWidget widget. + * @member {string} widget + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @instance + */ + UpdatedWidget.prototype.widget = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdatedWidget updatedWidget. + * @member {"suggestions"|undefined} updatedWidget + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @instance + */ + Object.defineProperty(UpdatedWidget.prototype, "updatedWidget", { + get: $util.oneOfGetter($oneOfFields = ["suggestions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdatedWidget instance using the specified properties. + * @function create + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {google.chat.v1.ActionResponse.IUpdatedWidget=} [properties] Properties to set + * @returns {google.chat.v1.ActionResponse.UpdatedWidget} UpdatedWidget instance + */ + UpdatedWidget.create = function create(properties) { + return new UpdatedWidget(properties); + }; + + /** + * Encodes the specified UpdatedWidget message. Does not implicitly {@link google.chat.v1.ActionResponse.UpdatedWidget.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {google.chat.v1.ActionResponse.IUpdatedWidget} message UpdatedWidget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatedWidget.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestions != null && Object.hasOwnProperty.call(message, "suggestions")) + $root.google.chat.v1.ActionResponse.SelectionItems.encode(message.suggestions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.widget != null && Object.hasOwnProperty.call(message, "widget")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.widget); + return writer; + }; + + /** + * Encodes the specified UpdatedWidget message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.UpdatedWidget.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {google.chat.v1.ActionResponse.IUpdatedWidget} message UpdatedWidget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatedWidget.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatedWidget message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ActionResponse.UpdatedWidget} UpdatedWidget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatedWidget.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ActionResponse.UpdatedWidget(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.suggestions = $root.google.chat.v1.ActionResponse.SelectionItems.decode(reader, reader.uint32()); + break; + } + case 2: { + message.widget = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatedWidget message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ActionResponse.UpdatedWidget} UpdatedWidget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatedWidget.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatedWidget message. + * @function verify + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatedWidget.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + properties.updatedWidget = 1; + { + var error = $root.google.chat.v1.ActionResponse.SelectionItems.verify(message.suggestions); + if (error) + return "suggestions." + error; + } + } + if (message.widget != null && message.hasOwnProperty("widget")) + if (!$util.isString(message.widget)) + return "widget: string expected"; + return null; + }; + + /** + * Creates an UpdatedWidget message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ActionResponse.UpdatedWidget} UpdatedWidget + */ + UpdatedWidget.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ActionResponse.UpdatedWidget) + return object; + var message = new $root.google.chat.v1.ActionResponse.UpdatedWidget(); + if (object.suggestions != null) { + if (typeof object.suggestions !== "object") + throw TypeError(".google.chat.v1.ActionResponse.UpdatedWidget.suggestions: object expected"); + message.suggestions = $root.google.chat.v1.ActionResponse.SelectionItems.fromObject(object.suggestions); + } + if (object.widget != null) + message.widget = String(object.widget); + return message; + }; + + /** + * Creates a plain object from an UpdatedWidget message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {google.chat.v1.ActionResponse.UpdatedWidget} message UpdatedWidget + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatedWidget.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.widget = ""; + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + object.suggestions = $root.google.chat.v1.ActionResponse.SelectionItems.toObject(message.suggestions, options); + if (options.oneofs) + object.updatedWidget = "suggestions"; + } + if (message.widget != null && message.hasOwnProperty("widget")) + object.widget = message.widget; + return object; + }; + + /** + * Converts this UpdatedWidget to JSON. + * @function toJSON + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @instance + * @returns {Object.} JSON object + */ + UpdatedWidget.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatedWidget + * @function getTypeUrl + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatedWidget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ActionResponse.UpdatedWidget"; + }; + + return UpdatedWidget; + })(); + + return ActionResponse; + })(); + + v1.AccessoryWidget = (function() { + + /** + * Properties of an AccessoryWidget. + * @memberof google.chat.v1 + * @interface IAccessoryWidget + * @property {google.apps.card.v1.IButtonList|null} [buttonList] AccessoryWidget buttonList + */ + + /** + * Constructs a new AccessoryWidget. + * @memberof google.chat.v1 + * @classdesc Represents an AccessoryWidget. + * @implements IAccessoryWidget + * @constructor + * @param {google.chat.v1.IAccessoryWidget=} [properties] Properties to set + */ + function AccessoryWidget(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessoryWidget buttonList. + * @member {google.apps.card.v1.IButtonList|null|undefined} buttonList + * @memberof google.chat.v1.AccessoryWidget + * @instance + */ + AccessoryWidget.prototype.buttonList = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AccessoryWidget action. + * @member {"buttonList"|undefined} action + * @memberof google.chat.v1.AccessoryWidget + * @instance + */ + Object.defineProperty(AccessoryWidget.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["buttonList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccessoryWidget instance using the specified properties. + * @function create + * @memberof google.chat.v1.AccessoryWidget + * @static + * @param {google.chat.v1.IAccessoryWidget=} [properties] Properties to set + * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget instance + */ + AccessoryWidget.create = function create(properties) { + return new AccessoryWidget(properties); + }; + + /** + * Encodes the specified AccessoryWidget message. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.AccessoryWidget + * @static + * @param {google.chat.v1.IAccessoryWidget} message AccessoryWidget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessoryWidget.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.buttonList != null && Object.hasOwnProperty.call(message, "buttonList")) + $root.google.apps.card.v1.ButtonList.encode(message.buttonList, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessoryWidget message, length delimited. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.AccessoryWidget + * @static + * @param {google.chat.v1.IAccessoryWidget} message AccessoryWidget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessoryWidget.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessoryWidget message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.AccessoryWidget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessoryWidget.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.AccessoryWidget(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.buttonList = $root.google.apps.card.v1.ButtonList.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessoryWidget message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.AccessoryWidget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessoryWidget.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessoryWidget message. + * @function verify + * @memberof google.chat.v1.AccessoryWidget + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessoryWidget.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.buttonList != null && message.hasOwnProperty("buttonList")) { + properties.action = 1; + { + var error = $root.google.apps.card.v1.ButtonList.verify(message.buttonList); + if (error) + return "buttonList." + error; + } + } + return null; + }; + + /** + * Creates an AccessoryWidget message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.AccessoryWidget + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget + */ + AccessoryWidget.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.AccessoryWidget) + return object; + var message = new $root.google.chat.v1.AccessoryWidget(); + if (object.buttonList != null) { + if (typeof object.buttonList !== "object") + throw TypeError(".google.chat.v1.AccessoryWidget.buttonList: object expected"); + message.buttonList = $root.google.apps.card.v1.ButtonList.fromObject(object.buttonList); + } + return message; + }; + + /** + * Creates a plain object from an AccessoryWidget message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.AccessoryWidget + * @static + * @param {google.chat.v1.AccessoryWidget} message AccessoryWidget + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessoryWidget.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.buttonList != null && message.hasOwnProperty("buttonList")) { + object.buttonList = $root.google.apps.card.v1.ButtonList.toObject(message.buttonList, options); + if (options.oneofs) + object.action = "buttonList"; + } + return object; + }; + + /** + * Converts this AccessoryWidget to JSON. + * @function toJSON + * @memberof google.chat.v1.AccessoryWidget + * @instance + * @returns {Object.} JSON object + */ + AccessoryWidget.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessoryWidget + * @function getTypeUrl + * @memberof google.chat.v1.AccessoryWidget + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessoryWidget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.AccessoryWidget"; + }; + + return AccessoryWidget; + })(); + + v1.GetMessageRequest = (function() { + + /** + * Properties of a GetMessageRequest. + * @memberof google.chat.v1 + * @interface IGetMessageRequest + * @property {string|null} [name] GetMessageRequest name + */ + + /** + * Constructs a new GetMessageRequest. + * @memberof google.chat.v1 + * @classdesc Represents a GetMessageRequest. + * @implements IGetMessageRequest + * @constructor + * @param {google.chat.v1.IGetMessageRequest=} [properties] Properties to set + */ + function GetMessageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMessageRequest name. + * @member {string} name + * @memberof google.chat.v1.GetMessageRequest + * @instance + */ + GetMessageRequest.prototype.name = ""; + + /** + * Creates a new GetMessageRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {google.chat.v1.IGetMessageRequest=} [properties] Properties to set + * @returns {google.chat.v1.GetMessageRequest} GetMessageRequest instance + */ + GetMessageRequest.create = function create(properties) { + return new GetMessageRequest(properties); + }; + + /** + * Encodes the specified GetMessageRequest message. Does not implicitly {@link google.chat.v1.GetMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {google.chat.v1.IGetMessageRequest} message GetMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMessageRequest.encode = function encode(message, writer) { + 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 GetMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {google.chat.v1.IGetMessageRequest} message GetMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.GetMessageRequest} GetMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMessageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.GetMessageRequest} GetMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMessageRequest message. + * @function verify + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMessageRequest.verify = function verify(message) { + if (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 GetMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.GetMessageRequest} GetMessageRequest + */ + GetMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.GetMessageRequest) + return object; + var message = new $root.google.chat.v1.GetMessageRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {google.chat.v1.GetMessageRequest} message GetMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMessageRequest.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 GetMessageRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.GetMessageRequest + * @instance + * @returns {Object.} JSON object + */ + GetMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMessageRequest + * @function getTypeUrl + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.GetMessageRequest"; + }; + + return GetMessageRequest; + })(); + + v1.DeleteMessageRequest = (function() { + + /** + * Properties of a DeleteMessageRequest. + * @memberof google.chat.v1 + * @interface IDeleteMessageRequest + * @property {string|null} [name] DeleteMessageRequest name + * @property {boolean|null} [force] DeleteMessageRequest force + */ + + /** + * Constructs a new DeleteMessageRequest. + * @memberof google.chat.v1 + * @classdesc Represents a DeleteMessageRequest. + * @implements IDeleteMessageRequest + * @constructor + * @param {google.chat.v1.IDeleteMessageRequest=} [properties] Properties to set + */ + function DeleteMessageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteMessageRequest name. + * @member {string} name + * @memberof google.chat.v1.DeleteMessageRequest + * @instance + */ + DeleteMessageRequest.prototype.name = ""; + + /** + * DeleteMessageRequest force. + * @member {boolean} force + * @memberof google.chat.v1.DeleteMessageRequest + * @instance + */ + DeleteMessageRequest.prototype.force = false; + + /** + * Creates a new DeleteMessageRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {google.chat.v1.IDeleteMessageRequest=} [properties] Properties to set + * @returns {google.chat.v1.DeleteMessageRequest} DeleteMessageRequest instance + */ + DeleteMessageRequest.create = function create(properties) { + return new DeleteMessageRequest(properties); + }; + + /** + * Encodes the specified DeleteMessageRequest message. Does not implicitly {@link google.chat.v1.DeleteMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {google.chat.v1.IDeleteMessageRequest} message DeleteMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMessageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {google.chat.v1.IDeleteMessageRequest} message DeleteMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.DeleteMessageRequest} DeleteMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMessageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeleteMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.DeleteMessageRequest} DeleteMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMessageRequest message. + * @function verify + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMessageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.DeleteMessageRequest} DeleteMessageRequest + */ + DeleteMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DeleteMessageRequest) + return object; + var message = new $root.google.chat.v1.DeleteMessageRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {google.chat.v1.DeleteMessageRequest} message DeleteMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteMessageRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.DeleteMessageRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMessageRequest + * @function getTypeUrl + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.DeleteMessageRequest"; + }; + + return DeleteMessageRequest; + })(); + + v1.UpdateMessageRequest = (function() { + + /** + * Properties of an UpdateMessageRequest. + * @memberof google.chat.v1 + * @interface IUpdateMessageRequest + * @property {google.chat.v1.IMessage|null} [message] UpdateMessageRequest message + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMessageRequest updateMask + * @property {boolean|null} [allowMissing] UpdateMessageRequest allowMissing + */ + + /** + * Constructs a new UpdateMessageRequest. + * @memberof google.chat.v1 + * @classdesc Represents an UpdateMessageRequest. + * @implements IUpdateMessageRequest + * @constructor + * @param {google.chat.v1.IUpdateMessageRequest=} [properties] Properties to set + */ + function UpdateMessageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMessageRequest message. + * @member {google.chat.v1.IMessage|null|undefined} message + * @memberof google.chat.v1.UpdateMessageRequest + * @instance + */ + UpdateMessageRequest.prototype.message = null; + + /** + * UpdateMessageRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.chat.v1.UpdateMessageRequest + * @instance + */ + UpdateMessageRequest.prototype.updateMask = null; + + /** + * UpdateMessageRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.chat.v1.UpdateMessageRequest + * @instance + */ + UpdateMessageRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateMessageRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {google.chat.v1.IUpdateMessageRequest=} [properties] Properties to set + * @returns {google.chat.v1.UpdateMessageRequest} UpdateMessageRequest instance + */ + UpdateMessageRequest.create = function create(properties) { + return new UpdateMessageRequest(properties); + }; + + /** + * Encodes the specified UpdateMessageRequest message. Does not implicitly {@link google.chat.v1.UpdateMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {google.chat.v1.IUpdateMessageRequest} message UpdateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMessageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.chat.v1.Message.encode(message.message, 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(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {google.chat.v1.IUpdateMessageRequest} message UpdateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.UpdateMessageRequest} UpdateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMessageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UpdateMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.UpdateMessageRequest} UpdateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMessageRequest message. + * @function verify + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMessageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.chat.v1.Message.verify(message.message); + if (error) + return "message." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.UpdateMessageRequest} UpdateMessageRequest + */ + UpdateMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.UpdateMessageRequest) + return object; + var message = new $root.google.chat.v1.UpdateMessageRequest(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.chat.v1.UpdateMessageRequest.message: object expected"); + message.message = $root.google.chat.v1.Message.fromObject(object.message); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.chat.v1.UpdateMessageRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {google.chat.v1.UpdateMessageRequest} message UpdateMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = null; + object.updateMask = null; + object.allowMissing = false; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.chat.v1.Message.toObject(message.message, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateMessageRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.UpdateMessageRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMessageRequest + * @function getTypeUrl + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.UpdateMessageRequest"; + }; + + return UpdateMessageRequest; + })(); + + v1.CreateMessageRequest = (function() { + + /** + * Properties of a CreateMessageRequest. + * @memberof google.chat.v1 + * @interface ICreateMessageRequest + * @property {string|null} [parent] CreateMessageRequest parent + * @property {google.chat.v1.IMessage|null} [message] CreateMessageRequest message + * @property {string|null} [threadKey] CreateMessageRequest threadKey + * @property {string|null} [requestId] CreateMessageRequest requestId + * @property {google.chat.v1.CreateMessageRequest.MessageReplyOption|null} [messageReplyOption] CreateMessageRequest messageReplyOption + * @property {string|null} [messageId] CreateMessageRequest messageId + */ + + /** + * Constructs a new CreateMessageRequest. + * @memberof google.chat.v1 + * @classdesc Represents a CreateMessageRequest. + * @implements ICreateMessageRequest + * @constructor + * @param {google.chat.v1.ICreateMessageRequest=} [properties] Properties to set + */ + function CreateMessageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMessageRequest parent. + * @member {string} parent + * @memberof google.chat.v1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.parent = ""; + + /** + * CreateMessageRequest message. + * @member {google.chat.v1.IMessage|null|undefined} message + * @memberof google.chat.v1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.message = null; + + /** + * CreateMessageRequest threadKey. + * @member {string} threadKey + * @memberof google.chat.v1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.threadKey = ""; + + /** + * CreateMessageRequest requestId. + * @member {string} requestId + * @memberof google.chat.v1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.requestId = ""; + + /** + * CreateMessageRequest messageReplyOption. + * @member {google.chat.v1.CreateMessageRequest.MessageReplyOption} messageReplyOption + * @memberof google.chat.v1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.messageReplyOption = 0; + + /** + * CreateMessageRequest messageId. + * @member {string} messageId + * @memberof google.chat.v1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.messageId = ""; + + /** + * Creates a new CreateMessageRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {google.chat.v1.ICreateMessageRequest=} [properties] Properties to set + * @returns {google.chat.v1.CreateMessageRequest} CreateMessageRequest instance + */ + CreateMessageRequest.create = function create(properties) { + return new CreateMessageRequest(properties); + }; + + /** + * Encodes the specified CreateMessageRequest message. Does not implicitly {@link google.chat.v1.CreateMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {google.chat.v1.ICreateMessageRequest} message CreateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMessageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.chat.v1.Message.encode(message.message, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.threadKey != null && Object.hasOwnProperty.call(message, "threadKey")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.threadKey); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.requestId); + if (message.messageReplyOption != null && Object.hasOwnProperty.call(message, "messageReplyOption")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.messageReplyOption); + if (message.messageId != null && Object.hasOwnProperty.call(message, "messageId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.messageId); + return writer; + }; + + /** + * Encodes the specified CreateMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {google.chat.v1.ICreateMessageRequest} message CreateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CreateMessageRequest} CreateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMessageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CreateMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); + break; + } + case 6: { + message.threadKey = reader.string(); + break; + } + case 7: { + message.requestId = reader.string(); + break; + } + case 8: { + message.messageReplyOption = reader.int32(); + break; + } + case 9: { + message.messageId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CreateMessageRequest} CreateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMessageRequest message. + * @function verify + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMessageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.chat.v1.Message.verify(message.message); + if (error) + return "message." + error; + } + if (message.threadKey != null && message.hasOwnProperty("threadKey")) + if (!$util.isString(message.threadKey)) + return "threadKey: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.messageReplyOption != null && message.hasOwnProperty("messageReplyOption")) + switch (message.messageReplyOption) { + default: + return "messageReplyOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.messageId != null && message.hasOwnProperty("messageId")) + if (!$util.isString(message.messageId)) + return "messageId: string expected"; + return null; + }; + + /** + * Creates a CreateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CreateMessageRequest} CreateMessageRequest + */ + CreateMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CreateMessageRequest) + return object; + var message = new $root.google.chat.v1.CreateMessageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.chat.v1.CreateMessageRequest.message: object expected"); + message.message = $root.google.chat.v1.Message.fromObject(object.message); + } + if (object.threadKey != null) + message.threadKey = String(object.threadKey); + if (object.requestId != null) + message.requestId = String(object.requestId); + switch (object.messageReplyOption) { + default: + if (typeof object.messageReplyOption === "number") { + message.messageReplyOption = object.messageReplyOption; + break; + } + break; + case "MESSAGE_REPLY_OPTION_UNSPECIFIED": + case 0: + message.messageReplyOption = 0; + break; + case "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD": + case 1: + message.messageReplyOption = 1; + break; + case "REPLY_MESSAGE_OR_FAIL": + case 2: + message.messageReplyOption = 2; + break; + } + if (object.messageId != null) + message.messageId = String(object.messageId); + return message; + }; + + /** + * Creates a plain object from a CreateMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {google.chat.v1.CreateMessageRequest} message CreateMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.message = null; + object.threadKey = ""; + object.requestId = ""; + object.messageReplyOption = options.enums === String ? "MESSAGE_REPLY_OPTION_UNSPECIFIED" : 0; + object.messageId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.chat.v1.Message.toObject(message.message, options); + if (message.threadKey != null && message.hasOwnProperty("threadKey")) + object.threadKey = message.threadKey; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.messageReplyOption != null && message.hasOwnProperty("messageReplyOption")) + object.messageReplyOption = options.enums === String ? $root.google.chat.v1.CreateMessageRequest.MessageReplyOption[message.messageReplyOption] === undefined ? message.messageReplyOption : $root.google.chat.v1.CreateMessageRequest.MessageReplyOption[message.messageReplyOption] : message.messageReplyOption; + if (message.messageId != null && message.hasOwnProperty("messageId")) + object.messageId = message.messageId; + return object; + }; + + /** + * Converts this CreateMessageRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.CreateMessageRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMessageRequest + * @function getTypeUrl + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CreateMessageRequest"; + }; + + /** + * MessageReplyOption enum. + * @name google.chat.v1.CreateMessageRequest.MessageReplyOption + * @enum {number} + * @property {number} MESSAGE_REPLY_OPTION_UNSPECIFIED=0 MESSAGE_REPLY_OPTION_UNSPECIFIED value + * @property {number} REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD=1 REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD value + * @property {number} REPLY_MESSAGE_OR_FAIL=2 REPLY_MESSAGE_OR_FAIL value + */ + CreateMessageRequest.MessageReplyOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_REPLY_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD"] = 1; + values[valuesById[2] = "REPLY_MESSAGE_OR_FAIL"] = 2; + return values; + })(); + + return CreateMessageRequest; + })(); + + v1.ListMessagesRequest = (function() { + + /** + * Properties of a ListMessagesRequest. + * @memberof google.chat.v1 + * @interface IListMessagesRequest + * @property {string|null} [parent] ListMessagesRequest parent + * @property {number|null} [pageSize] ListMessagesRequest pageSize + * @property {string|null} [pageToken] ListMessagesRequest pageToken + * @property {string|null} [filter] ListMessagesRequest filter + * @property {string|null} [orderBy] ListMessagesRequest orderBy + * @property {boolean|null} [showDeleted] ListMessagesRequest showDeleted + */ + + /** + * Constructs a new ListMessagesRequest. + * @memberof google.chat.v1 + * @classdesc Represents a ListMessagesRequest. + * @implements IListMessagesRequest + * @constructor + * @param {google.chat.v1.IListMessagesRequest=} [properties] Properties to set + */ + function ListMessagesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMessagesRequest parent. + * @member {string} parent + * @memberof google.chat.v1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.parent = ""; + + /** + * ListMessagesRequest pageSize. + * @member {number} pageSize + * @memberof google.chat.v1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.pageSize = 0; + + /** + * ListMessagesRequest pageToken. + * @member {string} pageToken + * @memberof google.chat.v1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.pageToken = ""; + + /** + * ListMessagesRequest filter. + * @member {string} filter + * @memberof google.chat.v1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.filter = ""; + + /** + * ListMessagesRequest orderBy. + * @member {string} orderBy + * @memberof google.chat.v1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.orderBy = ""; + + /** + * ListMessagesRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.chat.v1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.showDeleted = false; + + /** + * Creates a new ListMessagesRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {google.chat.v1.IListMessagesRequest=} [properties] Properties to set + * @returns {google.chat.v1.ListMessagesRequest} ListMessagesRequest instance + */ + ListMessagesRequest.create = function create(properties) { + return new ListMessagesRequest(properties); + }; + + /** + * Encodes the specified ListMessagesRequest message. Does not implicitly {@link google.chat.v1.ListMessagesRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {google.chat.v1.IListMessagesRequest} message ListMessagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMessagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListMessagesRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListMessagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {google.chat.v1.IListMessagesRequest} message ListMessagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMessagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListMessagesRequest} ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMessagesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListMessagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListMessagesRequest} ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMessagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMessagesRequest message. + * @function verify + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMessagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListMessagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListMessagesRequest} ListMessagesRequest + */ + ListMessagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListMessagesRequest) + return object; + var message = new $root.google.chat.v1.ListMessagesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListMessagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {google.chat.v1.ListMessagesRequest} message ListMessagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMessagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.showDeleted = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListMessagesRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.ListMessagesRequest + * @instance + * @returns {Object.} JSON object + */ + ListMessagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMessagesRequest + * @function getTypeUrl + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMessagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListMessagesRequest"; + }; + + return ListMessagesRequest; + })(); + + v1.ListMessagesResponse = (function() { + + /** + * Properties of a ListMessagesResponse. + * @memberof google.chat.v1 + * @interface IListMessagesResponse + * @property {Array.|null} [messages] ListMessagesResponse messages + * @property {string|null} [nextPageToken] ListMessagesResponse nextPageToken + */ + + /** + * Constructs a new ListMessagesResponse. + * @memberof google.chat.v1 + * @classdesc Represents a ListMessagesResponse. + * @implements IListMessagesResponse + * @constructor + * @param {google.chat.v1.IListMessagesResponse=} [properties] Properties to set + */ + function ListMessagesResponse(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMessagesResponse messages. + * @member {Array.} messages + * @memberof google.chat.v1.ListMessagesResponse + * @instance + */ + ListMessagesResponse.prototype.messages = $util.emptyArray; + + /** + * ListMessagesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.chat.v1.ListMessagesResponse + * @instance + */ + ListMessagesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMessagesResponse instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {google.chat.v1.IListMessagesResponse=} [properties] Properties to set + * @returns {google.chat.v1.ListMessagesResponse} ListMessagesResponse instance + */ + ListMessagesResponse.create = function create(properties) { + return new ListMessagesResponse(properties); + }; + + /** + * Encodes the specified ListMessagesResponse message. Does not implicitly {@link google.chat.v1.ListMessagesResponse.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {google.chat.v1.IListMessagesResponse} message ListMessagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMessagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.chat.v1.Message.encode(message.messages[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 ListMessagesResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListMessagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {google.chat.v1.IListMessagesResponse} message ListMessagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMessagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListMessagesResponse} ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMessagesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListMessagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.chat.v1.Message.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListMessagesResponse} ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMessagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMessagesResponse message. + * @function verify + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMessagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.chat.v1.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMessagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListMessagesResponse} ListMessagesResponse + */ + ListMessagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListMessagesResponse) + return object; + var message = new $root.google.chat.v1.ListMessagesResponse(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.chat.v1.ListMessagesResponse.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.chat.v1.ListMessagesResponse.messages: object expected"); + message.messages[i] = $root.google.chat.v1.Message.fromObject(object.messages[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMessagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {google.chat.v1.ListMessagesResponse} message ListMessagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMessagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.chat.v1.Message.toObject(message.messages[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMessagesResponse to JSON. + * @function toJSON + * @memberof google.chat.v1.ListMessagesResponse + * @instance + * @returns {Object.} JSON object + */ + ListMessagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMessagesResponse + * @function getTypeUrl + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMessagesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListMessagesResponse"; + }; + + return ListMessagesResponse; + })(); + + v1.DialogAction = (function() { + + /** + * Properties of a DialogAction. + * @memberof google.chat.v1 + * @interface IDialogAction + * @property {google.chat.v1.IDialog|null} [dialog] DialogAction dialog + * @property {google.chat.v1.IActionStatus|null} [actionStatus] DialogAction actionStatus + */ + + /** + * Constructs a new DialogAction. + * @memberof google.chat.v1 + * @classdesc Represents a DialogAction. + * @implements IDialogAction + * @constructor + * @param {google.chat.v1.IDialogAction=} [properties] Properties to set + */ + function DialogAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DialogAction dialog. + * @member {google.chat.v1.IDialog|null|undefined} dialog + * @memberof google.chat.v1.DialogAction + * @instance + */ + DialogAction.prototype.dialog = null; + + /** + * DialogAction actionStatus. + * @member {google.chat.v1.IActionStatus|null|undefined} actionStatus + * @memberof google.chat.v1.DialogAction + * @instance + */ + DialogAction.prototype.actionStatus = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DialogAction action. + * @member {"dialog"|undefined} action + * @memberof google.chat.v1.DialogAction + * @instance + */ + Object.defineProperty(DialogAction.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["dialog"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DialogAction instance using the specified properties. + * @function create + * @memberof google.chat.v1.DialogAction + * @static + * @param {google.chat.v1.IDialogAction=} [properties] Properties to set + * @returns {google.chat.v1.DialogAction} DialogAction instance + */ + DialogAction.create = function create(properties) { + return new DialogAction(properties); + }; + + /** + * Encodes the specified DialogAction message. Does not implicitly {@link google.chat.v1.DialogAction.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.DialogAction + * @static + * @param {google.chat.v1.IDialogAction} message DialogAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DialogAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dialog != null && Object.hasOwnProperty.call(message, "dialog")) + $root.google.chat.v1.Dialog.encode(message.dialog, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.actionStatus != null && Object.hasOwnProperty.call(message, "actionStatus")) + $root.google.chat.v1.ActionStatus.encode(message.actionStatus, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DialogAction message, length delimited. Does not implicitly {@link google.chat.v1.DialogAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.DialogAction + * @static + * @param {google.chat.v1.IDialogAction} message DialogAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DialogAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DialogAction message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.DialogAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.DialogAction} DialogAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DialogAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DialogAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dialog = $root.google.chat.v1.Dialog.decode(reader, reader.uint32()); + break; + } + case 2: { + message.actionStatus = $root.google.chat.v1.ActionStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DialogAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.DialogAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.DialogAction} DialogAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DialogAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DialogAction message. + * @function verify + * @memberof google.chat.v1.DialogAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DialogAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dialog != null && message.hasOwnProperty("dialog")) { + properties.action = 1; + { + var error = $root.google.chat.v1.Dialog.verify(message.dialog); + if (error) + return "dialog." + error; + } + } + if (message.actionStatus != null && message.hasOwnProperty("actionStatus")) { + var error = $root.google.chat.v1.ActionStatus.verify(message.actionStatus); + if (error) + return "actionStatus." + error; + } + return null; + }; + + /** + * Creates a DialogAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.DialogAction + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.DialogAction} DialogAction + */ + DialogAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DialogAction) + return object; + var message = new $root.google.chat.v1.DialogAction(); + if (object.dialog != null) { + if (typeof object.dialog !== "object") + throw TypeError(".google.chat.v1.DialogAction.dialog: object expected"); + message.dialog = $root.google.chat.v1.Dialog.fromObject(object.dialog); + } + if (object.actionStatus != null) { + if (typeof object.actionStatus !== "object") + throw TypeError(".google.chat.v1.DialogAction.actionStatus: object expected"); + message.actionStatus = $root.google.chat.v1.ActionStatus.fromObject(object.actionStatus); + } + return message; + }; + + /** + * Creates a plain object from a DialogAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.DialogAction + * @static + * @param {google.chat.v1.DialogAction} message DialogAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DialogAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.actionStatus = null; + if (message.dialog != null && message.hasOwnProperty("dialog")) { + object.dialog = $root.google.chat.v1.Dialog.toObject(message.dialog, options); + if (options.oneofs) + object.action = "dialog"; + } + if (message.actionStatus != null && message.hasOwnProperty("actionStatus")) + object.actionStatus = $root.google.chat.v1.ActionStatus.toObject(message.actionStatus, options); + return object; + }; + + /** + * Converts this DialogAction to JSON. + * @function toJSON + * @memberof google.chat.v1.DialogAction + * @instance + * @returns {Object.} JSON object + */ + DialogAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DialogAction + * @function getTypeUrl + * @memberof google.chat.v1.DialogAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DialogAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.DialogAction"; + }; + + return DialogAction; + })(); + + v1.Dialog = (function() { + + /** + * Properties of a Dialog. + * @memberof google.chat.v1 + * @interface IDialog + * @property {google.apps.card.v1.ICard|null} [body] Dialog body + */ + + /** + * Constructs a new Dialog. + * @memberof google.chat.v1 + * @classdesc Represents a Dialog. + * @implements IDialog + * @constructor + * @param {google.chat.v1.IDialog=} [properties] Properties to set + */ + function Dialog(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dialog body. + * @member {google.apps.card.v1.ICard|null|undefined} body + * @memberof google.chat.v1.Dialog + * @instance + */ + Dialog.prototype.body = null; + + /** + * Creates a new Dialog instance using the specified properties. + * @function create + * @memberof google.chat.v1.Dialog + * @static + * @param {google.chat.v1.IDialog=} [properties] Properties to set + * @returns {google.chat.v1.Dialog} Dialog instance + */ + Dialog.create = function create(properties) { + return new Dialog(properties); + }; + + /** + * Encodes the specified Dialog message. Does not implicitly {@link google.chat.v1.Dialog.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Dialog + * @static + * @param {google.chat.v1.IDialog} message Dialog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dialog.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + $root.google.apps.card.v1.Card.encode(message.body, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Dialog message, length delimited. Does not implicitly {@link google.chat.v1.Dialog.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Dialog + * @static + * @param {google.chat.v1.IDialog} message Dialog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dialog.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dialog message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Dialog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Dialog} Dialog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dialog.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Dialog(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.body = $root.google.apps.card.v1.Card.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dialog message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Dialog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Dialog} Dialog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dialog.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dialog message. + * @function verify + * @memberof google.chat.v1.Dialog + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dialog.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.body != null && message.hasOwnProperty("body")) { + var error = $root.google.apps.card.v1.Card.verify(message.body); + if (error) + return "body." + error; + } + return null; + }; + + /** + * Creates a Dialog message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Dialog + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Dialog} Dialog + */ + Dialog.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Dialog) + return object; + var message = new $root.google.chat.v1.Dialog(); + if (object.body != null) { + if (typeof object.body !== "object") + throw TypeError(".google.chat.v1.Dialog.body: object expected"); + message.body = $root.google.apps.card.v1.Card.fromObject(object.body); + } + return message; + }; + + /** + * Creates a plain object from a Dialog message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Dialog + * @static + * @param {google.chat.v1.Dialog} message Dialog + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dialog.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.body = null; + if (message.body != null && message.hasOwnProperty("body")) + object.body = $root.google.apps.card.v1.Card.toObject(message.body, options); + return object; + }; + + /** + * Converts this Dialog to JSON. + * @function toJSON + * @memberof google.chat.v1.Dialog + * @instance + * @returns {Object.} JSON object + */ + Dialog.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dialog + * @function getTypeUrl + * @memberof google.chat.v1.Dialog + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dialog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Dialog"; + }; + + return Dialog; + })(); + + v1.CardWithId = (function() { + + /** + * Properties of a CardWithId. + * @memberof google.chat.v1 + * @interface ICardWithId + * @property {string|null} [cardId] CardWithId cardId + * @property {google.apps.card.v1.ICard|null} [card] CardWithId card + */ + + /** + * Constructs a new CardWithId. + * @memberof google.chat.v1 + * @classdesc Represents a CardWithId. + * @implements ICardWithId + * @constructor + * @param {google.chat.v1.ICardWithId=} [properties] Properties to set + */ + function CardWithId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CardWithId cardId. + * @member {string} cardId + * @memberof google.chat.v1.CardWithId + * @instance + */ + CardWithId.prototype.cardId = ""; + + /** + * CardWithId card. + * @member {google.apps.card.v1.ICard|null|undefined} card + * @memberof google.chat.v1.CardWithId + * @instance + */ + CardWithId.prototype.card = null; + + /** + * Creates a new CardWithId instance using the specified properties. + * @function create + * @memberof google.chat.v1.CardWithId + * @static + * @param {google.chat.v1.ICardWithId=} [properties] Properties to set + * @returns {google.chat.v1.CardWithId} CardWithId instance + */ + CardWithId.create = function create(properties) { + return new CardWithId(properties); + }; + + /** + * Encodes the specified CardWithId message. Does not implicitly {@link google.chat.v1.CardWithId.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CardWithId + * @static + * @param {google.chat.v1.ICardWithId} message CardWithId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardWithId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cardId != null && Object.hasOwnProperty.call(message, "cardId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cardId); + if (message.card != null && Object.hasOwnProperty.call(message, "card")) + $root.google.apps.card.v1.Card.encode(message.card, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CardWithId message, length delimited. Does not implicitly {@link google.chat.v1.CardWithId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CardWithId + * @static + * @param {google.chat.v1.ICardWithId} message CardWithId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardWithId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CardWithId message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CardWithId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CardWithId} CardWithId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardWithId.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CardWithId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cardId = reader.string(); + break; + } + case 2: { + message.card = $root.google.apps.card.v1.Card.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CardWithId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CardWithId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CardWithId} CardWithId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardWithId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CardWithId message. + * @function verify + * @memberof google.chat.v1.CardWithId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CardWithId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cardId != null && message.hasOwnProperty("cardId")) + if (!$util.isString(message.cardId)) + return "cardId: string expected"; + if (message.card != null && message.hasOwnProperty("card")) { + var error = $root.google.apps.card.v1.Card.verify(message.card); + if (error) + return "card." + error; + } + return null; + }; + + /** + * Creates a CardWithId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CardWithId + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CardWithId} CardWithId + */ + CardWithId.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CardWithId) + return object; + var message = new $root.google.chat.v1.CardWithId(); + if (object.cardId != null) + message.cardId = String(object.cardId); + if (object.card != null) { + if (typeof object.card !== "object") + throw TypeError(".google.chat.v1.CardWithId.card: object expected"); + message.card = $root.google.apps.card.v1.Card.fromObject(object.card); + } + return message; + }; + + /** + * Creates a plain object from a CardWithId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CardWithId + * @static + * @param {google.chat.v1.CardWithId} message CardWithId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CardWithId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cardId = ""; + object.card = null; + } + if (message.cardId != null && message.hasOwnProperty("cardId")) + object.cardId = message.cardId; + if (message.card != null && message.hasOwnProperty("card")) + object.card = $root.google.apps.card.v1.Card.toObject(message.card, options); + return object; + }; + + /** + * Converts this CardWithId to JSON. + * @function toJSON + * @memberof google.chat.v1.CardWithId + * @instance + * @returns {Object.} JSON object + */ + CardWithId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CardWithId + * @function getTypeUrl + * @memberof google.chat.v1.CardWithId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CardWithId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CardWithId"; + }; + + return CardWithId; + })(); + + v1.ContextualAddOnMarkup = (function() { + + /** + * Properties of a ContextualAddOnMarkup. + * @memberof google.chat.v1 + * @interface IContextualAddOnMarkup + */ + + /** + * Constructs a new ContextualAddOnMarkup. + * @memberof google.chat.v1 + * @classdesc Represents a ContextualAddOnMarkup. + * @implements IContextualAddOnMarkup + * @constructor + * @param {google.chat.v1.IContextualAddOnMarkup=} [properties] Properties to set + */ + function ContextualAddOnMarkup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ContextualAddOnMarkup instance using the specified properties. + * @function create + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {google.chat.v1.IContextualAddOnMarkup=} [properties] Properties to set + * @returns {google.chat.v1.ContextualAddOnMarkup} ContextualAddOnMarkup instance + */ + ContextualAddOnMarkup.create = function create(properties) { + return new ContextualAddOnMarkup(properties); + }; + + /** + * Encodes the specified ContextualAddOnMarkup message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {google.chat.v1.IContextualAddOnMarkup} message ContextualAddOnMarkup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualAddOnMarkup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ContextualAddOnMarkup message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {google.chat.v1.IContextualAddOnMarkup} message ContextualAddOnMarkup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualAddOnMarkup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContextualAddOnMarkup message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ContextualAddOnMarkup} ContextualAddOnMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualAddOnMarkup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContextualAddOnMarkup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ContextualAddOnMarkup} ContextualAddOnMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualAddOnMarkup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContextualAddOnMarkup message. + * @function verify + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContextualAddOnMarkup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ContextualAddOnMarkup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ContextualAddOnMarkup} ContextualAddOnMarkup + */ + ContextualAddOnMarkup.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup) + return object; + return new $root.google.chat.v1.ContextualAddOnMarkup(); + }; + + /** + * Creates a plain object from a ContextualAddOnMarkup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {google.chat.v1.ContextualAddOnMarkup} message ContextualAddOnMarkup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContextualAddOnMarkup.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ContextualAddOnMarkup to JSON. + * @function toJSON + * @memberof google.chat.v1.ContextualAddOnMarkup + * @instance + * @returns {Object.} JSON object + */ + ContextualAddOnMarkup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContextualAddOnMarkup + * @function getTypeUrl + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContextualAddOnMarkup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup"; + }; + + ContextualAddOnMarkup.Card = (function() { + + /** + * Properties of a Card. + * @memberof google.chat.v1.ContextualAddOnMarkup + * @interface ICard + * @property {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader|null} [header] Card header + * @property {Array.|null} [sections] Card sections + * @property {Array.|null} [cardActions] Card cardActions + * @property {string|null} [name] Card name + */ + + /** + * Constructs a new Card. + * @memberof google.chat.v1.ContextualAddOnMarkup + * @classdesc Represents a Card. + * @implements ICard + * @constructor + * @param {google.chat.v1.ContextualAddOnMarkup.ICard=} [properties] Properties to set + */ + function Card(properties) { + this.sections = []; + this.cardActions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Card header. + * @member {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader|null|undefined} header + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @instance + */ + Card.prototype.header = null; + + /** + * Card sections. + * @member {Array.} sections + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @instance + */ + Card.prototype.sections = $util.emptyArray; + + /** + * Card cardActions. + * @member {Array.} cardActions + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @instance + */ + Card.prototype.cardActions = $util.emptyArray; + + /** + * Card name. + * @member {string} name + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @instance + */ + Card.prototype.name = ""; + + /** + * Creates a new Card instance using the specified properties. + * @function create + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.ICard=} [properties] Properties to set + * @returns {google.chat.v1.ContextualAddOnMarkup.Card} Card instance + */ + Card.create = function create(properties) { + return new Card(properties); + }; + + /** + * Encodes the specified Card message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.ICard} message Card message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Card.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sections != null && message.sections.length) + for (var i = 0; i < message.sections.length; ++i) + $root.google.chat.v1.ContextualAddOnMarkup.Card.Section.encode(message.sections[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cardActions != null && message.cardActions.length) + for (var i = 0; i < message.cardActions.length; ++i) + $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.encode(message.cardActions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified Card message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.ICard} message Card message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Card.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Card message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ContextualAddOnMarkup.Card} Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Card.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup.Card(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.header = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.sections && message.sections.length)) + message.sections = []; + message.sections.push($root.google.chat.v1.ContextualAddOnMarkup.Card.Section.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.cardActions && message.cardActions.length)) + message.cardActions = []; + message.cardActions.push($root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.decode(reader, reader.uint32())); + break; + } + case 4: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Card message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ContextualAddOnMarkup.Card} Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Card.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Card message. + * @function verify + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Card.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify(message.header); + if (error) + return "header." + error; + } + if (message.sections != null && message.hasOwnProperty("sections")) { + if (!Array.isArray(message.sections)) + return "sections: array expected"; + for (var i = 0; i < message.sections.length; ++i) { + var error = $root.google.chat.v1.ContextualAddOnMarkup.Card.Section.verify(message.sections[i]); + if (error) + return "sections." + error; + } + } + if (message.cardActions != null && message.hasOwnProperty("cardActions")) { + if (!Array.isArray(message.cardActions)) + return "cardActions: array expected"; + for (var i = 0; i < message.cardActions.length; ++i) { + var error = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify(message.cardActions[i]); + if (error) + return "cardActions." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a Card message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ContextualAddOnMarkup.Card} Card + */ + Card.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup.Card) + return object; + var message = new $root.google.chat.v1.ContextualAddOnMarkup.Card(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.header: object expected"); + message.header = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.fromObject(object.header); + } + if (object.sections) { + if (!Array.isArray(object.sections)) + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.sections: array expected"); + message.sections = []; + for (var i = 0; i < object.sections.length; ++i) { + if (typeof object.sections[i] !== "object") + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.sections: object expected"); + message.sections[i] = $root.google.chat.v1.ContextualAddOnMarkup.Card.Section.fromObject(object.sections[i]); + } + } + if (object.cardActions) { + if (!Array.isArray(object.cardActions)) + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.cardActions: array expected"); + message.cardActions = []; + for (var i = 0; i < object.cardActions.length; ++i) { + if (typeof object.cardActions[i] !== "object") + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.cardActions: object expected"); + message.cardActions[i] = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.fromObject(object.cardActions[i]); + } + } + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Card message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card} message Card + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Card.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sections = []; + object.cardActions = []; + } + if (options.defaults) { + object.header = null; + object.name = ""; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.toObject(message.header, options); + if (message.sections && message.sections.length) { + object.sections = []; + for (var j = 0; j < message.sections.length; ++j) + object.sections[j] = $root.google.chat.v1.ContextualAddOnMarkup.Card.Section.toObject(message.sections[j], options); + } + if (message.cardActions && message.cardActions.length) { + object.cardActions = []; + for (var j = 0; j < message.cardActions.length; ++j) + object.cardActions[j] = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.toObject(message.cardActions[j], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Card to JSON. + * @function toJSON + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @instance + * @returns {Object.} JSON object + */ + Card.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Card + * @function getTypeUrl + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Card.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup.Card"; + }; + + Card.CardHeader = (function() { + + /** + * Properties of a CardHeader. + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @interface ICardHeader + * @property {string|null} [title] CardHeader title + * @property {string|null} [subtitle] CardHeader subtitle + * @property {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle|null} [imageStyle] CardHeader imageStyle + * @property {string|null} [imageUrl] CardHeader imageUrl + */ + + /** + * Constructs a new CardHeader. + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @classdesc Represents a CardHeader. + * @implements ICardHeader + * @constructor + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader=} [properties] Properties to set + */ + function CardHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CardHeader title. + * @member {string} title + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @instance + */ + CardHeader.prototype.title = ""; + + /** + * CardHeader subtitle. + * @member {string} subtitle + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @instance + */ + CardHeader.prototype.subtitle = ""; + + /** + * CardHeader imageStyle. + * @member {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle} imageStyle + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @instance + */ + CardHeader.prototype.imageStyle = 0; + + /** + * CardHeader imageUrl. + * @member {string} imageUrl + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @instance + */ + CardHeader.prototype.imageUrl = ""; + + /** + * Creates a new CardHeader instance using the specified properties. + * @function create + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader=} [properties] Properties to set + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} CardHeader instance + */ + CardHeader.create = function create(properties) { + return new CardHeader(properties); + }; + + /** + * Encodes the specified CardHeader message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader} message CardHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); + if (message.imageStyle != null && Object.hasOwnProperty.call(message, "imageStyle")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.imageStyle); + if (message.imageUrl != null && Object.hasOwnProperty.call(message, "imageUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.imageUrl); + return writer; + }; + + /** + * Encodes the specified CardHeader message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader} message CardHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CardHeader message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} CardHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.title = reader.string(); + break; + } + case 2: { + message.subtitle = reader.string(); + break; + } + case 3: { + message.imageStyle = reader.int32(); + break; + } + case 4: { + message.imageUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CardHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} CardHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CardHeader message. + * @function verify + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CardHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + if (message.imageStyle != null && message.hasOwnProperty("imageStyle")) + switch (message.imageStyle) { + default: + return "imageStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) + if (!$util.isString(message.imageUrl)) + return "imageUrl: string expected"; + return null; + }; + + /** + * Creates a CardHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} CardHeader + */ + CardHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader) + return object; + var message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader(); + if (object.title != null) + message.title = String(object.title); + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + switch (object.imageStyle) { + default: + if (typeof object.imageStyle === "number") { + message.imageStyle = object.imageStyle; + break; + } + break; + case "IMAGE_STYLE_UNSPECIFIED": + case 0: + message.imageStyle = 0; + break; + case "IMAGE": + case 1: + message.imageStyle = 1; + break; + case "AVATAR": + case 2: + message.imageStyle = 2; + break; + } + if (object.imageUrl != null) + message.imageUrl = String(object.imageUrl); + return message; + }; + + /** + * Creates a plain object from a CardHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} message CardHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CardHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.title = ""; + object.subtitle = ""; + object.imageStyle = options.enums === String ? "IMAGE_STYLE_UNSPECIFIED" : 0; + object.imageUrl = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + if (message.imageStyle != null && message.hasOwnProperty("imageStyle")) + object.imageStyle = options.enums === String ? $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle[message.imageStyle] === undefined ? message.imageStyle : $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle[message.imageStyle] : message.imageStyle; + if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) + object.imageUrl = message.imageUrl; + return object; + }; + + /** + * Converts this CardHeader to JSON. + * @function toJSON + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @instance + * @returns {Object.} JSON object + */ + CardHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CardHeader + * @function getTypeUrl + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CardHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup.Card.CardHeader"; + }; + + /** + * ImageStyle enum. + * @name google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle + * @enum {number} + * @property {number} IMAGE_STYLE_UNSPECIFIED=0 IMAGE_STYLE_UNSPECIFIED value + * @property {number} IMAGE=1 IMAGE value + * @property {number} AVATAR=2 AVATAR value + */ + CardHeader.ImageStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMAGE_STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMAGE"] = 1; + values[valuesById[2] = "AVATAR"] = 2; + return values; + })(); + + return CardHeader; + })(); + + Card.Section = (function() { + + /** + * Properties of a Section. + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @interface ISection + * @property {string|null} [header] Section header + * @property {Array.|null} [widgets] Section widgets + */ + + /** + * Constructs a new Section. + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @classdesc Represents a Section. + * @implements ISection + * @constructor + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ISection=} [properties] Properties to set + */ + function Section(properties) { + this.widgets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Section header. + * @member {string} header + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @instance + */ + Section.prototype.header = ""; + + /** + * Section widgets. + * @member {Array.} widgets + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @instance + */ + Section.prototype.widgets = $util.emptyArray; + + /** + * Creates a new Section instance using the specified properties. + * @function create + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ISection=} [properties] Properties to set + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.Section} Section instance + */ + Section.create = function create(properties) { + return new Section(properties); + }; + + /** + * Encodes the specified Section message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.Section.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ISection} message Section message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Section.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.header); + if (message.widgets != null && message.widgets.length) + for (var i = 0; i < message.widgets.length; ++i) + $root.google.chat.v1.WidgetMarkup.encode(message.widgets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Section message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.Section.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ISection} message Section message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Section.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Section message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.Section} Section + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Section.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.Section(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.header = reader.string(); + break; + } + case 2: { + if (!(message.widgets && message.widgets.length)) + message.widgets = []; + message.widgets.push($root.google.chat.v1.WidgetMarkup.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Section message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.Section} Section + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Section.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Section message. + * @function verify + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Section.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) + if (!$util.isString(message.header)) + return "header: string expected"; + if (message.widgets != null && message.hasOwnProperty("widgets")) { + if (!Array.isArray(message.widgets)) + return "widgets: array expected"; + for (var i = 0; i < message.widgets.length; ++i) { + var error = $root.google.chat.v1.WidgetMarkup.verify(message.widgets[i]); + if (error) + return "widgets." + error; + } + } + return null; + }; + + /** + * Creates a Section message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.Section} Section + */ + Section.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup.Card.Section) + return object; + var message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.Section(); + if (object.header != null) + message.header = String(object.header); + if (object.widgets) { + if (!Array.isArray(object.widgets)) + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.Section.widgets: array expected"); + message.widgets = []; + for (var i = 0; i < object.widgets.length; ++i) { + if (typeof object.widgets[i] !== "object") + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.Section.widgets: object expected"); + message.widgets[i] = $root.google.chat.v1.WidgetMarkup.fromObject(object.widgets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Section message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.Section} message Section + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Section.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.widgets = []; + if (options.defaults) + object.header = ""; + if (message.header != null && message.hasOwnProperty("header")) + object.header = message.header; + if (message.widgets && message.widgets.length) { + object.widgets = []; + for (var j = 0; j < message.widgets.length; ++j) + object.widgets[j] = $root.google.chat.v1.WidgetMarkup.toObject(message.widgets[j], options); + } + return object; + }; + + /** + * Converts this Section to JSON. + * @function toJSON + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @instance + * @returns {Object.} JSON object + */ + Section.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Section + * @function getTypeUrl + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Section.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup.Card.Section"; + }; + + return Section; + })(); + + Card.CardAction = (function() { + + /** + * Properties of a CardAction. + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @interface ICardAction + * @property {string|null} [actionLabel] CardAction actionLabel + * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] CardAction onClick + */ + + /** + * Constructs a new CardAction. + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @classdesc Represents a CardAction. + * @implements ICardAction + * @constructor + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardAction=} [properties] Properties to set + */ + function CardAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CardAction actionLabel. + * @member {string} actionLabel + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @instance + */ + CardAction.prototype.actionLabel = ""; + + /** + * CardAction onClick. + * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @instance + */ + CardAction.prototype.onClick = null; + + /** + * Creates a new CardAction instance using the specified properties. + * @function create + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardAction=} [properties] Properties to set + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} CardAction instance + */ + CardAction.create = function create(properties) { + return new CardAction(properties); + }; + + /** + * Encodes the specified CardAction message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardAction} message CardAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionLabel != null && Object.hasOwnProperty.call(message, "actionLabel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionLabel); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CardAction message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardAction} message CardAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CardAction message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} CardAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.actionLabel = reader.string(); + break; + } + case 2: { + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CardAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} CardAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CardAction message. + * @function verify + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CardAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionLabel != null && message.hasOwnProperty("actionLabel")) + if (!$util.isString(message.actionLabel)) + return "actionLabel: string expected"; + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + return null; + }; + + /** + * Creates a CardAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} CardAction + */ + CardAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction) + return object; + var message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction(); + if (object.actionLabel != null) + message.actionLabel = String(object.actionLabel); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.CardAction.onClick: object expected"); + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); + } + return message; + }; + + /** + * Creates a plain object from a CardAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} message CardAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CardAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.actionLabel = ""; + object.onClick = null; + } + if (message.actionLabel != null && message.hasOwnProperty("actionLabel")) + object.actionLabel = message.actionLabel; + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); + return object; + }; + + /** + * Converts this CardAction to JSON. + * @function toJSON + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @instance + * @returns {Object.} JSON object + */ + CardAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CardAction + * @function getTypeUrl + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CardAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup.Card.CardAction"; + }; + + return CardAction; + })(); + + return Card; + })(); + + return ContextualAddOnMarkup; + })(); + + v1.WidgetMarkup = (function() { + + /** + * Properties of a WidgetMarkup. + * @memberof google.chat.v1 + * @interface IWidgetMarkup + * @property {google.chat.v1.WidgetMarkup.ITextParagraph|null} [textParagraph] WidgetMarkup textParagraph + * @property {google.chat.v1.WidgetMarkup.IImage|null} [image] WidgetMarkup image + * @property {google.chat.v1.WidgetMarkup.IKeyValue|null} [keyValue] WidgetMarkup keyValue + * @property {Array.|null} [buttons] WidgetMarkup buttons + */ + + /** + * Constructs a new WidgetMarkup. + * @memberof google.chat.v1 + * @classdesc Represents a WidgetMarkup. + * @implements IWidgetMarkup + * @constructor + * @param {google.chat.v1.IWidgetMarkup=} [properties] Properties to set + */ + function WidgetMarkup(properties) { + this.buttons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WidgetMarkup textParagraph. + * @member {google.chat.v1.WidgetMarkup.ITextParagraph|null|undefined} textParagraph + * @memberof google.chat.v1.WidgetMarkup + * @instance + */ + WidgetMarkup.prototype.textParagraph = null; + + /** + * WidgetMarkup image. + * @member {google.chat.v1.WidgetMarkup.IImage|null|undefined} image + * @memberof google.chat.v1.WidgetMarkup + * @instance + */ + WidgetMarkup.prototype.image = null; + + /** + * WidgetMarkup keyValue. + * @member {google.chat.v1.WidgetMarkup.IKeyValue|null|undefined} keyValue + * @memberof google.chat.v1.WidgetMarkup + * @instance + */ + WidgetMarkup.prototype.keyValue = null; + + /** + * WidgetMarkup buttons. + * @member {Array.} buttons + * @memberof google.chat.v1.WidgetMarkup + * @instance + */ + WidgetMarkup.prototype.buttons = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WidgetMarkup data. + * @member {"textParagraph"|"image"|"keyValue"|undefined} data + * @memberof google.chat.v1.WidgetMarkup + * @instance + */ + Object.defineProperty(WidgetMarkup.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["textParagraph", "image", "keyValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WidgetMarkup instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {google.chat.v1.IWidgetMarkup=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup} WidgetMarkup instance + */ + WidgetMarkup.create = function create(properties) { + return new WidgetMarkup(properties); + }; + + /** + * Encodes the specified WidgetMarkup message. Does not implicitly {@link google.chat.v1.WidgetMarkup.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {google.chat.v1.IWidgetMarkup} message WidgetMarkup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WidgetMarkup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textParagraph != null && Object.hasOwnProperty.call(message, "textParagraph")) + $root.google.chat.v1.WidgetMarkup.TextParagraph.encode(message.textParagraph, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.chat.v1.WidgetMarkup.Image.encode(message.image, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.keyValue != null && Object.hasOwnProperty.call(message, "keyValue")) + $root.google.chat.v1.WidgetMarkup.KeyValue.encode(message.keyValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.google.chat.v1.WidgetMarkup.Button.encode(message.buttons[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WidgetMarkup message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {google.chat.v1.IWidgetMarkup} message WidgetMarkup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WidgetMarkup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WidgetMarkup message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup} WidgetMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WidgetMarkup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.textParagraph = $root.google.chat.v1.WidgetMarkup.TextParagraph.decode(reader, reader.uint32()); + break; + } + case 2: { + message.image = $root.google.chat.v1.WidgetMarkup.Image.decode(reader, reader.uint32()); + break; + } + case 3: { + message.keyValue = $root.google.chat.v1.WidgetMarkup.KeyValue.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.google.chat.v1.WidgetMarkup.Button.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WidgetMarkup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup} WidgetMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WidgetMarkup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WidgetMarkup message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WidgetMarkup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textParagraph != null && message.hasOwnProperty("textParagraph")) { + properties.data = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.TextParagraph.verify(message.textParagraph); + if (error) + return "textParagraph." + error; + } + } + if (message.image != null && message.hasOwnProperty("image")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.keyValue != null && message.hasOwnProperty("keyValue")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.KeyValue.verify(message.keyValue); + if (error) + return "keyValue." + error; + } + } + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.google.chat.v1.WidgetMarkup.Button.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } + } + return null; + }; + + /** + * Creates a WidgetMarkup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup} WidgetMarkup + */ + WidgetMarkup.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup) + return object; + var message = new $root.google.chat.v1.WidgetMarkup(); + if (object.textParagraph != null) { + if (typeof object.textParagraph !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.textParagraph: object expected"); + message.textParagraph = $root.google.chat.v1.WidgetMarkup.TextParagraph.fromObject(object.textParagraph); + } + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.image: object expected"); + message.image = $root.google.chat.v1.WidgetMarkup.Image.fromObject(object.image); + } + if (object.keyValue != null) { + if (typeof object.keyValue !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.keyValue: object expected"); + message.keyValue = $root.google.chat.v1.WidgetMarkup.KeyValue.fromObject(object.keyValue); + } + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".google.chat.v1.WidgetMarkup.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.buttons: object expected"); + message.buttons[i] = $root.google.chat.v1.WidgetMarkup.Button.fromObject(object.buttons[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WidgetMarkup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {google.chat.v1.WidgetMarkup} message WidgetMarkup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WidgetMarkup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buttons = []; + if (message.textParagraph != null && message.hasOwnProperty("textParagraph")) { + object.textParagraph = $root.google.chat.v1.WidgetMarkup.TextParagraph.toObject(message.textParagraph, options); + if (options.oneofs) + object.data = "textParagraph"; + } + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.chat.v1.WidgetMarkup.Image.toObject(message.image, options); + if (options.oneofs) + object.data = "image"; + } + if (message.keyValue != null && message.hasOwnProperty("keyValue")) { + object.keyValue = $root.google.chat.v1.WidgetMarkup.KeyValue.toObject(message.keyValue, options); + if (options.oneofs) + object.data = "keyValue"; + } + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.google.chat.v1.WidgetMarkup.Button.toObject(message.buttons[j], options); + } + return object; + }; + + /** + * Converts this WidgetMarkup to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup + * @instance + * @returns {Object.} JSON object + */ + WidgetMarkup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WidgetMarkup + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WidgetMarkup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup"; + }; + + WidgetMarkup.TextParagraph = (function() { + + /** + * Properties of a TextParagraph. + * @memberof google.chat.v1.WidgetMarkup + * @interface ITextParagraph + * @property {string|null} [text] TextParagraph text + */ + + /** + * Constructs a new TextParagraph. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents a TextParagraph. + * @implements ITextParagraph + * @constructor + * @param {google.chat.v1.WidgetMarkup.ITextParagraph=} [properties] Properties to set + */ + function TextParagraph(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextParagraph text. + * @member {string} text + * @memberof google.chat.v1.WidgetMarkup.TextParagraph + * @instance + */ + TextParagraph.prototype.text = ""; + + /** + * Creates a new TextParagraph instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.TextParagraph + * @static + * @param {google.chat.v1.WidgetMarkup.ITextParagraph=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.TextParagraph} TextParagraph instance + */ + TextParagraph.create = function create(properties) { + return new TextParagraph(properties); + }; + + /** + * Encodes the specified TextParagraph message. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextParagraph.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.TextParagraph + * @static + * @param {google.chat.v1.WidgetMarkup.ITextParagraph} message TextParagraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextParagraph.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; + + /** + * Encodes the specified TextParagraph message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextParagraph.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.TextParagraph + * @static + * @param {google.chat.v1.WidgetMarkup.ITextParagraph} message TextParagraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextParagraph.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextParagraph message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.TextParagraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.TextParagraph} TextParagraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextParagraph.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.TextParagraph(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextParagraph message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.TextParagraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.TextParagraph} TextParagraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextParagraph.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextParagraph message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.TextParagraph + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextParagraph.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TextParagraph message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.TextParagraph + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.TextParagraph} TextParagraph + */ + TextParagraph.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.TextParagraph) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.TextParagraph(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TextParagraph message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.TextParagraph + * @static + * @param {google.chat.v1.WidgetMarkup.TextParagraph} message TextParagraph + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextParagraph.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TextParagraph to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.TextParagraph + * @instance + * @returns {Object.} JSON object + */ + TextParagraph.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextParagraph + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.TextParagraph + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextParagraph.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.TextParagraph"; + }; + + return TextParagraph; + })(); + + /** + * Icon enum. + * @name google.chat.v1.WidgetMarkup.Icon + * @enum {number} + * @property {number} ICON_UNSPECIFIED=0 ICON_UNSPECIFIED value + * @property {number} AIRPLANE=1 AIRPLANE value + * @property {number} BOOKMARK=26 BOOKMARK value + * @property {number} BUS=25 BUS value + * @property {number} CAR=9 CAR value + * @property {number} CLOCK=2 CLOCK value + * @property {number} CONFIRMATION_NUMBER_ICON=12 CONFIRMATION_NUMBER_ICON value + * @property {number} DOLLAR=14 DOLLAR value + * @property {number} DESCRIPTION=27 DESCRIPTION value + * @property {number} EMAIL=10 EMAIL value + * @property {number} EVENT_PERFORMER=20 EVENT_PERFORMER value + * @property {number} EVENT_SEAT=21 EVENT_SEAT value + * @property {number} FLIGHT_ARRIVAL=16 FLIGHT_ARRIVAL value + * @property {number} FLIGHT_DEPARTURE=15 FLIGHT_DEPARTURE value + * @property {number} HOTEL=6 HOTEL value + * @property {number} HOTEL_ROOM_TYPE=17 HOTEL_ROOM_TYPE value + * @property {number} INVITE=19 INVITE value + * @property {number} MAP_PIN=3 MAP_PIN value + * @property {number} MEMBERSHIP=24 MEMBERSHIP value + * @property {number} MULTIPLE_PEOPLE=18 MULTIPLE_PEOPLE value + * @property {number} OFFER=30 OFFER value + * @property {number} PERSON=11 PERSON value + * @property {number} PHONE=13 PHONE value + * @property {number} RESTAURANT_ICON=7 RESTAURANT_ICON value + * @property {number} SHOPPING_CART=8 SHOPPING_CART value + * @property {number} STAR=5 STAR value + * @property {number} STORE=22 STORE value + * @property {number} TICKET=4 TICKET value + * @property {number} TRAIN=23 TRAIN value + * @property {number} VIDEO_CAMERA=28 VIDEO_CAMERA value + * @property {number} VIDEO_PLAY=29 VIDEO_PLAY value + */ + WidgetMarkup.Icon = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ICON_UNSPECIFIED"] = 0; + values[valuesById[1] = "AIRPLANE"] = 1; + values[valuesById[26] = "BOOKMARK"] = 26; + values[valuesById[25] = "BUS"] = 25; + values[valuesById[9] = "CAR"] = 9; + values[valuesById[2] = "CLOCK"] = 2; + values[valuesById[12] = "CONFIRMATION_NUMBER_ICON"] = 12; + values[valuesById[14] = "DOLLAR"] = 14; + values[valuesById[27] = "DESCRIPTION"] = 27; + values[valuesById[10] = "EMAIL"] = 10; + values[valuesById[20] = "EVENT_PERFORMER"] = 20; + values[valuesById[21] = "EVENT_SEAT"] = 21; + values[valuesById[16] = "FLIGHT_ARRIVAL"] = 16; + values[valuesById[15] = "FLIGHT_DEPARTURE"] = 15; + values[valuesById[6] = "HOTEL"] = 6; + values[valuesById[17] = "HOTEL_ROOM_TYPE"] = 17; + values[valuesById[19] = "INVITE"] = 19; + values[valuesById[3] = "MAP_PIN"] = 3; + values[valuesById[24] = "MEMBERSHIP"] = 24; + values[valuesById[18] = "MULTIPLE_PEOPLE"] = 18; + values[valuesById[30] = "OFFER"] = 30; + values[valuesById[11] = "PERSON"] = 11; + values[valuesById[13] = "PHONE"] = 13; + values[valuesById[7] = "RESTAURANT_ICON"] = 7; + values[valuesById[8] = "SHOPPING_CART"] = 8; + values[valuesById[5] = "STAR"] = 5; + values[valuesById[22] = "STORE"] = 22; + values[valuesById[4] = "TICKET"] = 4; + values[valuesById[23] = "TRAIN"] = 23; + values[valuesById[28] = "VIDEO_CAMERA"] = 28; + values[valuesById[29] = "VIDEO_PLAY"] = 29; + return values; + })(); + + WidgetMarkup.Button = (function() { + + /** + * Properties of a Button. + * @memberof google.chat.v1.WidgetMarkup + * @interface IButton + * @property {google.chat.v1.WidgetMarkup.ITextButton|null} [textButton] Button textButton + * @property {google.chat.v1.WidgetMarkup.IImageButton|null} [imageButton] Button imageButton + */ + + /** + * Constructs a new Button. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents a Button. + * @implements IButton + * @constructor + * @param {google.chat.v1.WidgetMarkup.IButton=} [properties] Properties to set + */ + function Button(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Button textButton. + * @member {google.chat.v1.WidgetMarkup.ITextButton|null|undefined} textButton + * @memberof google.chat.v1.WidgetMarkup.Button + * @instance + */ + Button.prototype.textButton = null; + + /** + * Button imageButton. + * @member {google.chat.v1.WidgetMarkup.IImageButton|null|undefined} imageButton + * @memberof google.chat.v1.WidgetMarkup.Button + * @instance + */ + Button.prototype.imageButton = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Button type. + * @member {"textButton"|"imageButton"|undefined} type + * @memberof google.chat.v1.WidgetMarkup.Button + * @instance + */ + Object.defineProperty(Button.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["textButton", "imageButton"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Button instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.Button + * @static + * @param {google.chat.v1.WidgetMarkup.IButton=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.Button} Button instance + */ + Button.create = function create(properties) { + return new Button(properties); + }; + + /** + * Encodes the specified Button message. Does not implicitly {@link google.chat.v1.WidgetMarkup.Button.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.Button + * @static + * @param {google.chat.v1.WidgetMarkup.IButton} message Button message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Button.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textButton != null && Object.hasOwnProperty.call(message, "textButton")) + $root.google.chat.v1.WidgetMarkup.TextButton.encode(message.textButton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.imageButton != null && Object.hasOwnProperty.call(message, "imageButton")) + $root.google.chat.v1.WidgetMarkup.ImageButton.encode(message.imageButton, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.Button.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.Button + * @static + * @param {google.chat.v1.WidgetMarkup.IButton} message Button message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Button.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Button message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.Button + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.Button} Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Button.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.Button(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.textButton = $root.google.chat.v1.WidgetMarkup.TextButton.decode(reader, reader.uint32()); + break; + } + case 2: { + message.imageButton = $root.google.chat.v1.WidgetMarkup.ImageButton.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Button message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.Button + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.Button} Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Button.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Button message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.Button + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Button.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textButton != null && message.hasOwnProperty("textButton")) { + properties.type = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.TextButton.verify(message.textButton); + if (error) + return "textButton." + error; + } + } + if (message.imageButton != null && message.hasOwnProperty("imageButton")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.ImageButton.verify(message.imageButton); + if (error) + return "imageButton." + error; + } + } + return null; + }; + + /** + * Creates a Button message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.Button + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.Button} Button + */ + Button.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.Button) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.Button(); + if (object.textButton != null) { + if (typeof object.textButton !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.Button.textButton: object expected"); + message.textButton = $root.google.chat.v1.WidgetMarkup.TextButton.fromObject(object.textButton); + } + if (object.imageButton != null) { + if (typeof object.imageButton !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.Button.imageButton: object expected"); + message.imageButton = $root.google.chat.v1.WidgetMarkup.ImageButton.fromObject(object.imageButton); + } + return message; + }; + + /** + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.Button + * @static + * @param {google.chat.v1.WidgetMarkup.Button} message Button + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Button.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.textButton != null && message.hasOwnProperty("textButton")) { + object.textButton = $root.google.chat.v1.WidgetMarkup.TextButton.toObject(message.textButton, options); + if (options.oneofs) + object.type = "textButton"; + } + if (message.imageButton != null && message.hasOwnProperty("imageButton")) { + object.imageButton = $root.google.chat.v1.WidgetMarkup.ImageButton.toObject(message.imageButton, options); + if (options.oneofs) + object.type = "imageButton"; + } + return object; + }; + + /** + * Converts this Button to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.Button + * @instance + * @returns {Object.} JSON object + */ + Button.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Button + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.Button + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Button.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.Button"; + }; + + return Button; + })(); + + WidgetMarkup.TextButton = (function() { + + /** + * Properties of a TextButton. + * @memberof google.chat.v1.WidgetMarkup + * @interface ITextButton + * @property {string|null} [text] TextButton text + * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] TextButton onClick + */ + + /** + * Constructs a new TextButton. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents a TextButton. + * @implements ITextButton + * @constructor + * @param {google.chat.v1.WidgetMarkup.ITextButton=} [properties] Properties to set + */ + function TextButton(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextButton text. + * @member {string} text + * @memberof google.chat.v1.WidgetMarkup.TextButton + * @instance + */ + TextButton.prototype.text = ""; + + /** + * TextButton onClick. + * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick + * @memberof google.chat.v1.WidgetMarkup.TextButton + * @instance + */ + TextButton.prototype.onClick = null; + + /** + * Creates a new TextButton instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.TextButton + * @static + * @param {google.chat.v1.WidgetMarkup.ITextButton=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.TextButton} TextButton instance + */ + TextButton.create = function create(properties) { + return new TextButton(properties); + }; + + /** + * Encodes the specified TextButton message. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextButton.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.TextButton + * @static + * @param {google.chat.v1.WidgetMarkup.ITextButton} message TextButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextButton message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextButton.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.TextButton + * @static + * @param {google.chat.v1.WidgetMarkup.ITextButton} message TextButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextButton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextButton message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.TextButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.TextButton} TextButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextButton.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.TextButton(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextButton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.TextButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.TextButton} TextButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextButton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextButton message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.TextButton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + return null; + }; + + /** + * Creates a TextButton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.TextButton + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.TextButton} TextButton + */ + TextButton.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.TextButton) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.TextButton(); + if (object.text != null) + message.text = String(object.text); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.TextButton.onClick: object expected"); + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); + } + return message; + }; + + /** + * Creates a plain object from a TextButton message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.TextButton + * @static + * @param {google.chat.v1.WidgetMarkup.TextButton} message TextButton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextButton.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.onClick = null; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); + return object; + }; + + /** + * Converts this TextButton to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.TextButton + * @instance + * @returns {Object.} JSON object + */ + TextButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextButton + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.TextButton + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.TextButton"; + }; + + return TextButton; + })(); + + WidgetMarkup.KeyValue = (function() { + + /** + * Properties of a KeyValue. + * @memberof google.chat.v1.WidgetMarkup + * @interface IKeyValue + * @property {google.chat.v1.WidgetMarkup.Icon|null} [icon] KeyValue icon + * @property {string|null} [iconUrl] KeyValue iconUrl + * @property {string|null} [topLabel] KeyValue topLabel + * @property {string|null} [content] KeyValue content + * @property {boolean|null} [contentMultiline] KeyValue contentMultiline + * @property {string|null} [bottomLabel] KeyValue bottomLabel + * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] KeyValue onClick + * @property {google.chat.v1.WidgetMarkup.IButton|null} [button] KeyValue button + */ + + /** + * Constructs a new KeyValue. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents a KeyValue. + * @implements IKeyValue + * @constructor + * @param {google.chat.v1.WidgetMarkup.IKeyValue=} [properties] Properties to set + */ + function KeyValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyValue icon. + * @member {google.chat.v1.WidgetMarkup.Icon|null|undefined} icon + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.icon = null; + + /** + * KeyValue iconUrl. + * @member {string|null|undefined} iconUrl + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.iconUrl = null; + + /** + * KeyValue topLabel. + * @member {string} topLabel + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.topLabel = ""; + + /** + * KeyValue content. + * @member {string} content + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.content = ""; + + /** + * KeyValue contentMultiline. + * @member {boolean} contentMultiline + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.contentMultiline = false; + + /** + * KeyValue bottomLabel. + * @member {string} bottomLabel + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.bottomLabel = ""; + + /** + * KeyValue onClick. + * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.onClick = null; + + /** + * KeyValue button. + * @member {google.chat.v1.WidgetMarkup.IButton|null|undefined} button + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.button = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KeyValue icons. + * @member {"icon"|"iconUrl"|undefined} icons + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + Object.defineProperty(KeyValue.prototype, "icons", { + get: $util.oneOfGetter($oneOfFields = ["icon", "iconUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * KeyValue control. + * @member {"button"|undefined} control + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + Object.defineProperty(KeyValue.prototype, "control", { + get: $util.oneOfGetter($oneOfFields = ["button"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KeyValue instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {google.chat.v1.WidgetMarkup.IKeyValue=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.KeyValue} KeyValue instance + */ + KeyValue.create = function create(properties) { + return new KeyValue(properties); + }; + + /** + * Encodes the specified KeyValue message. Does not implicitly {@link google.chat.v1.WidgetMarkup.KeyValue.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {google.chat.v1.WidgetMarkup.IKeyValue} message KeyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.icon); + if (message.iconUrl != null && Object.hasOwnProperty.call(message, "iconUrl")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.iconUrl); + if (message.topLabel != null && Object.hasOwnProperty.call(message, "topLabel")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.topLabel); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.content); + if (message.bottomLabel != null && Object.hasOwnProperty.call(message, "bottomLabel")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.bottomLabel); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.button != null && Object.hasOwnProperty.call(message, "button")) + $root.google.chat.v1.WidgetMarkup.Button.encode(message.button, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.contentMultiline != null && Object.hasOwnProperty.call(message, "contentMultiline")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.contentMultiline); + return writer; + }; + + /** + * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.KeyValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {google.chat.v1.WidgetMarkup.IKeyValue} message KeyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyValue message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.KeyValue} KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.KeyValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.icon = reader.int32(); + break; + } + case 2: { + message.iconUrl = reader.string(); + break; + } + case 3: { + message.topLabel = reader.string(); + break; + } + case 4: { + message.content = reader.string(); + break; + } + case 9: { + message.contentMultiline = reader.bool(); + break; + } + case 5: { + message.bottomLabel = reader.string(); + break; + } + case 6: { + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); + break; + } + case 7: { + message.button = $root.google.chat.v1.WidgetMarkup.Button.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.KeyValue} KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyValue message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.icon != null && message.hasOwnProperty("icon")) { + properties.icons = 1; + switch (message.icon) { + default: + return "icon: enum value expected"; + case 0: + case 1: + case 26: + case 25: + case 9: + case 2: + case 12: + case 14: + case 27: + case 10: + case 20: + case 21: + case 16: + case 15: + case 6: + case 17: + case 19: + case 3: + case 24: + case 18: + case 30: + case 11: + case 13: + case 7: + case 8: + case 5: + case 22: + case 4: + case 23: + case 28: + case 29: + break; + } + } + if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { + if (properties.icons === 1) + return "icons: multiple values"; + properties.icons = 1; + if (!$util.isString(message.iconUrl)) + return "iconUrl: string expected"; + } + if (message.topLabel != null && message.hasOwnProperty("topLabel")) + if (!$util.isString(message.topLabel)) + return "topLabel: string expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.contentMultiline != null && message.hasOwnProperty("contentMultiline")) + if (typeof message.contentMultiline !== "boolean") + return "contentMultiline: boolean expected"; + if (message.bottomLabel != null && message.hasOwnProperty("bottomLabel")) + if (!$util.isString(message.bottomLabel)) + return "bottomLabel: string expected"; + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + if (message.button != null && message.hasOwnProperty("button")) { + properties.control = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.Button.verify(message.button); + if (error) + return "button." + error; + } + } + return null; + }; + + /** + * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.KeyValue} KeyValue + */ + KeyValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.KeyValue) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.KeyValue(); + switch (object.icon) { + default: + if (typeof object.icon === "number") { + message.icon = object.icon; + break; + } + break; + case "ICON_UNSPECIFIED": + case 0: + message.icon = 0; + break; + case "AIRPLANE": + case 1: + message.icon = 1; + break; + case "BOOKMARK": + case 26: + message.icon = 26; + break; + case "BUS": + case 25: + message.icon = 25; + break; + case "CAR": + case 9: + message.icon = 9; + break; + case "CLOCK": + case 2: + message.icon = 2; + break; + case "CONFIRMATION_NUMBER_ICON": + case 12: + message.icon = 12; + break; + case "DOLLAR": + case 14: + message.icon = 14; + break; + case "DESCRIPTION": + case 27: + message.icon = 27; + break; + case "EMAIL": + case 10: + message.icon = 10; + break; + case "EVENT_PERFORMER": + case 20: + message.icon = 20; + break; + case "EVENT_SEAT": + case 21: + message.icon = 21; + break; + case "FLIGHT_ARRIVAL": + case 16: + message.icon = 16; + break; + case "FLIGHT_DEPARTURE": + case 15: + message.icon = 15; + break; + case "HOTEL": + case 6: + message.icon = 6; + break; + case "HOTEL_ROOM_TYPE": + case 17: + message.icon = 17; + break; + case "INVITE": + case 19: + message.icon = 19; + break; + case "MAP_PIN": + case 3: + message.icon = 3; + break; + case "MEMBERSHIP": + case 24: + message.icon = 24; + break; + case "MULTIPLE_PEOPLE": + case 18: + message.icon = 18; + break; + case "OFFER": + case 30: + message.icon = 30; + break; + case "PERSON": + case 11: + message.icon = 11; + break; + case "PHONE": + case 13: + message.icon = 13; + break; + case "RESTAURANT_ICON": + case 7: + message.icon = 7; + break; + case "SHOPPING_CART": + case 8: + message.icon = 8; + break; + case "STAR": + case 5: + message.icon = 5; + break; + case "STORE": + case 22: + message.icon = 22; + break; + case "TICKET": + case 4: + message.icon = 4; + break; + case "TRAIN": + case 23: + message.icon = 23; + break; + case "VIDEO_CAMERA": + case 28: + message.icon = 28; + break; + case "VIDEO_PLAY": + case 29: + message.icon = 29; + break; + } + if (object.iconUrl != null) + message.iconUrl = String(object.iconUrl); + if (object.topLabel != null) + message.topLabel = String(object.topLabel); + if (object.content != null) + message.content = String(object.content); + if (object.contentMultiline != null) + message.contentMultiline = Boolean(object.contentMultiline); + if (object.bottomLabel != null) + message.bottomLabel = String(object.bottomLabel); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.KeyValue.onClick: object expected"); + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); + } + if (object.button != null) { + if (typeof object.button !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.KeyValue.button: object expected"); + message.button = $root.google.chat.v1.WidgetMarkup.Button.fromObject(object.button); + } + return message; + }; + + /** + * Creates a plain object from a KeyValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {google.chat.v1.WidgetMarkup.KeyValue} message KeyValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topLabel = ""; + object.content = ""; + object.bottomLabel = ""; + object.onClick = null; + object.contentMultiline = false; + } + if (message.icon != null && message.hasOwnProperty("icon")) { + object.icon = options.enums === String ? $root.google.chat.v1.WidgetMarkup.Icon[message.icon] === undefined ? message.icon : $root.google.chat.v1.WidgetMarkup.Icon[message.icon] : message.icon; + if (options.oneofs) + object.icons = "icon"; + } + if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { + object.iconUrl = message.iconUrl; + if (options.oneofs) + object.icons = "iconUrl"; + } + if (message.topLabel != null && message.hasOwnProperty("topLabel")) + object.topLabel = message.topLabel; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.bottomLabel != null && message.hasOwnProperty("bottomLabel")) + object.bottomLabel = message.bottomLabel; + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); + if (message.button != null && message.hasOwnProperty("button")) { + object.button = $root.google.chat.v1.WidgetMarkup.Button.toObject(message.button, options); + if (options.oneofs) + object.control = "button"; + } + if (message.contentMultiline != null && message.hasOwnProperty("contentMultiline")) + object.contentMultiline = message.contentMultiline; + return object; + }; + + /** + * Converts this KeyValue to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + * @returns {Object.} JSON object + */ + KeyValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyValue + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.KeyValue"; + }; + + return KeyValue; + })(); + + WidgetMarkup.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.chat.v1.WidgetMarkup + * @interface IImage + * @property {string|null} [imageUrl] Image imageUrl + * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] Image onClick + * @property {number|null} [aspectRatio] Image aspectRatio + */ + + /** + * Constructs a new Image. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.chat.v1.WidgetMarkup.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image imageUrl. + * @member {string} imageUrl + * @memberof google.chat.v1.WidgetMarkup.Image + * @instance + */ + Image.prototype.imageUrl = ""; + + /** + * Image onClick. + * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick + * @memberof google.chat.v1.WidgetMarkup.Image + * @instance + */ + Image.prototype.onClick = null; + + /** + * Image aspectRatio. + * @member {number} aspectRatio + * @memberof google.chat.v1.WidgetMarkup.Image + * @instance + */ + Image.prototype.aspectRatio = 0; + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {google.chat.v1.WidgetMarkup.IImage=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.chat.v1.WidgetMarkup.Image.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {google.chat.v1.WidgetMarkup.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageUrl != null && Object.hasOwnProperty.call(message, "imageUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUrl); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.aspectRatio != null && Object.hasOwnProperty.call(message, "aspectRatio")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.aspectRatio); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {google.chat.v1.WidgetMarkup.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageUrl = reader.string(); + break; + } + case 2: { + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); + break; + } + case 3: { + message.aspectRatio = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) + if (!$util.isString(message.imageUrl)) + return "imageUrl: string expected"; + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + if (message.aspectRatio != null && message.hasOwnProperty("aspectRatio")) + if (typeof message.aspectRatio !== "number") + return "aspectRatio: number expected"; + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.Image) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.Image(); + if (object.imageUrl != null) + message.imageUrl = String(object.imageUrl); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.Image.onClick: object expected"); + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); + } + if (object.aspectRatio != null) + message.aspectRatio = Number(object.aspectRatio); + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {google.chat.v1.WidgetMarkup.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.imageUrl = ""; + object.onClick = null; + object.aspectRatio = 0; + } + if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) + object.imageUrl = message.imageUrl; + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); + if (message.aspectRatio != null && message.hasOwnProperty("aspectRatio")) + object.aspectRatio = options.json && !isFinite(message.aspectRatio) ? String(message.aspectRatio) : message.aspectRatio; + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.Image"; + }; + + return Image; + })(); + + WidgetMarkup.ImageButton = (function() { + + /** + * Properties of an ImageButton. + * @memberof google.chat.v1.WidgetMarkup + * @interface IImageButton + * @property {google.chat.v1.WidgetMarkup.Icon|null} [icon] ImageButton icon + * @property {string|null} [iconUrl] ImageButton iconUrl + * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] ImageButton onClick + * @property {string|null} [name] ImageButton name + */ + + /** + * Constructs a new ImageButton. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents an ImageButton. + * @implements IImageButton + * @constructor + * @param {google.chat.v1.WidgetMarkup.IImageButton=} [properties] Properties to set + */ + function ImageButton(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageButton icon. + * @member {google.chat.v1.WidgetMarkup.Icon|null|undefined} icon + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @instance + */ + ImageButton.prototype.icon = null; + + /** + * ImageButton iconUrl. + * @member {string|null|undefined} iconUrl + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @instance + */ + ImageButton.prototype.iconUrl = null; + + /** + * ImageButton onClick. + * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @instance + */ + ImageButton.prototype.onClick = null; + + /** + * ImageButton name. + * @member {string} name + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @instance + */ + ImageButton.prototype.name = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImageButton icons. + * @member {"icon"|"iconUrl"|undefined} icons + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @instance + */ + Object.defineProperty(ImageButton.prototype, "icons", { + get: $util.oneOfGetter($oneOfFields = ["icon", "iconUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImageButton instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {google.chat.v1.WidgetMarkup.IImageButton=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.ImageButton} ImageButton instance + */ + ImageButton.create = function create(properties) { + return new ImageButton(properties); + }; + + /** + * Encodes the specified ImageButton message. Does not implicitly {@link google.chat.v1.WidgetMarkup.ImageButton.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {google.chat.v1.WidgetMarkup.IImageButton} message ImageButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.icon); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.iconUrl != null && Object.hasOwnProperty.call(message, "iconUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.iconUrl); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ImageButton message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.ImageButton.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {google.chat.v1.WidgetMarkup.IImageButton} message ImageButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageButton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageButton message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.ImageButton} ImageButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageButton.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.ImageButton(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.icon = reader.int32(); + break; + } + case 3: { + message.iconUrl = reader.string(); + break; + } + case 2: { + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); + break; + } + case 4: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageButton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.ImageButton} ImageButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageButton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageButton message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.icon != null && message.hasOwnProperty("icon")) { + properties.icons = 1; + switch (message.icon) { + default: + return "icon: enum value expected"; + case 0: + case 1: + case 26: + case 25: + case 9: + case 2: + case 12: + case 14: + case 27: + case 10: + case 20: + case 21: + case 16: + case 15: + case 6: + case 17: + case 19: + case 3: + case 24: + case 18: + case 30: + case 11: + case 13: + case 7: + case 8: + case 5: + case 22: + case 4: + case 23: + case 28: + case 29: + break; + } + } + if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { + if (properties.icons === 1) + return "icons: multiple values"; + properties.icons = 1; + if (!$util.isString(message.iconUrl)) + return "iconUrl: string expected"; + } + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an ImageButton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.ImageButton} ImageButton + */ + ImageButton.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.ImageButton) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.ImageButton(); + switch (object.icon) { + default: + if (typeof object.icon === "number") { + message.icon = object.icon; + break; + } + break; + case "ICON_UNSPECIFIED": + case 0: + message.icon = 0; + break; + case "AIRPLANE": + case 1: + message.icon = 1; + break; + case "BOOKMARK": + case 26: + message.icon = 26; + break; + case "BUS": + case 25: + message.icon = 25; + break; + case "CAR": + case 9: + message.icon = 9; + break; + case "CLOCK": + case 2: + message.icon = 2; + break; + case "CONFIRMATION_NUMBER_ICON": + case 12: + message.icon = 12; + break; + case "DOLLAR": + case 14: + message.icon = 14; + break; + case "DESCRIPTION": + case 27: + message.icon = 27; + break; + case "EMAIL": + case 10: + message.icon = 10; + break; + case "EVENT_PERFORMER": + case 20: + message.icon = 20; + break; + case "EVENT_SEAT": + case 21: + message.icon = 21; + break; + case "FLIGHT_ARRIVAL": + case 16: + message.icon = 16; + break; + case "FLIGHT_DEPARTURE": + case 15: + message.icon = 15; + break; + case "HOTEL": + case 6: + message.icon = 6; + break; + case "HOTEL_ROOM_TYPE": + case 17: + message.icon = 17; + break; + case "INVITE": + case 19: + message.icon = 19; + break; + case "MAP_PIN": + case 3: + message.icon = 3; + break; + case "MEMBERSHIP": + case 24: + message.icon = 24; + break; + case "MULTIPLE_PEOPLE": + case 18: + message.icon = 18; + break; + case "OFFER": + case 30: + message.icon = 30; + break; + case "PERSON": + case 11: + message.icon = 11; + break; + case "PHONE": + case 13: + message.icon = 13; + break; + case "RESTAURANT_ICON": + case 7: + message.icon = 7; + break; + case "SHOPPING_CART": + case 8: + message.icon = 8; + break; + case "STAR": + case 5: + message.icon = 5; + break; + case "STORE": + case 22: + message.icon = 22; + break; + case "TICKET": + case 4: + message.icon = 4; + break; + case "TRAIN": + case 23: + message.icon = 23; + break; + case "VIDEO_CAMERA": + case 28: + message.icon = 28; + break; + case "VIDEO_PLAY": + case 29: + message.icon = 29; + break; + } + if (object.iconUrl != null) + message.iconUrl = String(object.iconUrl); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.ImageButton.onClick: object expected"); + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); + } + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an ImageButton message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {google.chat.v1.WidgetMarkup.ImageButton} message ImageButton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageButton.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.onClick = null; + object.name = ""; + } + if (message.icon != null && message.hasOwnProperty("icon")) { + object.icon = options.enums === String ? $root.google.chat.v1.WidgetMarkup.Icon[message.icon] === undefined ? message.icon : $root.google.chat.v1.WidgetMarkup.Icon[message.icon] : message.icon; + if (options.oneofs) + object.icons = "icon"; + } + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); + if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { + object.iconUrl = message.iconUrl; + if (options.oneofs) + object.icons = "iconUrl"; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ImageButton to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @instance + * @returns {Object.} JSON object + */ + ImageButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageButton + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.ImageButton"; + }; + + return ImageButton; + })(); + + WidgetMarkup.OnClick = (function() { + + /** + * Properties of an OnClick. + * @memberof google.chat.v1.WidgetMarkup + * @interface IOnClick + * @property {google.chat.v1.WidgetMarkup.IFormAction|null} [action] OnClick action + * @property {google.chat.v1.WidgetMarkup.IOpenLink|null} [openLink] OnClick openLink + */ + + /** + * Constructs a new OnClick. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents an OnClick. + * @implements IOnClick + * @constructor + * @param {google.chat.v1.WidgetMarkup.IOnClick=} [properties] Properties to set + */ + function OnClick(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OnClick action. + * @member {google.chat.v1.WidgetMarkup.IFormAction|null|undefined} action + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @instance + */ + OnClick.prototype.action = null; + + /** + * OnClick openLink. + * @member {google.chat.v1.WidgetMarkup.IOpenLink|null|undefined} openLink + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @instance + */ + OnClick.prototype.openLink = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OnClick data. + * @member {"action"|"openLink"|undefined} data + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @instance + */ + Object.defineProperty(OnClick.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["action", "openLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OnClick instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {google.chat.v1.WidgetMarkup.IOnClick=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.OnClick} OnClick instance + */ + OnClick.create = function create(properties) { + return new OnClick(properties); + }; + + /** + * Encodes the specified OnClick message. Does not implicitly {@link google.chat.v1.WidgetMarkup.OnClick.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {google.chat.v1.WidgetMarkup.IOnClick} message OnClick message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnClick.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.chat.v1.WidgetMarkup.FormAction.encode(message.action, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.openLink != null && Object.hasOwnProperty.call(message, "openLink")) + $root.google.chat.v1.WidgetMarkup.OpenLink.encode(message.openLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OnClick message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.OnClick.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {google.chat.v1.WidgetMarkup.IOnClick} message OnClick message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnClick.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OnClick message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.OnClick} OnClick + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnClick.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.OnClick(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = $root.google.chat.v1.WidgetMarkup.FormAction.decode(reader, reader.uint32()); + break; + } + case 2: { + message.openLink = $root.google.chat.v1.WidgetMarkup.OpenLink.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OnClick message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.OnClick} OnClick + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnClick.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OnClick message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnClick.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.action != null && message.hasOwnProperty("action")) { + properties.data = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.FormAction.verify(message.action); + if (error) + return "action." + error; + } + } + if (message.openLink != null && message.hasOwnProperty("openLink")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.OpenLink.verify(message.openLink); + if (error) + return "openLink." + error; + } + } + return null; + }; + + /** + * Creates an OnClick message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.OnClick} OnClick + */ + OnClick.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.OnClick) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.OnClick(); + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.OnClick.action: object expected"); + message.action = $root.google.chat.v1.WidgetMarkup.FormAction.fromObject(object.action); + } + if (object.openLink != null) { + if (typeof object.openLink !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.OnClick.openLink: object expected"); + message.openLink = $root.google.chat.v1.WidgetMarkup.OpenLink.fromObject(object.openLink); + } + return message; + }; + + /** + * Creates a plain object from an OnClick message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {google.chat.v1.WidgetMarkup.OnClick} message OnClick + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnClick.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.action != null && message.hasOwnProperty("action")) { + object.action = $root.google.chat.v1.WidgetMarkup.FormAction.toObject(message.action, options); + if (options.oneofs) + object.data = "action"; + } + if (message.openLink != null && message.hasOwnProperty("openLink")) { + object.openLink = $root.google.chat.v1.WidgetMarkup.OpenLink.toObject(message.openLink, options); + if (options.oneofs) + object.data = "openLink"; + } + return object; + }; + + /** + * Converts this OnClick to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @instance + * @returns {Object.} JSON object + */ + OnClick.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OnClick + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnClick.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.OnClick"; + }; + + return OnClick; + })(); + + WidgetMarkup.OpenLink = (function() { + + /** + * Properties of an OpenLink. + * @memberof google.chat.v1.WidgetMarkup + * @interface IOpenLink + * @property {string|null} [url] OpenLink url + */ + + /** + * Constructs a new OpenLink. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents an OpenLink. + * @implements IOpenLink + * @constructor + * @param {google.chat.v1.WidgetMarkup.IOpenLink=} [properties] Properties to set + */ + function OpenLink(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenLink url. + * @member {string} url + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @instance + */ + OpenLink.prototype.url = ""; + + /** + * Creates a new OpenLink instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {google.chat.v1.WidgetMarkup.IOpenLink=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.OpenLink} OpenLink instance + */ + OpenLink.create = function create(properties) { + return new OpenLink(properties); + }; + + /** + * Encodes the specified OpenLink message. Does not implicitly {@link google.chat.v1.WidgetMarkup.OpenLink.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {google.chat.v1.WidgetMarkup.IOpenLink} message OpenLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenLink.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + return writer; + }; + + /** + * Encodes the specified OpenLink message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.OpenLink.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {google.chat.v1.WidgetMarkup.IOpenLink} message OpenLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenLink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenLink message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.OpenLink} OpenLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenLink.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.OpenLink(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenLink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.OpenLink} OpenLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenLink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenLink message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenLink.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates an OpenLink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.OpenLink} OpenLink + */ + OpenLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.OpenLink) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.OpenLink(); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from an OpenLink message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {google.chat.v1.WidgetMarkup.OpenLink} message OpenLink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenLink.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.url = ""; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this OpenLink to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @instance + * @returns {Object.} JSON object + */ + OpenLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenLink + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.OpenLink"; + }; + + return OpenLink; + })(); + + WidgetMarkup.FormAction = (function() { + + /** + * Properties of a FormAction. + * @memberof google.chat.v1.WidgetMarkup + * @interface IFormAction + * @property {string|null} [actionMethodName] FormAction actionMethodName + * @property {Array.|null} [parameters] FormAction parameters + */ + + /** + * Constructs a new FormAction. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents a FormAction. + * @implements IFormAction + * @constructor + * @param {google.chat.v1.WidgetMarkup.IFormAction=} [properties] Properties to set + */ + function FormAction(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FormAction actionMethodName. + * @member {string} actionMethodName + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @instance + */ + FormAction.prototype.actionMethodName = ""; + + /** + * FormAction parameters. + * @member {Array.} parameters + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @instance + */ + FormAction.prototype.parameters = $util.emptyArray; + + /** + * Creates a new FormAction instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {google.chat.v1.WidgetMarkup.IFormAction=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.FormAction} FormAction instance + */ + FormAction.create = function create(properties) { + return new FormAction(properties); + }; + + /** + * Encodes the specified FormAction message. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {google.chat.v1.WidgetMarkup.IFormAction} message FormAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FormAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionMethodName != null && Object.hasOwnProperty.call(message, "actionMethodName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionMethodName); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.encode(message.parameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FormAction message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {google.chat.v1.WidgetMarkup.IFormAction} message FormAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FormAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FormAction message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.FormAction} FormAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FormAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.FormAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.actionMethodName = reader.string(); + break; + } + case 2: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FormAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.FormAction} FormAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FormAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FormAction message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FormAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionMethodName != null && message.hasOwnProperty("actionMethodName")) + if (!$util.isString(message.actionMethodName)) + return "actionMethodName: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates a FormAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.FormAction} FormAction + */ + FormAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.FormAction) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.FormAction(); + if (object.actionMethodName != null) + message.actionMethodName = String(object.actionMethodName); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.chat.v1.WidgetMarkup.FormAction.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.FormAction.parameters: object expected"); + message.parameters[i] = $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.fromObject(object.parameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FormAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {google.chat.v1.WidgetMarkup.FormAction} message FormAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FormAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (options.defaults) + object.actionMethodName = ""; + if (message.actionMethodName != null && message.hasOwnProperty("actionMethodName")) + object.actionMethodName = message.actionMethodName; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.toObject(message.parameters[j], options); + } + return object; + }; + + /** + * Converts this FormAction to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @instance + * @returns {Object.} JSON object + */ + FormAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FormAction + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FormAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.FormAction"; + }; + + FormAction.ActionParameter = (function() { + + /** + * Properties of an ActionParameter. + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @interface IActionParameter + * @property {string|null} [key] ActionParameter key + * @property {string|null} [value] ActionParameter value + */ + + /** + * Constructs a new ActionParameter. + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @classdesc Represents an ActionParameter. + * @implements IActionParameter + * @constructor + * @param {google.chat.v1.WidgetMarkup.FormAction.IActionParameter=} [properties] Properties to set + */ + function ActionParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActionParameter key. + * @member {string} key + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @instance + */ + ActionParameter.prototype.key = ""; + + /** + * ActionParameter value. + * @member {string} value + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @instance + */ + ActionParameter.prototype.value = ""; + + /** + * Creates a new ActionParameter instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {google.chat.v1.WidgetMarkup.FormAction.IActionParameter=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.FormAction.ActionParameter} ActionParameter instance + */ + ActionParameter.create = function create(properties) { + return new ActionParameter(properties); + }; + + /** + * Encodes the specified ActionParameter message. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.ActionParameter.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {google.chat.v1.WidgetMarkup.FormAction.IActionParameter} message ActionParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified ActionParameter message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.ActionParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {google.chat.v1.WidgetMarkup.FormAction.IActionParameter} message ActionParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionParameter message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.FormAction.ActionParameter} ActionParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionParameter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.FormAction.ActionParameter} ActionParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionParameter message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an ActionParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.FormAction.ActionParameter} ActionParameter + */ + ActionParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an ActionParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {google.chat.v1.WidgetMarkup.FormAction.ActionParameter} message ActionParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.value = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this ActionParameter to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @instance + * @returns {Object.} JSON object + */ + ActionParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActionParameter + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActionParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.FormAction.ActionParameter"; + }; + + return ActionParameter; + })(); + + return FormAction; + })(); + + return WidgetMarkup; + })(); + + v1.DeletionMetadata = (function() { + + /** + * Properties of a DeletionMetadata. + * @memberof google.chat.v1 + * @interface IDeletionMetadata + * @property {google.chat.v1.DeletionMetadata.DeletionType|null} [deletionType] DeletionMetadata deletionType + */ + + /** + * Constructs a new DeletionMetadata. + * @memberof google.chat.v1 + * @classdesc Represents a DeletionMetadata. + * @implements IDeletionMetadata + * @constructor + * @param {google.chat.v1.IDeletionMetadata=} [properties] Properties to set + */ + function DeletionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletionMetadata deletionType. + * @member {google.chat.v1.DeletionMetadata.DeletionType} deletionType + * @memberof google.chat.v1.DeletionMetadata + * @instance + */ + DeletionMetadata.prototype.deletionType = 0; + + /** + * Creates a new DeletionMetadata instance using the specified properties. + * @function create + * @memberof google.chat.v1.DeletionMetadata + * @static + * @param {google.chat.v1.IDeletionMetadata=} [properties] Properties to set + * @returns {google.chat.v1.DeletionMetadata} DeletionMetadata instance + */ + DeletionMetadata.create = function create(properties) { + return new DeletionMetadata(properties); + }; + + /** + * Encodes the specified DeletionMetadata message. Does not implicitly {@link google.chat.v1.DeletionMetadata.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.DeletionMetadata + * @static + * @param {google.chat.v1.IDeletionMetadata} message DeletionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deletionType != null && Object.hasOwnProperty.call(message, "deletionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.deletionType); + return writer; + }; + + /** + * Encodes the specified DeletionMetadata message, length delimited. Does not implicitly {@link google.chat.v1.DeletionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.DeletionMetadata + * @static + * @param {google.chat.v1.IDeletionMetadata} message DeletionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.DeletionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.DeletionMetadata} DeletionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletionMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeletionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deletionType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.DeletionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.DeletionMetadata} DeletionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletionMetadata message. + * @function verify + * @memberof google.chat.v1.DeletionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deletionType != null && message.hasOwnProperty("deletionType")) + switch (message.deletionType) { + default: + return "deletionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a DeletionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.DeletionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.DeletionMetadata} DeletionMetadata + */ + DeletionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DeletionMetadata) + return object; + var message = new $root.google.chat.v1.DeletionMetadata(); + switch (object.deletionType) { + default: + if (typeof object.deletionType === "number") { + message.deletionType = object.deletionType; + break; + } + break; + case "DELETION_TYPE_UNSPECIFIED": + case 0: + message.deletionType = 0; + break; + case "CREATOR": + case 1: + message.deletionType = 1; + break; + case "SPACE_OWNER": + case 2: + message.deletionType = 2; + break; + case "ADMIN": + case 3: + message.deletionType = 3; + break; + case "APP_MESSAGE_EXPIRY": + case 4: + message.deletionType = 4; + break; + case "CREATOR_VIA_APP": + case 5: + message.deletionType = 5; + break; + case "SPACE_OWNER_VIA_APP": + case 6: + message.deletionType = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a DeletionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.DeletionMetadata + * @static + * @param {google.chat.v1.DeletionMetadata} message DeletionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.deletionType = options.enums === String ? "DELETION_TYPE_UNSPECIFIED" : 0; + if (message.deletionType != null && message.hasOwnProperty("deletionType")) + object.deletionType = options.enums === String ? $root.google.chat.v1.DeletionMetadata.DeletionType[message.deletionType] === undefined ? message.deletionType : $root.google.chat.v1.DeletionMetadata.DeletionType[message.deletionType] : message.deletionType; + return object; + }; + + /** + * Converts this DeletionMetadata to JSON. + * @function toJSON + * @memberof google.chat.v1.DeletionMetadata + * @instance + * @returns {Object.} JSON object + */ + DeletionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletionMetadata + * @function getTypeUrl + * @memberof google.chat.v1.DeletionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.DeletionMetadata"; + }; + + /** + * DeletionType enum. + * @name google.chat.v1.DeletionMetadata.DeletionType + * @enum {number} + * @property {number} DELETION_TYPE_UNSPECIFIED=0 DELETION_TYPE_UNSPECIFIED value + * @property {number} CREATOR=1 CREATOR value + * @property {number} SPACE_OWNER=2 SPACE_OWNER value + * @property {number} ADMIN=3 ADMIN value + * @property {number} APP_MESSAGE_EXPIRY=4 APP_MESSAGE_EXPIRY value + * @property {number} CREATOR_VIA_APP=5 CREATOR_VIA_APP value + * @property {number} SPACE_OWNER_VIA_APP=6 SPACE_OWNER_VIA_APP value + */ + DeletionMetadata.DeletionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DELETION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATOR"] = 1; + values[valuesById[2] = "SPACE_OWNER"] = 2; + values[valuesById[3] = "ADMIN"] = 3; + values[valuesById[4] = "APP_MESSAGE_EXPIRY"] = 4; + values[valuesById[5] = "CREATOR_VIA_APP"] = 5; + values[valuesById[6] = "SPACE_OWNER_VIA_APP"] = 6; + return values; + })(); + + return DeletionMetadata; + })(); + + v1.MatchedUrl = (function() { + + /** + * Properties of a MatchedUrl. + * @memberof google.chat.v1 + * @interface IMatchedUrl + * @property {string|null} [url] MatchedUrl url + */ + + /** + * Constructs a new MatchedUrl. + * @memberof google.chat.v1 + * @classdesc Represents a MatchedUrl. + * @implements IMatchedUrl + * @constructor + * @param {google.chat.v1.IMatchedUrl=} [properties] Properties to set + */ + function MatchedUrl(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MatchedUrl url. + * @member {string} url + * @memberof google.chat.v1.MatchedUrl + * @instance + */ + MatchedUrl.prototype.url = ""; + + /** + * Creates a new MatchedUrl instance using the specified properties. + * @function create + * @memberof google.chat.v1.MatchedUrl + * @static + * @param {google.chat.v1.IMatchedUrl=} [properties] Properties to set + * @returns {google.chat.v1.MatchedUrl} MatchedUrl instance + */ + MatchedUrl.create = function create(properties) { + return new MatchedUrl(properties); + }; + + /** + * Encodes the specified MatchedUrl message. Does not implicitly {@link google.chat.v1.MatchedUrl.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MatchedUrl + * @static + * @param {google.chat.v1.IMatchedUrl} message MatchedUrl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchedUrl.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); + return writer; + }; + + /** + * Encodes the specified MatchedUrl message, length delimited. Does not implicitly {@link google.chat.v1.MatchedUrl.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MatchedUrl + * @static + * @param {google.chat.v1.IMatchedUrl} message MatchedUrl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchedUrl.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MatchedUrl message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MatchedUrl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MatchedUrl} MatchedUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchedUrl.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MatchedUrl(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MatchedUrl message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MatchedUrl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MatchedUrl} MatchedUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchedUrl.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MatchedUrl message. + * @function verify + * @memberof google.chat.v1.MatchedUrl + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MatchedUrl.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates a MatchedUrl message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MatchedUrl + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MatchedUrl} MatchedUrl + */ + MatchedUrl.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MatchedUrl) + return object; + var message = new $root.google.chat.v1.MatchedUrl(); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from a MatchedUrl message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MatchedUrl + * @static + * @param {google.chat.v1.MatchedUrl} message MatchedUrl + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MatchedUrl.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.url = ""; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this MatchedUrl to JSON. + * @function toJSON + * @memberof google.chat.v1.MatchedUrl + * @instance + * @returns {Object.} JSON object + */ + MatchedUrl.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MatchedUrl + * @function getTypeUrl + * @memberof google.chat.v1.MatchedUrl + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MatchedUrl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MatchedUrl"; + }; + + return MatchedUrl; + })(); + + v1.Reaction = (function() { + + /** + * Properties of a Reaction. + * @memberof google.chat.v1 + * @interface IReaction + * @property {string|null} [name] Reaction name + * @property {google.chat.v1.IUser|null} [user] Reaction user + * @property {google.chat.v1.IEmoji|null} [emoji] Reaction emoji + */ + + /** + * Constructs a new Reaction. + * @memberof google.chat.v1 + * @classdesc Represents a Reaction. + * @implements IReaction + * @constructor + * @param {google.chat.v1.IReaction=} [properties] Properties to set + */ + function Reaction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Reaction name. + * @member {string} name + * @memberof google.chat.v1.Reaction + * @instance + */ + Reaction.prototype.name = ""; + + /** + * Reaction user. + * @member {google.chat.v1.IUser|null|undefined} user + * @memberof google.chat.v1.Reaction + * @instance + */ + Reaction.prototype.user = null; + + /** + * Reaction emoji. + * @member {google.chat.v1.IEmoji|null|undefined} emoji + * @memberof google.chat.v1.Reaction + * @instance + */ + Reaction.prototype.emoji = null; + + /** + * Creates a new Reaction instance using the specified properties. + * @function create + * @memberof google.chat.v1.Reaction + * @static + * @param {google.chat.v1.IReaction=} [properties] Properties to set + * @returns {google.chat.v1.Reaction} Reaction instance + */ + Reaction.create = function create(properties) { + return new Reaction(properties); + }; + + /** + * Encodes the specified Reaction message. Does not implicitly {@link google.chat.v1.Reaction.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Reaction + * @static + * @param {google.chat.v1.IReaction} message Reaction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reaction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.chat.v1.User.encode(message.user, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.emoji != null && Object.hasOwnProperty.call(message, "emoji")) + $root.google.chat.v1.Emoji.encode(message.emoji, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Reaction message, length delimited. Does not implicitly {@link google.chat.v1.Reaction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Reaction + * @static + * @param {google.chat.v1.IReaction} message Reaction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reaction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Reaction message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Reaction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Reaction} Reaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reaction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Reaction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.user = $root.google.chat.v1.User.decode(reader, reader.uint32()); + break; + } + case 3: { + message.emoji = $root.google.chat.v1.Emoji.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Reaction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Reaction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Reaction} Reaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reaction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Reaction message. + * @function verify + * @memberof google.chat.v1.Reaction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Reaction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.chat.v1.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.emoji != null && message.hasOwnProperty("emoji")) { + var error = $root.google.chat.v1.Emoji.verify(message.emoji); + if (error) + return "emoji." + error; + } + return null; + }; + + /** + * Creates a Reaction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Reaction + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Reaction} Reaction + */ + Reaction.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Reaction) + return object; + var message = new $root.google.chat.v1.Reaction(); + if (object.name != null) + message.name = String(object.name); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.chat.v1.Reaction.user: object expected"); + message.user = $root.google.chat.v1.User.fromObject(object.user); + } + if (object.emoji != null) { + if (typeof object.emoji !== "object") + throw TypeError(".google.chat.v1.Reaction.emoji: object expected"); + message.emoji = $root.google.chat.v1.Emoji.fromObject(object.emoji); + } + return message; + }; + + /** + * Creates a plain object from a Reaction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Reaction + * @static + * @param {google.chat.v1.Reaction} message Reaction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Reaction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.user = null; + object.emoji = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.chat.v1.User.toObject(message.user, options); + if (message.emoji != null && message.hasOwnProperty("emoji")) + object.emoji = $root.google.chat.v1.Emoji.toObject(message.emoji, options); + return object; + }; + + /** + * Converts this Reaction to JSON. + * @function toJSON + * @memberof google.chat.v1.Reaction + * @instance + * @returns {Object.} JSON object + */ + Reaction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Reaction + * @function getTypeUrl + * @memberof google.chat.v1.Reaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Reaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Reaction"; + }; + + return Reaction; + })(); + + v1.Emoji = (function() { + + /** + * Properties of an Emoji. + * @memberof google.chat.v1 + * @interface IEmoji + * @property {string|null} [unicode] Emoji unicode + * @property {google.chat.v1.ICustomEmoji|null} [customEmoji] Emoji customEmoji + */ + + /** + * Constructs a new Emoji. + * @memberof google.chat.v1 + * @classdesc Represents an Emoji. + * @implements IEmoji + * @constructor + * @param {google.chat.v1.IEmoji=} [properties] Properties to set + */ + function Emoji(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Emoji unicode. + * @member {string|null|undefined} unicode + * @memberof google.chat.v1.Emoji + * @instance + */ + Emoji.prototype.unicode = null; + + /** + * Emoji customEmoji. + * @member {google.chat.v1.ICustomEmoji|null|undefined} customEmoji + * @memberof google.chat.v1.Emoji + * @instance + */ + Emoji.prototype.customEmoji = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Emoji content. + * @member {"unicode"|"customEmoji"|undefined} content + * @memberof google.chat.v1.Emoji + * @instance + */ + Object.defineProperty(Emoji.prototype, "content", { + get: $util.oneOfGetter($oneOfFields = ["unicode", "customEmoji"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Emoji instance using the specified properties. + * @function create + * @memberof google.chat.v1.Emoji + * @static + * @param {google.chat.v1.IEmoji=} [properties] Properties to set + * @returns {google.chat.v1.Emoji} Emoji instance + */ + Emoji.create = function create(properties) { + return new Emoji(properties); + }; + + /** + * Encodes the specified Emoji message. Does not implicitly {@link google.chat.v1.Emoji.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Emoji + * @static + * @param {google.chat.v1.IEmoji} message Emoji message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Emoji.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unicode != null && Object.hasOwnProperty.call(message, "unicode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.unicode); + if (message.customEmoji != null && Object.hasOwnProperty.call(message, "customEmoji")) + $root.google.chat.v1.CustomEmoji.encode(message.customEmoji, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Emoji message, length delimited. Does not implicitly {@link google.chat.v1.Emoji.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Emoji + * @static + * @param {google.chat.v1.IEmoji} message Emoji message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Emoji.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Emoji message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Emoji + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Emoji} Emoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Emoji.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Emoji(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.unicode = reader.string(); + break; + } + case 2: { + message.customEmoji = $root.google.chat.v1.CustomEmoji.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Emoji message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Emoji + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Emoji} Emoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Emoji.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Emoji message. + * @function verify + * @memberof google.chat.v1.Emoji + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Emoji.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.unicode != null && message.hasOwnProperty("unicode")) { + properties.content = 1; + if (!$util.isString(message.unicode)) + return "unicode: string expected"; + } + if (message.customEmoji != null && message.hasOwnProperty("customEmoji")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + { + var error = $root.google.chat.v1.CustomEmoji.verify(message.customEmoji); + if (error) + return "customEmoji." + error; + } + } + return null; + }; + + /** + * Creates an Emoji message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Emoji + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Emoji} Emoji + */ + Emoji.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Emoji) + return object; + var message = new $root.google.chat.v1.Emoji(); + if (object.unicode != null) + message.unicode = String(object.unicode); + if (object.customEmoji != null) { + if (typeof object.customEmoji !== "object") + throw TypeError(".google.chat.v1.Emoji.customEmoji: object expected"); + message.customEmoji = $root.google.chat.v1.CustomEmoji.fromObject(object.customEmoji); + } + return message; + }; + + /** + * Creates a plain object from an Emoji message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Emoji + * @static + * @param {google.chat.v1.Emoji} message Emoji + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Emoji.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.unicode != null && message.hasOwnProperty("unicode")) { + object.unicode = message.unicode; + if (options.oneofs) + object.content = "unicode"; + } + if (message.customEmoji != null && message.hasOwnProperty("customEmoji")) { + object.customEmoji = $root.google.chat.v1.CustomEmoji.toObject(message.customEmoji, options); + if (options.oneofs) + object.content = "customEmoji"; + } + return object; + }; + + /** + * Converts this Emoji to JSON. + * @function toJSON + * @memberof google.chat.v1.Emoji + * @instance + * @returns {Object.} JSON object + */ + Emoji.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Emoji + * @function getTypeUrl + * @memberof google.chat.v1.Emoji + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Emoji.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Emoji"; + }; + + return Emoji; + })(); + + v1.CustomEmoji = (function() { + + /** + * Properties of a CustomEmoji. + * @memberof google.chat.v1 + * @interface ICustomEmoji + * @property {string|null} [uid] CustomEmoji uid + */ + + /** + * Constructs a new CustomEmoji. + * @memberof google.chat.v1 + * @classdesc Represents a CustomEmoji. + * @implements ICustomEmoji + * @constructor + * @param {google.chat.v1.ICustomEmoji=} [properties] Properties to set + */ + function CustomEmoji(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomEmoji uid. + * @member {string} uid + * @memberof google.chat.v1.CustomEmoji + * @instance + */ + CustomEmoji.prototype.uid = ""; + + /** + * Creates a new CustomEmoji instance using the specified properties. + * @function create + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {google.chat.v1.ICustomEmoji=} [properties] Properties to set + * @returns {google.chat.v1.CustomEmoji} CustomEmoji instance + */ + CustomEmoji.create = function create(properties) { + return new CustomEmoji(properties); + }; + + /** + * Encodes the specified CustomEmoji message. Does not implicitly {@link google.chat.v1.CustomEmoji.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {google.chat.v1.ICustomEmoji} message CustomEmoji message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomEmoji.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uid); + return writer; + }; + + /** + * Encodes the specified CustomEmoji message, length delimited. Does not implicitly {@link google.chat.v1.CustomEmoji.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {google.chat.v1.ICustomEmoji} message CustomEmoji message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomEmoji.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomEmoji message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CustomEmoji} CustomEmoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomEmoji.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CustomEmoji(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uid = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomEmoji message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CustomEmoji} CustomEmoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomEmoji.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomEmoji message. + * @function verify + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomEmoji.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + return null; + }; + + /** + * Creates a CustomEmoji message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CustomEmoji} CustomEmoji + */ + CustomEmoji.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CustomEmoji) + return object; + var message = new $root.google.chat.v1.CustomEmoji(); + if (object.uid != null) + message.uid = String(object.uid); + return message; + }; + + /** + * Creates a plain object from a CustomEmoji message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {google.chat.v1.CustomEmoji} message CustomEmoji + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomEmoji.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uid = ""; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + return object; + }; + + /** + * Converts this CustomEmoji to JSON. + * @function toJSON + * @memberof google.chat.v1.CustomEmoji + * @instance + * @returns {Object.} JSON object + */ + CustomEmoji.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomEmoji + * @function getTypeUrl + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomEmoji.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CustomEmoji"; + }; + + return CustomEmoji; + })(); + + v1.EmojiReactionSummary = (function() { + + /** + * Properties of an EmojiReactionSummary. + * @memberof google.chat.v1 + * @interface IEmojiReactionSummary + * @property {google.chat.v1.IEmoji|null} [emoji] EmojiReactionSummary emoji + * @property {number|null} [reactionCount] EmojiReactionSummary reactionCount + */ + + /** + * Constructs a new EmojiReactionSummary. + * @memberof google.chat.v1 + * @classdesc Represents an EmojiReactionSummary. + * @implements IEmojiReactionSummary + * @constructor + * @param {google.chat.v1.IEmojiReactionSummary=} [properties] Properties to set + */ + function EmojiReactionSummary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmojiReactionSummary emoji. + * @member {google.chat.v1.IEmoji|null|undefined} emoji + * @memberof google.chat.v1.EmojiReactionSummary + * @instance + */ + EmojiReactionSummary.prototype.emoji = null; + + /** + * EmojiReactionSummary reactionCount. + * @member {number|null|undefined} reactionCount + * @memberof google.chat.v1.EmojiReactionSummary + * @instance + */ + EmojiReactionSummary.prototype.reactionCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EmojiReactionSummary _reactionCount. + * @member {"reactionCount"|undefined} _reactionCount + * @memberof google.chat.v1.EmojiReactionSummary + * @instance + */ + Object.defineProperty(EmojiReactionSummary.prototype, "_reactionCount", { + get: $util.oneOfGetter($oneOfFields = ["reactionCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EmojiReactionSummary instance using the specified properties. + * @function create + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {google.chat.v1.IEmojiReactionSummary=} [properties] Properties to set + * @returns {google.chat.v1.EmojiReactionSummary} EmojiReactionSummary instance + */ + EmojiReactionSummary.create = function create(properties) { + return new EmojiReactionSummary(properties); + }; + + /** + * Encodes the specified EmojiReactionSummary message. Does not implicitly {@link google.chat.v1.EmojiReactionSummary.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {google.chat.v1.IEmojiReactionSummary} message EmojiReactionSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmojiReactionSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.emoji != null && Object.hasOwnProperty.call(message, "emoji")) + $root.google.chat.v1.Emoji.encode(message.emoji, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.reactionCount != null && Object.hasOwnProperty.call(message, "reactionCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reactionCount); + return writer; + }; + + /** + * Encodes the specified EmojiReactionSummary message, length delimited. Does not implicitly {@link google.chat.v1.EmojiReactionSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {google.chat.v1.IEmojiReactionSummary} message EmojiReactionSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmojiReactionSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmojiReactionSummary message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.EmojiReactionSummary} EmojiReactionSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmojiReactionSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.EmojiReactionSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.emoji = $root.google.chat.v1.Emoji.decode(reader, reader.uint32()); + break; + } + case 2: { + message.reactionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmojiReactionSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.EmojiReactionSummary} EmojiReactionSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmojiReactionSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmojiReactionSummary message. + * @function verify + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmojiReactionSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.emoji != null && message.hasOwnProperty("emoji")) { + var error = $root.google.chat.v1.Emoji.verify(message.emoji); + if (error) + return "emoji." + error; + } + if (message.reactionCount != null && message.hasOwnProperty("reactionCount")) { + properties._reactionCount = 1; + if (!$util.isInteger(message.reactionCount)) + return "reactionCount: integer expected"; + } + return null; + }; + + /** + * Creates an EmojiReactionSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.EmojiReactionSummary} EmojiReactionSummary + */ + EmojiReactionSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.EmojiReactionSummary) + return object; + var message = new $root.google.chat.v1.EmojiReactionSummary(); + if (object.emoji != null) { + if (typeof object.emoji !== "object") + throw TypeError(".google.chat.v1.EmojiReactionSummary.emoji: object expected"); + message.emoji = $root.google.chat.v1.Emoji.fromObject(object.emoji); + } + if (object.reactionCount != null) + message.reactionCount = object.reactionCount | 0; + return message; + }; + + /** + * Creates a plain object from an EmojiReactionSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {google.chat.v1.EmojiReactionSummary} message EmojiReactionSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmojiReactionSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.emoji = null; + if (message.emoji != null && message.hasOwnProperty("emoji")) + object.emoji = $root.google.chat.v1.Emoji.toObject(message.emoji, options); + if (message.reactionCount != null && message.hasOwnProperty("reactionCount")) { + object.reactionCount = message.reactionCount; + if (options.oneofs) + object._reactionCount = "reactionCount"; + } + return object; + }; + + /** + * Converts this EmojiReactionSummary to JSON. + * @function toJSON + * @memberof google.chat.v1.EmojiReactionSummary + * @instance + * @returns {Object.} JSON object + */ + EmojiReactionSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmojiReactionSummary + * @function getTypeUrl + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmojiReactionSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.EmojiReactionSummary"; + }; + + return EmojiReactionSummary; + })(); + + v1.CreateReactionRequest = (function() { + + /** + * Properties of a CreateReactionRequest. + * @memberof google.chat.v1 + * @interface ICreateReactionRequest + * @property {string|null} [parent] CreateReactionRequest parent + * @property {google.chat.v1.IReaction|null} [reaction] CreateReactionRequest reaction + */ + + /** + * Constructs a new CreateReactionRequest. + * @memberof google.chat.v1 + * @classdesc Represents a CreateReactionRequest. + * @implements ICreateReactionRequest + * @constructor + * @param {google.chat.v1.ICreateReactionRequest=} [properties] Properties to set + */ + function CreateReactionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateReactionRequest parent. + * @member {string} parent + * @memberof google.chat.v1.CreateReactionRequest + * @instance + */ + CreateReactionRequest.prototype.parent = ""; + + /** + * CreateReactionRequest reaction. + * @member {google.chat.v1.IReaction|null|undefined} reaction + * @memberof google.chat.v1.CreateReactionRequest + * @instance + */ + CreateReactionRequest.prototype.reaction = null; + + /** + * Creates a new CreateReactionRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {google.chat.v1.ICreateReactionRequest=} [properties] Properties to set + * @returns {google.chat.v1.CreateReactionRequest} CreateReactionRequest instance + */ + CreateReactionRequest.create = function create(properties) { + return new CreateReactionRequest(properties); + }; + + /** + * Encodes the specified CreateReactionRequest message. Does not implicitly {@link google.chat.v1.CreateReactionRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {google.chat.v1.ICreateReactionRequest} message CreateReactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReactionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.reaction != null && Object.hasOwnProperty.call(message, "reaction")) + $root.google.chat.v1.Reaction.encode(message.reaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateReactionRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateReactionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {google.chat.v1.ICreateReactionRequest} message CreateReactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReactionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateReactionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CreateReactionRequest} CreateReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReactionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CreateReactionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.reaction = $root.google.chat.v1.Reaction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateReactionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CreateReactionRequest} CreateReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReactionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateReactionRequest message. + * @function verify + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateReactionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.reaction != null && message.hasOwnProperty("reaction")) { + var error = $root.google.chat.v1.Reaction.verify(message.reaction); + if (error) + return "reaction." + error; + } + return null; + }; + + /** + * Creates a CreateReactionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CreateReactionRequest} CreateReactionRequest + */ + CreateReactionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CreateReactionRequest) + return object; + var message = new $root.google.chat.v1.CreateReactionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.reaction != null) { + if (typeof object.reaction !== "object") + throw TypeError(".google.chat.v1.CreateReactionRequest.reaction: object expected"); + message.reaction = $root.google.chat.v1.Reaction.fromObject(object.reaction); + } + return message; + }; + + /** + * Creates a plain object from a CreateReactionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {google.chat.v1.CreateReactionRequest} message CreateReactionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateReactionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.reaction = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.reaction != null && message.hasOwnProperty("reaction")) + object.reaction = $root.google.chat.v1.Reaction.toObject(message.reaction, options); + return object; + }; + + /** + * Converts this CreateReactionRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.CreateReactionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateReactionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateReactionRequest + * @function getTypeUrl + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateReactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CreateReactionRequest"; + }; + + return CreateReactionRequest; + })(); + + v1.ListReactionsRequest = (function() { + + /** + * Properties of a ListReactionsRequest. + * @memberof google.chat.v1 + * @interface IListReactionsRequest + * @property {string|null} [parent] ListReactionsRequest parent + * @property {number|null} [pageSize] ListReactionsRequest pageSize + * @property {string|null} [pageToken] ListReactionsRequest pageToken + * @property {string|null} [filter] ListReactionsRequest filter + */ + + /** + * Constructs a new ListReactionsRequest. + * @memberof google.chat.v1 + * @classdesc Represents a ListReactionsRequest. + * @implements IListReactionsRequest + * @constructor + * @param {google.chat.v1.IListReactionsRequest=} [properties] Properties to set + */ + function ListReactionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReactionsRequest parent. + * @member {string} parent + * @memberof google.chat.v1.ListReactionsRequest + * @instance + */ + ListReactionsRequest.prototype.parent = ""; + + /** + * ListReactionsRequest pageSize. + * @member {number} pageSize + * @memberof google.chat.v1.ListReactionsRequest + * @instance + */ + ListReactionsRequest.prototype.pageSize = 0; + + /** + * ListReactionsRequest pageToken. + * @member {string} pageToken + * @memberof google.chat.v1.ListReactionsRequest + * @instance + */ + ListReactionsRequest.prototype.pageToken = ""; + + /** + * ListReactionsRequest filter. + * @member {string} filter + * @memberof google.chat.v1.ListReactionsRequest + * @instance + */ + ListReactionsRequest.prototype.filter = ""; + + /** + * Creates a new ListReactionsRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {google.chat.v1.IListReactionsRequest=} [properties] Properties to set + * @returns {google.chat.v1.ListReactionsRequest} ListReactionsRequest instance + */ + ListReactionsRequest.create = function create(properties) { + return new ListReactionsRequest(properties); + }; + + /** + * Encodes the specified ListReactionsRequest message. Does not implicitly {@link google.chat.v1.ListReactionsRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {google.chat.v1.IListReactionsRequest} message ListReactionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReactionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListReactionsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListReactionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {google.chat.v1.IListReactionsRequest} message ListReactionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReactionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReactionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListReactionsRequest} ListReactionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReactionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListReactionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReactionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListReactionsRequest} ListReactionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReactionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReactionsRequest message. + * @function verify + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReactionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListReactionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListReactionsRequest} ListReactionsRequest + */ + ListReactionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListReactionsRequest) + return object; + var message = new $root.google.chat.v1.ListReactionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListReactionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {google.chat.v1.ListReactionsRequest} message ListReactionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReactionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListReactionsRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.ListReactionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListReactionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReactionsRequest + * @function getTypeUrl + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReactionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListReactionsRequest"; + }; + + return ListReactionsRequest; + })(); + + v1.ListReactionsResponse = (function() { + + /** + * Properties of a ListReactionsResponse. + * @memberof google.chat.v1 + * @interface IListReactionsResponse + * @property {Array.|null} [reactions] ListReactionsResponse reactions + * @property {string|null} [nextPageToken] ListReactionsResponse nextPageToken + */ + + /** + * Constructs a new ListReactionsResponse. + * @memberof google.chat.v1 + * @classdesc Represents a ListReactionsResponse. + * @implements IListReactionsResponse + * @constructor + * @param {google.chat.v1.IListReactionsResponse=} [properties] Properties to set + */ + function ListReactionsResponse(properties) { + this.reactions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReactionsResponse reactions. + * @member {Array.} reactions + * @memberof google.chat.v1.ListReactionsResponse + * @instance + */ + ListReactionsResponse.prototype.reactions = $util.emptyArray; + + /** + * ListReactionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.chat.v1.ListReactionsResponse + * @instance + */ + ListReactionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListReactionsResponse instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListReactionsResponse + * @static + * @param {google.chat.v1.IListReactionsResponse=} [properties] Properties to set + * @returns {google.chat.v1.ListReactionsResponse} ListReactionsResponse instance + */ + ListReactionsResponse.create = function create(properties) { + return new ListReactionsResponse(properties); + }; + + /** + * Encodes the specified ListReactionsResponse message. Does not implicitly {@link google.chat.v1.ListReactionsResponse.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListReactionsResponse + * @static + * @param {google.chat.v1.IListReactionsResponse} message ListReactionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReactionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reactions != null && message.reactions.length) + for (var i = 0; i < message.reactions.length; ++i) + $root.google.chat.v1.Reaction.encode(message.reactions[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 ListReactionsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListReactionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListReactionsResponse + * @static + * @param {google.chat.v1.IListReactionsResponse} message ListReactionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReactionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReactionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListReactionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListReactionsResponse} ListReactionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReactionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListReactionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.reactions && message.reactions.length)) + message.reactions = []; + message.reactions.push($root.google.chat.v1.Reaction.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReactionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListReactionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListReactionsResponse} ListReactionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReactionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReactionsResponse message. + * @function verify + * @memberof google.chat.v1.ListReactionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReactionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reactions != null && message.hasOwnProperty("reactions")) { + if (!Array.isArray(message.reactions)) + return "reactions: array expected"; + for (var i = 0; i < message.reactions.length; ++i) { + var error = $root.google.chat.v1.Reaction.verify(message.reactions[i]); + if (error) + return "reactions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListReactionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListReactionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListReactionsResponse} ListReactionsResponse + */ + ListReactionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListReactionsResponse) + return object; + var message = new $root.google.chat.v1.ListReactionsResponse(); + if (object.reactions) { + if (!Array.isArray(object.reactions)) + throw TypeError(".google.chat.v1.ListReactionsResponse.reactions: array expected"); + message.reactions = []; + for (var i = 0; i < object.reactions.length; ++i) { + if (typeof object.reactions[i] !== "object") + throw TypeError(".google.chat.v1.ListReactionsResponse.reactions: object expected"); + message.reactions[i] = $root.google.chat.v1.Reaction.fromObject(object.reactions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListReactionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListReactionsResponse + * @static + * @param {google.chat.v1.ListReactionsResponse} message ListReactionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReactionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reactions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.reactions && message.reactions.length) { + object.reactions = []; + for (var j = 0; j < message.reactions.length; ++j) + object.reactions[j] = $root.google.chat.v1.Reaction.toObject(message.reactions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListReactionsResponse to JSON. + * @function toJSON + * @memberof google.chat.v1.ListReactionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListReactionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReactionsResponse + * @function getTypeUrl + * @memberof google.chat.v1.ListReactionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReactionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListReactionsResponse"; + }; + + return ListReactionsResponse; + })(); + + v1.DeleteReactionRequest = (function() { + + /** + * Properties of a DeleteReactionRequest. + * @memberof google.chat.v1 + * @interface IDeleteReactionRequest + * @property {string|null} [name] DeleteReactionRequest name + */ + + /** + * Constructs a new DeleteReactionRequest. + * @memberof google.chat.v1 + * @classdesc Represents a DeleteReactionRequest. + * @implements IDeleteReactionRequest + * @constructor + * @param {google.chat.v1.IDeleteReactionRequest=} [properties] Properties to set + */ + function DeleteReactionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteReactionRequest name. + * @member {string} name + * @memberof google.chat.v1.DeleteReactionRequest + * @instance + */ + DeleteReactionRequest.prototype.name = ""; + + /** + * Creates a new DeleteReactionRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.DeleteReactionRequest + * @static + * @param {google.chat.v1.IDeleteReactionRequest=} [properties] Properties to set + * @returns {google.chat.v1.DeleteReactionRequest} DeleteReactionRequest instance + */ + DeleteReactionRequest.create = function create(properties) { + return new DeleteReactionRequest(properties); + }; + + /** + * Encodes the specified DeleteReactionRequest message. Does not implicitly {@link google.chat.v1.DeleteReactionRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.DeleteReactionRequest + * @static + * @param {google.chat.v1.IDeleteReactionRequest} message DeleteReactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReactionRequest.encode = function encode(message, writer) { + 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 DeleteReactionRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteReactionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.DeleteReactionRequest + * @static + * @param {google.chat.v1.IDeleteReactionRequest} message DeleteReactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReactionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteReactionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.DeleteReactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.DeleteReactionRequest} DeleteReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReactionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeleteReactionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteReactionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.DeleteReactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.DeleteReactionRequest} DeleteReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReactionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteReactionRequest message. + * @function verify + * @memberof google.chat.v1.DeleteReactionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteReactionRequest.verify = function verify(message) { + if (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 DeleteReactionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.DeleteReactionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.DeleteReactionRequest} DeleteReactionRequest + */ + DeleteReactionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DeleteReactionRequest) + return object; + var message = new $root.google.chat.v1.DeleteReactionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteReactionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.DeleteReactionRequest + * @static + * @param {google.chat.v1.DeleteReactionRequest} message DeleteReactionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteReactionRequest.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 DeleteReactionRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.DeleteReactionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteReactionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteReactionRequest + * @function getTypeUrl + * @memberof google.chat.v1.DeleteReactionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteReactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.DeleteReactionRequest"; + }; + + return DeleteReactionRequest; + })(); + + v1.SlashCommand = (function() { + + /** + * Properties of a SlashCommand. + * @memberof google.chat.v1 + * @interface ISlashCommand + * @property {number|Long|null} [commandId] SlashCommand commandId + */ + + /** + * Constructs a new SlashCommand. + * @memberof google.chat.v1 + * @classdesc Represents a SlashCommand. + * @implements ISlashCommand + * @constructor + * @param {google.chat.v1.ISlashCommand=} [properties] Properties to set + */ + function SlashCommand(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SlashCommand commandId. + * @member {number|Long} commandId + * @memberof google.chat.v1.SlashCommand + * @instance + */ + SlashCommand.prototype.commandId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SlashCommand instance using the specified properties. + * @function create + * @memberof google.chat.v1.SlashCommand + * @static + * @param {google.chat.v1.ISlashCommand=} [properties] Properties to set + * @returns {google.chat.v1.SlashCommand} SlashCommand instance + */ + SlashCommand.create = function create(properties) { + return new SlashCommand(properties); + }; + + /** + * Encodes the specified SlashCommand message. Does not implicitly {@link google.chat.v1.SlashCommand.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.SlashCommand + * @static + * @param {google.chat.v1.ISlashCommand} message SlashCommand message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlashCommand.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commandId != null && Object.hasOwnProperty.call(message, "commandId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.commandId); + return writer; + }; + + /** + * Encodes the specified SlashCommand message, length delimited. Does not implicitly {@link google.chat.v1.SlashCommand.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.SlashCommand + * @static + * @param {google.chat.v1.ISlashCommand} message SlashCommand message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlashCommand.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SlashCommand message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.SlashCommand + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.SlashCommand} SlashCommand + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlashCommand.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SlashCommand(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.commandId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SlashCommand message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.SlashCommand + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.SlashCommand} SlashCommand + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlashCommand.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SlashCommand message. + * @function verify + * @memberof google.chat.v1.SlashCommand + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SlashCommand.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commandId != null && message.hasOwnProperty("commandId")) + if (!$util.isInteger(message.commandId) && !(message.commandId && $util.isInteger(message.commandId.low) && $util.isInteger(message.commandId.high))) + return "commandId: integer|Long expected"; + return null; + }; + + /** + * Creates a SlashCommand message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.SlashCommand + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.SlashCommand} SlashCommand + */ + SlashCommand.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SlashCommand) + return object; + var message = new $root.google.chat.v1.SlashCommand(); + if (object.commandId != null) + if ($util.Long) + (message.commandId = $util.Long.fromValue(object.commandId)).unsigned = false; + else if (typeof object.commandId === "string") + message.commandId = parseInt(object.commandId, 10); + else if (typeof object.commandId === "number") + message.commandId = object.commandId; + else if (typeof object.commandId === "object") + message.commandId = new $util.LongBits(object.commandId.low >>> 0, object.commandId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SlashCommand message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.SlashCommand + * @static + * @param {google.chat.v1.SlashCommand} message SlashCommand + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SlashCommand.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.commandId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.commandId = options.longs === String ? "0" : 0; + if (message.commandId != null && message.hasOwnProperty("commandId")) + if (typeof message.commandId === "number") + object.commandId = options.longs === String ? String(message.commandId) : message.commandId; + else + object.commandId = options.longs === String ? $util.Long.prototype.toString.call(message.commandId) : options.longs === Number ? new $util.LongBits(message.commandId.low >>> 0, message.commandId.high >>> 0).toNumber() : message.commandId; + return object; + }; + + /** + * Converts this SlashCommand to JSON. + * @function toJSON + * @memberof google.chat.v1.SlashCommand + * @instance + * @returns {Object.} JSON object + */ + SlashCommand.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SlashCommand + * @function getTypeUrl + * @memberof google.chat.v1.SlashCommand + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SlashCommand.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.SlashCommand"; + }; + + return SlashCommand; + })(); + + v1.Space = (function() { + + /** + * Properties of a Space. + * @memberof google.chat.v1 + * @interface ISpace + * @property {string|null} [name] Space name + * @property {google.chat.v1.Space.Type|null} [type] Space type + * @property {google.chat.v1.Space.SpaceType|null} [spaceType] Space spaceType + * @property {boolean|null} [singleUserBotDm] Space singleUserBotDm + * @property {boolean|null} [threaded] Space threaded + * @property {string|null} [displayName] Space displayName + * @property {boolean|null} [externalUserAllowed] Space externalUserAllowed + * @property {google.chat.v1.Space.SpaceThreadingState|null} [spaceThreadingState] Space spaceThreadingState + * @property {google.chat.v1.Space.ISpaceDetails|null} [spaceDetails] Space spaceDetails + * @property {google.chat.v1.HistoryState|null} [spaceHistoryState] Space spaceHistoryState + * @property {boolean|null} [importMode] Space importMode + * @property {google.protobuf.ITimestamp|null} [createTime] Space createTime + * @property {google.protobuf.ITimestamp|null} [lastActiveTime] Space lastActiveTime + * @property {boolean|null} [adminInstalled] Space adminInstalled + * @property {google.chat.v1.Space.IMembershipCount|null} [membershipCount] Space membershipCount + * @property {google.chat.v1.Space.IAccessSettings|null} [accessSettings] Space accessSettings + * @property {string|null} [spaceUri] Space spaceUri + */ + + /** + * Constructs a new Space. + * @memberof google.chat.v1 + * @classdesc Represents a Space. + * @implements ISpace + * @constructor + * @param {google.chat.v1.ISpace=} [properties] Properties to set + */ + function Space(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Space name. + * @member {string} name + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.name = ""; + + /** + * Space type. + * @member {google.chat.v1.Space.Type} type + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.type = 0; + + /** + * Space spaceType. + * @member {google.chat.v1.Space.SpaceType} spaceType + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.spaceType = 0; + + /** + * Space singleUserBotDm. + * @member {boolean} singleUserBotDm + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.singleUserBotDm = false; + + /** + * Space threaded. + * @member {boolean} threaded + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.threaded = false; + + /** + * Space displayName. + * @member {string} displayName + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.displayName = ""; + + /** + * Space externalUserAllowed. + * @member {boolean} externalUserAllowed + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.externalUserAllowed = false; + + /** + * Space spaceThreadingState. + * @member {google.chat.v1.Space.SpaceThreadingState} spaceThreadingState + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.spaceThreadingState = 0; + + /** + * Space spaceDetails. + * @member {google.chat.v1.Space.ISpaceDetails|null|undefined} spaceDetails + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.spaceDetails = null; + + /** + * Space spaceHistoryState. + * @member {google.chat.v1.HistoryState} spaceHistoryState + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.spaceHistoryState = 0; + + /** + * Space importMode. + * @member {boolean} importMode + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.importMode = false; + + /** + * Space createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.createTime = null; + + /** + * Space lastActiveTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastActiveTime + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.lastActiveTime = null; + + /** + * Space adminInstalled. + * @member {boolean} adminInstalled + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.adminInstalled = false; + + /** + * Space membershipCount. + * @member {google.chat.v1.Space.IMembershipCount|null|undefined} membershipCount + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.membershipCount = null; + + /** + * Space accessSettings. + * @member {google.chat.v1.Space.IAccessSettings|null|undefined} accessSettings + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.accessSettings = null; + + /** + * Space spaceUri. + * @member {string} spaceUri + * @memberof google.chat.v1.Space + * @instance + */ + Space.prototype.spaceUri = ""; + + /** + * Creates a new Space instance using the specified properties. + * @function create + * @memberof google.chat.v1.Space + * @static + * @param {google.chat.v1.ISpace=} [properties] Properties to set + * @returns {google.chat.v1.Space} Space instance + */ + Space.create = function create(properties) { + return new Space(properties); + }; + + /** + * Encodes the specified Space message. Does not implicitly {@link google.chat.v1.Space.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Space + * @static + * @param {google.chat.v1.ISpace} message Space message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Space.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.singleUserBotDm != null && Object.hasOwnProperty.call(message, "singleUserBotDm")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.singleUserBotDm); + if (message.threaded != null && Object.hasOwnProperty.call(message, "threaded")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.threaded); + if (message.externalUserAllowed != null && Object.hasOwnProperty.call(message, "externalUserAllowed")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.externalUserAllowed); + if (message.spaceThreadingState != null && Object.hasOwnProperty.call(message, "spaceThreadingState")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.spaceThreadingState); + if (message.spaceType != null && Object.hasOwnProperty.call(message, "spaceType")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.spaceType); + if (message.spaceDetails != null && Object.hasOwnProperty.call(message, "spaceDetails")) + $root.google.chat.v1.Space.SpaceDetails.encode(message.spaceDetails, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.spaceHistoryState != null && Object.hasOwnProperty.call(message, "spaceHistoryState")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.spaceHistoryState); + if (message.importMode != null && Object.hasOwnProperty.call(message, "importMode")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.importMode); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.lastActiveTime != null && Object.hasOwnProperty.call(message, "lastActiveTime")) + $root.google.protobuf.Timestamp.encode(message.lastActiveTime, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.adminInstalled != null && Object.hasOwnProperty.call(message, "adminInstalled")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.adminInstalled); + if (message.membershipCount != null && Object.hasOwnProperty.call(message, "membershipCount")) + $root.google.chat.v1.Space.MembershipCount.encode(message.membershipCount, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.accessSettings != null && Object.hasOwnProperty.call(message, "accessSettings")) + $root.google.chat.v1.Space.AccessSettings.encode(message.accessSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.spaceUri != null && Object.hasOwnProperty.call(message, "spaceUri")) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.spaceUri); + return writer; + }; + + /** + * Encodes the specified Space message, length delimited. Does not implicitly {@link google.chat.v1.Space.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Space + * @static + * @param {google.chat.v1.ISpace} message Space message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Space.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Space message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Space + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Space} Space + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Space.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Space(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 10: { + message.spaceType = reader.int32(); + break; + } + case 4: { + message.singleUserBotDm = reader.bool(); + break; + } + case 5: { + message.threaded = reader.bool(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 8: { + message.externalUserAllowed = reader.bool(); + break; + } + case 9: { + message.spaceThreadingState = reader.int32(); + break; + } + case 11: { + message.spaceDetails = $root.google.chat.v1.Space.SpaceDetails.decode(reader, reader.uint32()); + break; + } + case 13: { + message.spaceHistoryState = reader.int32(); + break; + } + case 16: { + message.importMode = reader.bool(); + break; + } + case 17: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 18: { + message.lastActiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 19: { + message.adminInstalled = reader.bool(); + break; + } + case 20: { + message.membershipCount = $root.google.chat.v1.Space.MembershipCount.decode(reader, reader.uint32()); + break; + } + case 23: { + message.accessSettings = $root.google.chat.v1.Space.AccessSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.spaceUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Space message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Space + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Space} Space + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Space.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Space message. + * @function verify + * @memberof google.chat.v1.Space + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Space.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.spaceType != null && message.hasOwnProperty("spaceType")) + switch (message.spaceType) { + default: + return "spaceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.singleUserBotDm != null && message.hasOwnProperty("singleUserBotDm")) + if (typeof message.singleUserBotDm !== "boolean") + return "singleUserBotDm: boolean expected"; + if (message.threaded != null && message.hasOwnProperty("threaded")) + if (typeof message.threaded !== "boolean") + return "threaded: boolean expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.externalUserAllowed != null && message.hasOwnProperty("externalUserAllowed")) + if (typeof message.externalUserAllowed !== "boolean") + return "externalUserAllowed: boolean expected"; + if (message.spaceThreadingState != null && message.hasOwnProperty("spaceThreadingState")) + switch (message.spaceThreadingState) { + default: + return "spaceThreadingState: enum value expected"; + case 0: + case 2: + case 3: + case 4: + break; + } + if (message.spaceDetails != null && message.hasOwnProperty("spaceDetails")) { + var error = $root.google.chat.v1.Space.SpaceDetails.verify(message.spaceDetails); + if (error) + return "spaceDetails." + error; + } + if (message.spaceHistoryState != null && message.hasOwnProperty("spaceHistoryState")) + switch (message.spaceHistoryState) { + default: + return "spaceHistoryState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.importMode != null && message.hasOwnProperty("importMode")) + if (typeof message.importMode !== "boolean") + return "importMode: boolean expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.lastActiveTime != null && message.hasOwnProperty("lastActiveTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastActiveTime); + if (error) + return "lastActiveTime." + error; + } + if (message.adminInstalled != null && message.hasOwnProperty("adminInstalled")) + if (typeof message.adminInstalled !== "boolean") + return "adminInstalled: boolean expected"; + if (message.membershipCount != null && message.hasOwnProperty("membershipCount")) { + var error = $root.google.chat.v1.Space.MembershipCount.verify(message.membershipCount); + if (error) + return "membershipCount." + error; + } + if (message.accessSettings != null && message.hasOwnProperty("accessSettings")) { + var error = $root.google.chat.v1.Space.AccessSettings.verify(message.accessSettings); + if (error) + return "accessSettings." + error; + } + if (message.spaceUri != null && message.hasOwnProperty("spaceUri")) + if (!$util.isString(message.spaceUri)) + return "spaceUri: string expected"; + return null; + }; + + /** + * Creates a Space message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Space + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Space} Space + */ + Space.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Space) + return object; + var message = new $root.google.chat.v1.Space(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ROOM": + case 1: + message.type = 1; + break; + case "DM": + case 2: + message.type = 2; + break; + } + switch (object.spaceType) { + default: + if (typeof object.spaceType === "number") { + message.spaceType = object.spaceType; + break; + } + break; + case "SPACE_TYPE_UNSPECIFIED": + case 0: + message.spaceType = 0; + break; + case "SPACE": + case 1: + message.spaceType = 1; + break; + case "GROUP_CHAT": + case 2: + message.spaceType = 2; + break; + case "DIRECT_MESSAGE": + case 3: + message.spaceType = 3; + break; + } + if (object.singleUserBotDm != null) + message.singleUserBotDm = Boolean(object.singleUserBotDm); + if (object.threaded != null) + message.threaded = Boolean(object.threaded); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.externalUserAllowed != null) + message.externalUserAllowed = Boolean(object.externalUserAllowed); + switch (object.spaceThreadingState) { + default: + if (typeof object.spaceThreadingState === "number") { + message.spaceThreadingState = object.spaceThreadingState; + break; + } + break; + case "SPACE_THREADING_STATE_UNSPECIFIED": + case 0: + message.spaceThreadingState = 0; + break; + case "THREADED_MESSAGES": + case 2: + message.spaceThreadingState = 2; + break; + case "GROUPED_MESSAGES": + case 3: + message.spaceThreadingState = 3; + break; + case "UNTHREADED_MESSAGES": + case 4: + message.spaceThreadingState = 4; + break; + } + if (object.spaceDetails != null) { + if (typeof object.spaceDetails !== "object") + throw TypeError(".google.chat.v1.Space.spaceDetails: object expected"); + message.spaceDetails = $root.google.chat.v1.Space.SpaceDetails.fromObject(object.spaceDetails); + } + switch (object.spaceHistoryState) { + default: + if (typeof object.spaceHistoryState === "number") { + message.spaceHistoryState = object.spaceHistoryState; + break; + } + break; + case "HISTORY_STATE_UNSPECIFIED": + case 0: + message.spaceHistoryState = 0; + break; + case "HISTORY_OFF": + case 1: + message.spaceHistoryState = 1; + break; + case "HISTORY_ON": + case 2: + message.spaceHistoryState = 2; + break; + } + if (object.importMode != null) + message.importMode = Boolean(object.importMode); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.chat.v1.Space.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.lastActiveTime != null) { + if (typeof object.lastActiveTime !== "object") + throw TypeError(".google.chat.v1.Space.lastActiveTime: object expected"); + message.lastActiveTime = $root.google.protobuf.Timestamp.fromObject(object.lastActiveTime); + } + if (object.adminInstalled != null) + message.adminInstalled = Boolean(object.adminInstalled); + if (object.membershipCount != null) { + if (typeof object.membershipCount !== "object") + throw TypeError(".google.chat.v1.Space.membershipCount: object expected"); + message.membershipCount = $root.google.chat.v1.Space.MembershipCount.fromObject(object.membershipCount); + } + if (object.accessSettings != null) { + if (typeof object.accessSettings !== "object") + throw TypeError(".google.chat.v1.Space.accessSettings: object expected"); + message.accessSettings = $root.google.chat.v1.Space.AccessSettings.fromObject(object.accessSettings); + } + if (object.spaceUri != null) + message.spaceUri = String(object.spaceUri); + return message; + }; + + /** + * Creates a plain object from a Space message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Space + * @static + * @param {google.chat.v1.Space} message Space + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Space.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.singleUserBotDm = false; + object.threaded = false; + object.externalUserAllowed = false; + object.spaceThreadingState = options.enums === String ? "SPACE_THREADING_STATE_UNSPECIFIED" : 0; + object.spaceType = options.enums === String ? "SPACE_TYPE_UNSPECIFIED" : 0; + object.spaceDetails = null; + object.spaceHistoryState = options.enums === String ? "HISTORY_STATE_UNSPECIFIED" : 0; + object.importMode = false; + object.createTime = null; + object.lastActiveTime = null; + object.adminInstalled = false; + object.membershipCount = null; + object.accessSettings = null; + object.spaceUri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.chat.v1.Space.Type[message.type] === undefined ? message.type : $root.google.chat.v1.Space.Type[message.type] : message.type; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.singleUserBotDm != null && message.hasOwnProperty("singleUserBotDm")) + object.singleUserBotDm = message.singleUserBotDm; + if (message.threaded != null && message.hasOwnProperty("threaded")) + object.threaded = message.threaded; + if (message.externalUserAllowed != null && message.hasOwnProperty("externalUserAllowed")) + object.externalUserAllowed = message.externalUserAllowed; + if (message.spaceThreadingState != null && message.hasOwnProperty("spaceThreadingState")) + object.spaceThreadingState = options.enums === String ? $root.google.chat.v1.Space.SpaceThreadingState[message.spaceThreadingState] === undefined ? message.spaceThreadingState : $root.google.chat.v1.Space.SpaceThreadingState[message.spaceThreadingState] : message.spaceThreadingState; + if (message.spaceType != null && message.hasOwnProperty("spaceType")) + object.spaceType = options.enums === String ? $root.google.chat.v1.Space.SpaceType[message.spaceType] === undefined ? message.spaceType : $root.google.chat.v1.Space.SpaceType[message.spaceType] : message.spaceType; + if (message.spaceDetails != null && message.hasOwnProperty("spaceDetails")) + object.spaceDetails = $root.google.chat.v1.Space.SpaceDetails.toObject(message.spaceDetails, options); + if (message.spaceHistoryState != null && message.hasOwnProperty("spaceHistoryState")) + object.spaceHistoryState = options.enums === String ? $root.google.chat.v1.HistoryState[message.spaceHistoryState] === undefined ? message.spaceHistoryState : $root.google.chat.v1.HistoryState[message.spaceHistoryState] : message.spaceHistoryState; + if (message.importMode != null && message.hasOwnProperty("importMode")) + object.importMode = message.importMode; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.lastActiveTime != null && message.hasOwnProperty("lastActiveTime")) + object.lastActiveTime = $root.google.protobuf.Timestamp.toObject(message.lastActiveTime, options); + if (message.adminInstalled != null && message.hasOwnProperty("adminInstalled")) + object.adminInstalled = message.adminInstalled; + if (message.membershipCount != null && message.hasOwnProperty("membershipCount")) + object.membershipCount = $root.google.chat.v1.Space.MembershipCount.toObject(message.membershipCount, options); + if (message.accessSettings != null && message.hasOwnProperty("accessSettings")) + object.accessSettings = $root.google.chat.v1.Space.AccessSettings.toObject(message.accessSettings, options); + if (message.spaceUri != null && message.hasOwnProperty("spaceUri")) + object.spaceUri = message.spaceUri; + return object; + }; + + /** + * Converts this Space to JSON. + * @function toJSON + * @memberof google.chat.v1.Space + * @instance + * @returns {Object.} JSON object + */ + Space.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Space + * @function getTypeUrl + * @memberof google.chat.v1.Space + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Space.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Space"; + }; + + /** + * Type enum. + * @name google.chat.v1.Space.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ROOM=1 ROOM value + * @property {number} DM=2 DM value + */ + Space.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ROOM"] = 1; + values[valuesById[2] = "DM"] = 2; + return values; + })(); + + /** + * SpaceType enum. + * @name google.chat.v1.Space.SpaceType + * @enum {number} + * @property {number} SPACE_TYPE_UNSPECIFIED=0 SPACE_TYPE_UNSPECIFIED value + * @property {number} SPACE=1 SPACE value + * @property {number} GROUP_CHAT=2 GROUP_CHAT value + * @property {number} DIRECT_MESSAGE=3 DIRECT_MESSAGE value + */ + Space.SpaceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPACE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SPACE"] = 1; + values[valuesById[2] = "GROUP_CHAT"] = 2; + values[valuesById[3] = "DIRECT_MESSAGE"] = 3; + return values; + })(); + + /** + * SpaceThreadingState enum. + * @name google.chat.v1.Space.SpaceThreadingState + * @enum {number} + * @property {number} SPACE_THREADING_STATE_UNSPECIFIED=0 SPACE_THREADING_STATE_UNSPECIFIED value + * @property {number} THREADED_MESSAGES=2 THREADED_MESSAGES value + * @property {number} GROUPED_MESSAGES=3 GROUPED_MESSAGES value + * @property {number} UNTHREADED_MESSAGES=4 UNTHREADED_MESSAGES value + */ + Space.SpaceThreadingState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPACE_THREADING_STATE_UNSPECIFIED"] = 0; + values[valuesById[2] = "THREADED_MESSAGES"] = 2; + values[valuesById[3] = "GROUPED_MESSAGES"] = 3; + values[valuesById[4] = "UNTHREADED_MESSAGES"] = 4; + return values; + })(); + + Space.SpaceDetails = (function() { + + /** + * Properties of a SpaceDetails. + * @memberof google.chat.v1.Space + * @interface ISpaceDetails + * @property {string|null} [description] SpaceDetails description + * @property {string|null} [guidelines] SpaceDetails guidelines + */ + + /** + * Constructs a new SpaceDetails. + * @memberof google.chat.v1.Space + * @classdesc Represents a SpaceDetails. + * @implements ISpaceDetails + * @constructor + * @param {google.chat.v1.Space.ISpaceDetails=} [properties] Properties to set + */ + function SpaceDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpaceDetails description. + * @member {string} description + * @memberof google.chat.v1.Space.SpaceDetails + * @instance + */ + SpaceDetails.prototype.description = ""; + + /** + * SpaceDetails guidelines. + * @member {string} guidelines + * @memberof google.chat.v1.Space.SpaceDetails + * @instance + */ + SpaceDetails.prototype.guidelines = ""; + + /** + * Creates a new SpaceDetails instance using the specified properties. + * @function create + * @memberof google.chat.v1.Space.SpaceDetails + * @static + * @param {google.chat.v1.Space.ISpaceDetails=} [properties] Properties to set + * @returns {google.chat.v1.Space.SpaceDetails} SpaceDetails instance + */ + SpaceDetails.create = function create(properties) { + return new SpaceDetails(properties); + }; + + /** + * Encodes the specified SpaceDetails message. Does not implicitly {@link google.chat.v1.Space.SpaceDetails.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Space.SpaceDetails + * @static + * @param {google.chat.v1.Space.ISpaceDetails} message SpaceDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpaceDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.guidelines != null && Object.hasOwnProperty.call(message, "guidelines")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.guidelines); + return writer; + }; + + /** + * Encodes the specified SpaceDetails message, length delimited. Does not implicitly {@link google.chat.v1.Space.SpaceDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Space.SpaceDetails + * @static + * @param {google.chat.v1.Space.ISpaceDetails} message SpaceDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpaceDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpaceDetails message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Space.SpaceDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Space.SpaceDetails} SpaceDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpaceDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Space.SpaceDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.guidelines = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpaceDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Space.SpaceDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Space.SpaceDetails} SpaceDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpaceDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpaceDetails message. + * @function verify + * @memberof google.chat.v1.Space.SpaceDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpaceDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.guidelines != null && message.hasOwnProperty("guidelines")) + if (!$util.isString(message.guidelines)) + return "guidelines: string expected"; + return null; + }; + + /** + * Creates a SpaceDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Space.SpaceDetails + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Space.SpaceDetails} SpaceDetails + */ + SpaceDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Space.SpaceDetails) + return object; + var message = new $root.google.chat.v1.Space.SpaceDetails(); + if (object.description != null) + message.description = String(object.description); + if (object.guidelines != null) + message.guidelines = String(object.guidelines); + return message; + }; + + /** + * Creates a plain object from a SpaceDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Space.SpaceDetails + * @static + * @param {google.chat.v1.Space.SpaceDetails} message SpaceDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpaceDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = ""; + object.guidelines = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.guidelines != null && message.hasOwnProperty("guidelines")) + object.guidelines = message.guidelines; + return object; + }; + + /** + * Converts this SpaceDetails to JSON. + * @function toJSON + * @memberof google.chat.v1.Space.SpaceDetails + * @instance + * @returns {Object.} JSON object + */ + SpaceDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpaceDetails + * @function getTypeUrl + * @memberof google.chat.v1.Space.SpaceDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpaceDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Space.SpaceDetails"; + }; + + return SpaceDetails; + })(); + + Space.MembershipCount = (function() { + + /** + * Properties of a MembershipCount. + * @memberof google.chat.v1.Space + * @interface IMembershipCount + * @property {number|null} [joinedDirectHumanUserCount] MembershipCount joinedDirectHumanUserCount + * @property {number|null} [joinedGroupCount] MembershipCount joinedGroupCount + */ + + /** + * Constructs a new MembershipCount. + * @memberof google.chat.v1.Space + * @classdesc Represents a MembershipCount. + * @implements IMembershipCount + * @constructor + * @param {google.chat.v1.Space.IMembershipCount=} [properties] Properties to set + */ + function MembershipCount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MembershipCount joinedDirectHumanUserCount. + * @member {number} joinedDirectHumanUserCount + * @memberof google.chat.v1.Space.MembershipCount + * @instance + */ + MembershipCount.prototype.joinedDirectHumanUserCount = 0; + + /** + * MembershipCount joinedGroupCount. + * @member {number} joinedGroupCount + * @memberof google.chat.v1.Space.MembershipCount + * @instance + */ + MembershipCount.prototype.joinedGroupCount = 0; + + /** + * Creates a new MembershipCount instance using the specified properties. + * @function create + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {google.chat.v1.Space.IMembershipCount=} [properties] Properties to set + * @returns {google.chat.v1.Space.MembershipCount} MembershipCount instance + */ + MembershipCount.create = function create(properties) { + return new MembershipCount(properties); + }; + + /** + * Encodes the specified MembershipCount message. Does not implicitly {@link google.chat.v1.Space.MembershipCount.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {google.chat.v1.Space.IMembershipCount} message MembershipCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.joinedDirectHumanUserCount != null && Object.hasOwnProperty.call(message, "joinedDirectHumanUserCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.joinedDirectHumanUserCount); + if (message.joinedGroupCount != null && Object.hasOwnProperty.call(message, "joinedGroupCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.joinedGroupCount); + return writer; + }; + + /** + * Encodes the specified MembershipCount message, length delimited. Does not implicitly {@link google.chat.v1.Space.MembershipCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {google.chat.v1.Space.IMembershipCount} message MembershipCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MembershipCount message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Space.MembershipCount} MembershipCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipCount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Space.MembershipCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.joinedDirectHumanUserCount = reader.int32(); + break; + } + case 5: { + message.joinedGroupCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MembershipCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Space.MembershipCount} MembershipCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MembershipCount message. + * @function verify + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MembershipCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.joinedDirectHumanUserCount != null && message.hasOwnProperty("joinedDirectHumanUserCount")) + if (!$util.isInteger(message.joinedDirectHumanUserCount)) + return "joinedDirectHumanUserCount: integer expected"; + if (message.joinedGroupCount != null && message.hasOwnProperty("joinedGroupCount")) + if (!$util.isInteger(message.joinedGroupCount)) + return "joinedGroupCount: integer expected"; + return null; + }; + + /** + * Creates a MembershipCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Space.MembershipCount} MembershipCount + */ + MembershipCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Space.MembershipCount) + return object; + var message = new $root.google.chat.v1.Space.MembershipCount(); + if (object.joinedDirectHumanUserCount != null) + message.joinedDirectHumanUserCount = object.joinedDirectHumanUserCount | 0; + if (object.joinedGroupCount != null) + message.joinedGroupCount = object.joinedGroupCount | 0; + return message; + }; + + /** + * Creates a plain object from a MembershipCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {google.chat.v1.Space.MembershipCount} message MembershipCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MembershipCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.joinedDirectHumanUserCount = 0; + object.joinedGroupCount = 0; + } + if (message.joinedDirectHumanUserCount != null && message.hasOwnProperty("joinedDirectHumanUserCount")) + object.joinedDirectHumanUserCount = message.joinedDirectHumanUserCount; + if (message.joinedGroupCount != null && message.hasOwnProperty("joinedGroupCount")) + object.joinedGroupCount = message.joinedGroupCount; + return object; + }; + + /** + * Converts this MembershipCount to JSON. + * @function toJSON + * @memberof google.chat.v1.Space.MembershipCount + * @instance + * @returns {Object.} JSON object + */ + MembershipCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MembershipCount + * @function getTypeUrl + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MembershipCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Space.MembershipCount"; + }; + + return MembershipCount; + })(); + + Space.AccessSettings = (function() { + + /** + * Properties of an AccessSettings. + * @memberof google.chat.v1.Space + * @interface IAccessSettings + * @property {google.chat.v1.Space.AccessSettings.AccessState|null} [accessState] AccessSettings accessState + * @property {string|null} [audience] AccessSettings audience + */ + + /** + * Constructs a new AccessSettings. + * @memberof google.chat.v1.Space + * @classdesc Represents an AccessSettings. + * @implements IAccessSettings + * @constructor + * @param {google.chat.v1.Space.IAccessSettings=} [properties] Properties to set + */ + function AccessSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessSettings accessState. + * @member {google.chat.v1.Space.AccessSettings.AccessState} accessState + * @memberof google.chat.v1.Space.AccessSettings + * @instance + */ + AccessSettings.prototype.accessState = 0; + + /** + * AccessSettings audience. + * @member {string} audience + * @memberof google.chat.v1.Space.AccessSettings + * @instance + */ + AccessSettings.prototype.audience = ""; + + /** + * Creates a new AccessSettings instance using the specified properties. + * @function create + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {google.chat.v1.Space.IAccessSettings=} [properties] Properties to set + * @returns {google.chat.v1.Space.AccessSettings} AccessSettings instance + */ + AccessSettings.create = function create(properties) { + return new AccessSettings(properties); + }; + + /** + * Encodes the specified AccessSettings message. Does not implicitly {@link google.chat.v1.Space.AccessSettings.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {google.chat.v1.Space.IAccessSettings} message AccessSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessState != null && Object.hasOwnProperty.call(message, "accessState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.accessState); + if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.audience); + return writer; + }; + + /** + * Encodes the specified AccessSettings message, length delimited. Does not implicitly {@link google.chat.v1.Space.AccessSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {google.chat.v1.Space.IAccessSettings} message AccessSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessSettings message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Space.AccessSettings} AccessSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Space.AccessSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accessState = reader.int32(); + break; + } + case 3: { + message.audience = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Space.AccessSettings} AccessSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessSettings message. + * @function verify + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accessState != null && message.hasOwnProperty("accessState")) + switch (message.accessState) { + default: + return "accessState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.audience != null && message.hasOwnProperty("audience")) + if (!$util.isString(message.audience)) + return "audience: string expected"; + return null; + }; + + /** + * Creates an AccessSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Space.AccessSettings} AccessSettings + */ + AccessSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Space.AccessSettings) + return object; + var message = new $root.google.chat.v1.Space.AccessSettings(); + switch (object.accessState) { + default: + if (typeof object.accessState === "number") { + message.accessState = object.accessState; + break; + } + break; + case "ACCESS_STATE_UNSPECIFIED": + case 0: + message.accessState = 0; + break; + case "PRIVATE": + case 1: + message.accessState = 1; + break; + case "DISCOVERABLE": + case 2: + message.accessState = 2; + break; + } + if (object.audience != null) + message.audience = String(object.audience); + return message; + }; + + /** + * Creates a plain object from an AccessSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {google.chat.v1.Space.AccessSettings} message AccessSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.accessState = options.enums === String ? "ACCESS_STATE_UNSPECIFIED" : 0; + object.audience = ""; + } + if (message.accessState != null && message.hasOwnProperty("accessState")) + object.accessState = options.enums === String ? $root.google.chat.v1.Space.AccessSettings.AccessState[message.accessState] === undefined ? message.accessState : $root.google.chat.v1.Space.AccessSettings.AccessState[message.accessState] : message.accessState; + if (message.audience != null && message.hasOwnProperty("audience")) + object.audience = message.audience; + return object; + }; + + /** + * Converts this AccessSettings to JSON. + * @function toJSON + * @memberof google.chat.v1.Space.AccessSettings + * @instance + * @returns {Object.} JSON object + */ + AccessSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessSettings + * @function getTypeUrl + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Space.AccessSettings"; + }; + + /** + * AccessState enum. + * @name google.chat.v1.Space.AccessSettings.AccessState + * @enum {number} + * @property {number} ACCESS_STATE_UNSPECIFIED=0 ACCESS_STATE_UNSPECIFIED value + * @property {number} PRIVATE=1 PRIVATE value + * @property {number} DISCOVERABLE=2 DISCOVERABLE value + */ + AccessSettings.AccessState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIVATE"] = 1; + values[valuesById[2] = "DISCOVERABLE"] = 2; + return values; + })(); + + return AccessSettings; + })(); + + return Space; + })(); + + v1.CreateSpaceRequest = (function() { + + /** + * Properties of a CreateSpaceRequest. + * @memberof google.chat.v1 + * @interface ICreateSpaceRequest + * @property {google.chat.v1.ISpace|null} [space] CreateSpaceRequest space + * @property {string|null} [requestId] CreateSpaceRequest requestId + */ + + /** + * Constructs a new CreateSpaceRequest. + * @memberof google.chat.v1 + * @classdesc Represents a CreateSpaceRequest. + * @implements ICreateSpaceRequest + * @constructor + * @param {google.chat.v1.ICreateSpaceRequest=} [properties] Properties to set + */ + function CreateSpaceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSpaceRequest space. + * @member {google.chat.v1.ISpace|null|undefined} space + * @memberof google.chat.v1.CreateSpaceRequest + * @instance + */ + CreateSpaceRequest.prototype.space = null; + + /** + * CreateSpaceRequest requestId. + * @member {string} requestId + * @memberof google.chat.v1.CreateSpaceRequest + * @instance + */ + CreateSpaceRequest.prototype.requestId = ""; + + /** + * Creates a new CreateSpaceRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {google.chat.v1.ICreateSpaceRequest=} [properties] Properties to set + * @returns {google.chat.v1.CreateSpaceRequest} CreateSpaceRequest instance + */ + CreateSpaceRequest.create = function create(properties) { + return new CreateSpaceRequest(properties); + }; + + /** + * Encodes the specified CreateSpaceRequest message. Does not implicitly {@link google.chat.v1.CreateSpaceRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {google.chat.v1.ICreateSpaceRequest} message CreateSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSpaceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.space != null && Object.hasOwnProperty.call(message, "space")) + $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateSpaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {google.chat.v1.ICreateSpaceRequest} message CreateSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSpaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CreateSpaceRequest} CreateSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSpaceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CreateSpaceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSpaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CreateSpaceRequest} CreateSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSpaceRequest message. + * @function verify + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSpaceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.space != null && message.hasOwnProperty("space")) { + var error = $root.google.chat.v1.Space.verify(message.space); + if (error) + return "space." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CreateSpaceRequest} CreateSpaceRequest + */ + CreateSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CreateSpaceRequest) + return object; + var message = new $root.google.chat.v1.CreateSpaceRequest(); + if (object.space != null) { + if (typeof object.space !== "object") + throw TypeError(".google.chat.v1.CreateSpaceRequest.space: object expected"); + message.space = $root.google.chat.v1.Space.fromObject(object.space); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateSpaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {google.chat.v1.CreateSpaceRequest} message CreateSpaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSpaceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.space = null; + object.requestId = ""; + } + if (message.space != null && message.hasOwnProperty("space")) + object.space = $root.google.chat.v1.Space.toObject(message.space, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateSpaceRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.CreateSpaceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSpaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSpaceRequest + * @function getTypeUrl + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CreateSpaceRequest"; + }; + + return CreateSpaceRequest; + })(); + + v1.ListSpacesRequest = (function() { + + /** + * Properties of a ListSpacesRequest. + * @memberof google.chat.v1 + * @interface IListSpacesRequest + * @property {number|null} [pageSize] ListSpacesRequest pageSize + * @property {string|null} [pageToken] ListSpacesRequest pageToken + * @property {string|null} [filter] ListSpacesRequest filter + */ + + /** + * Constructs a new ListSpacesRequest. + * @memberof google.chat.v1 + * @classdesc Represents a ListSpacesRequest. + * @implements IListSpacesRequest + * @constructor + * @param {google.chat.v1.IListSpacesRequest=} [properties] Properties to set + */ + function ListSpacesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSpacesRequest pageSize. + * @member {number} pageSize + * @memberof google.chat.v1.ListSpacesRequest + * @instance + */ + ListSpacesRequest.prototype.pageSize = 0; + + /** + * ListSpacesRequest pageToken. + * @member {string} pageToken + * @memberof google.chat.v1.ListSpacesRequest + * @instance + */ + ListSpacesRequest.prototype.pageToken = ""; + + /** + * ListSpacesRequest filter. + * @member {string} filter + * @memberof google.chat.v1.ListSpacesRequest + * @instance + */ + ListSpacesRequest.prototype.filter = ""; + + /** + * Creates a new ListSpacesRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {google.chat.v1.IListSpacesRequest=} [properties] Properties to set + * @returns {google.chat.v1.ListSpacesRequest} ListSpacesRequest instance + */ + ListSpacesRequest.create = function create(properties) { + return new ListSpacesRequest(properties); + }; + + /** + * Encodes the specified ListSpacesRequest message. Does not implicitly {@link google.chat.v1.ListSpacesRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {google.chat.v1.IListSpacesRequest} message ListSpacesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpacesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListSpacesRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListSpacesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {google.chat.v1.IListSpacesRequest} message ListSpacesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSpacesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListSpacesRequest} ListSpacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpacesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListSpacesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageSize = reader.int32(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSpacesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListSpacesRequest} ListSpacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpacesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSpacesRequest message. + * @function verify + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSpacesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListSpacesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListSpacesRequest} ListSpacesRequest + */ + ListSpacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListSpacesRequest) + return object; + var message = new $root.google.chat.v1.ListSpacesRequest(); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListSpacesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {google.chat.v1.ListSpacesRequest} message ListSpacesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSpacesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; + object.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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListSpacesRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.ListSpacesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSpacesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSpacesRequest + * @function getTypeUrl + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSpacesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListSpacesRequest"; + }; + + return ListSpacesRequest; + })(); + + v1.ListSpacesResponse = (function() { + + /** + * Properties of a ListSpacesResponse. + * @memberof google.chat.v1 + * @interface IListSpacesResponse + * @property {Array.|null} [spaces] ListSpacesResponse spaces + * @property {string|null} [nextPageToken] ListSpacesResponse nextPageToken + */ + + /** + * Constructs a new ListSpacesResponse. + * @memberof google.chat.v1 + * @classdesc Represents a ListSpacesResponse. + * @implements IListSpacesResponse + * @constructor + * @param {google.chat.v1.IListSpacesResponse=} [properties] Properties to set + */ + function ListSpacesResponse(properties) { + this.spaces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSpacesResponse spaces. + * @member {Array.} spaces + * @memberof google.chat.v1.ListSpacesResponse + * @instance + */ + ListSpacesResponse.prototype.spaces = $util.emptyArray; + + /** + * ListSpacesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.chat.v1.ListSpacesResponse + * @instance + */ + ListSpacesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSpacesResponse instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {google.chat.v1.IListSpacesResponse=} [properties] Properties to set + * @returns {google.chat.v1.ListSpacesResponse} ListSpacesResponse instance + */ + ListSpacesResponse.create = function create(properties) { + return new ListSpacesResponse(properties); + }; + + /** + * Encodes the specified ListSpacesResponse message. Does not implicitly {@link google.chat.v1.ListSpacesResponse.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {google.chat.v1.IListSpacesResponse} message ListSpacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpacesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spaces != null && message.spaces.length) + for (var i = 0; i < message.spaces.length; ++i) + $root.google.chat.v1.Space.encode(message.spaces[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 ListSpacesResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListSpacesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {google.chat.v1.IListSpacesResponse} message ListSpacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSpacesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListSpacesResponse} ListSpacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpacesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListSpacesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.spaces && message.spaces.length)) + message.spaces = []; + message.spaces.push($root.google.chat.v1.Space.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSpacesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListSpacesResponse} ListSpacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpacesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSpacesResponse message. + * @function verify + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSpacesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spaces != null && message.hasOwnProperty("spaces")) { + if (!Array.isArray(message.spaces)) + return "spaces: array expected"; + for (var i = 0; i < message.spaces.length; ++i) { + var error = $root.google.chat.v1.Space.verify(message.spaces[i]); + if (error) + return "spaces." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSpacesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListSpacesResponse} ListSpacesResponse + */ + ListSpacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListSpacesResponse) + return object; + var message = new $root.google.chat.v1.ListSpacesResponse(); + if (object.spaces) { + if (!Array.isArray(object.spaces)) + throw TypeError(".google.chat.v1.ListSpacesResponse.spaces: array expected"); + message.spaces = []; + for (var i = 0; i < object.spaces.length; ++i) { + if (typeof object.spaces[i] !== "object") + throw TypeError(".google.chat.v1.ListSpacesResponse.spaces: object expected"); + message.spaces[i] = $root.google.chat.v1.Space.fromObject(object.spaces[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSpacesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {google.chat.v1.ListSpacesResponse} message ListSpacesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSpacesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.spaces = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.spaces && message.spaces.length) { + object.spaces = []; + for (var j = 0; j < message.spaces.length; ++j) + object.spaces[j] = $root.google.chat.v1.Space.toObject(message.spaces[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSpacesResponse to JSON. + * @function toJSON + * @memberof google.chat.v1.ListSpacesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSpacesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSpacesResponse + * @function getTypeUrl + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSpacesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListSpacesResponse"; + }; + + return ListSpacesResponse; + })(); + + v1.GetSpaceRequest = (function() { + + /** + * Properties of a GetSpaceRequest. + * @memberof google.chat.v1 + * @interface IGetSpaceRequest + * @property {string|null} [name] GetSpaceRequest name + * @property {boolean|null} [useAdminAccess] GetSpaceRequest useAdminAccess + */ + + /** + * Constructs a new GetSpaceRequest. + * @memberof google.chat.v1 + * @classdesc Represents a GetSpaceRequest. + * @implements IGetSpaceRequest + * @constructor + * @param {google.chat.v1.IGetSpaceRequest=} [properties] Properties to set + */ + function GetSpaceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSpaceRequest name. + * @member {string} name + * @memberof google.chat.v1.GetSpaceRequest + * @instance + */ + GetSpaceRequest.prototype.name = ""; + + /** + * GetSpaceRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.GetSpaceRequest + * @instance + */ + GetSpaceRequest.prototype.useAdminAccess = false; + + /** + * Creates a new GetSpaceRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.GetSpaceRequest + * @static + * @param {google.chat.v1.IGetSpaceRequest=} [properties] Properties to set + * @returns {google.chat.v1.GetSpaceRequest} GetSpaceRequest instance + */ + GetSpaceRequest.create = function create(properties) { + return new GetSpaceRequest(properties); + }; + + /** + * Encodes the specified GetSpaceRequest message. Does not implicitly {@link google.chat.v1.GetSpaceRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.GetSpaceRequest + * @static + * @param {google.chat.v1.IGetSpaceRequest} message GetSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpaceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useAdminAccess); + return writer; + }; + + /** + * Encodes the specified GetSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetSpaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.GetSpaceRequest + * @static + * @param {google.chat.v1.IGetSpaceRequest} message GetSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSpaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.GetSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.GetSpaceRequest} GetSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpaceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetSpaceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.useAdminAccess = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSpaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.GetSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.GetSpaceRequest} GetSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSpaceRequest message. + * @function verify + * @memberof google.chat.v1.GetSpaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSpaceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; + return null; + }; + + /** + * Creates a GetSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.GetSpaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.GetSpaceRequest} GetSpaceRequest + */ + GetSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.GetSpaceRequest) + return object; + var message = new $root.google.chat.v1.GetSpaceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); + return message; + }; + + /** + * Creates a plain object from a GetSpaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.GetSpaceRequest + * @static + * @param {google.chat.v1.GetSpaceRequest} message GetSpaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSpaceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.useAdminAccess = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; + return object; + }; + + /** + * Converts this GetSpaceRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.GetSpaceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSpaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSpaceRequest + * @function getTypeUrl + * @memberof google.chat.v1.GetSpaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.GetSpaceRequest"; + }; + + return GetSpaceRequest; + })(); + + v1.FindDirectMessageRequest = (function() { + + /** + * Properties of a FindDirectMessageRequest. + * @memberof google.chat.v1 + * @interface IFindDirectMessageRequest + * @property {string|null} [name] FindDirectMessageRequest name + */ + + /** + * Constructs a new FindDirectMessageRequest. + * @memberof google.chat.v1 + * @classdesc Represents a FindDirectMessageRequest. + * @implements IFindDirectMessageRequest + * @constructor + * @param {google.chat.v1.IFindDirectMessageRequest=} [properties] Properties to set + */ + function FindDirectMessageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FindDirectMessageRequest name. + * @member {string} name + * @memberof google.chat.v1.FindDirectMessageRequest + * @instance + */ + FindDirectMessageRequest.prototype.name = ""; + + /** + * Creates a new FindDirectMessageRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.FindDirectMessageRequest + * @static + * @param {google.chat.v1.IFindDirectMessageRequest=} [properties] Properties to set + * @returns {google.chat.v1.FindDirectMessageRequest} FindDirectMessageRequest instance + */ + FindDirectMessageRequest.create = function create(properties) { + return new FindDirectMessageRequest(properties); + }; + + /** + * Encodes the specified FindDirectMessageRequest message. Does not implicitly {@link google.chat.v1.FindDirectMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.FindDirectMessageRequest + * @static + * @param {google.chat.v1.IFindDirectMessageRequest} message FindDirectMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FindDirectMessageRequest.encode = function encode(message, writer) { + 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 FindDirectMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.FindDirectMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.FindDirectMessageRequest + * @static + * @param {google.chat.v1.IFindDirectMessageRequest} message FindDirectMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FindDirectMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FindDirectMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.FindDirectMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.FindDirectMessageRequest} FindDirectMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FindDirectMessageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.FindDirectMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FindDirectMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.FindDirectMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.FindDirectMessageRequest} FindDirectMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FindDirectMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FindDirectMessageRequest message. + * @function verify + * @memberof google.chat.v1.FindDirectMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FindDirectMessageRequest.verify = function verify(message) { + if (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 FindDirectMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.FindDirectMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.FindDirectMessageRequest} FindDirectMessageRequest + */ + FindDirectMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.FindDirectMessageRequest) + return object; + var message = new $root.google.chat.v1.FindDirectMessageRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a FindDirectMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.FindDirectMessageRequest + * @static + * @param {google.chat.v1.FindDirectMessageRequest} message FindDirectMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FindDirectMessageRequest.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 FindDirectMessageRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.FindDirectMessageRequest + * @instance + * @returns {Object.} JSON object + */ + FindDirectMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FindDirectMessageRequest + * @function getTypeUrl + * @memberof google.chat.v1.FindDirectMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FindDirectMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.FindDirectMessageRequest"; + }; + + return FindDirectMessageRequest; + })(); + + v1.UpdateSpaceRequest = (function() { + + /** + * Properties of an UpdateSpaceRequest. + * @memberof google.chat.v1 + * @interface IUpdateSpaceRequest + * @property {google.chat.v1.ISpace|null} [space] UpdateSpaceRequest space + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpaceRequest updateMask + * @property {boolean|null} [useAdminAccess] UpdateSpaceRequest useAdminAccess + */ + + /** + * Constructs a new UpdateSpaceRequest. + * @memberof google.chat.v1 + * @classdesc Represents an UpdateSpaceRequest. + * @implements IUpdateSpaceRequest + * @constructor + * @param {google.chat.v1.IUpdateSpaceRequest=} [properties] Properties to set + */ + function UpdateSpaceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSpaceRequest space. + * @member {google.chat.v1.ISpace|null|undefined} space + * @memberof google.chat.v1.UpdateSpaceRequest + * @instance + */ + UpdateSpaceRequest.prototype.space = null; + + /** + * UpdateSpaceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.chat.v1.UpdateSpaceRequest + * @instance + */ + UpdateSpaceRequest.prototype.updateMask = null; + + /** + * UpdateSpaceRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.UpdateSpaceRequest + * @instance + */ + UpdateSpaceRequest.prototype.useAdminAccess = false; + + /** + * Creates a new UpdateSpaceRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.UpdateSpaceRequest + * @static + * @param {google.chat.v1.IUpdateSpaceRequest=} [properties] Properties to set + * @returns {google.chat.v1.UpdateSpaceRequest} UpdateSpaceRequest instance + */ + UpdateSpaceRequest.create = function create(properties) { + return new UpdateSpaceRequest(properties); + }; + + /** + * Encodes the specified UpdateSpaceRequest message. Does not implicitly {@link google.chat.v1.UpdateSpaceRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.UpdateSpaceRequest + * @static + * @param {google.chat.v1.IUpdateSpaceRequest} message UpdateSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpaceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.space != null && Object.hasOwnProperty.call(message, "space")) + $root.google.chat.v1.Space.encode(message.space, 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(); + if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.useAdminAccess); + return writer; + }; + + /** + * Encodes the specified UpdateSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateSpaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.UpdateSpaceRequest + * @static + * @param {google.chat.v1.IUpdateSpaceRequest} message UpdateSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSpaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.UpdateSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.UpdateSpaceRequest} UpdateSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpaceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UpdateSpaceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.useAdminAccess = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSpaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.UpdateSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.UpdateSpaceRequest} UpdateSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSpaceRequest message. + * @function verify + * @memberof google.chat.v1.UpdateSpaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSpaceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.space != null && message.hasOwnProperty("space")) { + var error = $root.google.chat.v1.Space.verify(message.space); + if (error) + return "space." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; + return null; + }; + + /** + * Creates an UpdateSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.UpdateSpaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.UpdateSpaceRequest} UpdateSpaceRequest + */ + UpdateSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.UpdateSpaceRequest) + return object; + var message = new $root.google.chat.v1.UpdateSpaceRequest(); + if (object.space != null) { + if (typeof object.space !== "object") + throw TypeError(".google.chat.v1.UpdateSpaceRequest.space: object expected"); + message.space = $root.google.chat.v1.Space.fromObject(object.space); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.chat.v1.UpdateSpaceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); + return message; + }; + + /** + * Creates a plain object from an UpdateSpaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.UpdateSpaceRequest + * @static + * @param {google.chat.v1.UpdateSpaceRequest} message UpdateSpaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSpaceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.space = null; + object.updateMask = null; + object.useAdminAccess = false; + } + if (message.space != null && message.hasOwnProperty("space")) + object.space = $root.google.chat.v1.Space.toObject(message.space, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; + return object; + }; + + /** + * Converts this UpdateSpaceRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.UpdateSpaceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSpaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSpaceRequest + * @function getTypeUrl + * @memberof google.chat.v1.UpdateSpaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.UpdateSpaceRequest"; + }; + + return UpdateSpaceRequest; + })(); + + v1.SearchSpacesRequest = (function() { + + /** + * Properties of a SearchSpacesRequest. + * @memberof google.chat.v1 + * @interface ISearchSpacesRequest + * @property {boolean|null} [useAdminAccess] SearchSpacesRequest useAdminAccess + * @property {number|null} [pageSize] SearchSpacesRequest pageSize + * @property {string|null} [pageToken] SearchSpacesRequest pageToken + * @property {string|null} [query] SearchSpacesRequest query + * @property {string|null} [orderBy] SearchSpacesRequest orderBy + */ + + /** + * Constructs a new SearchSpacesRequest. + * @memberof google.chat.v1 + * @classdesc Represents a SearchSpacesRequest. + * @implements ISearchSpacesRequest + * @constructor + * @param {google.chat.v1.ISearchSpacesRequest=} [properties] Properties to set + */ + function SearchSpacesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchSpacesRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.SearchSpacesRequest + * @instance + */ + SearchSpacesRequest.prototype.useAdminAccess = false; + + /** + * SearchSpacesRequest pageSize. + * @member {number} pageSize + * @memberof google.chat.v1.SearchSpacesRequest + * @instance + */ + SearchSpacesRequest.prototype.pageSize = 0; + + /** + * SearchSpacesRequest pageToken. + * @member {string} pageToken + * @memberof google.chat.v1.SearchSpacesRequest + * @instance + */ + SearchSpacesRequest.prototype.pageToken = ""; + + /** + * SearchSpacesRequest query. + * @member {string} query + * @memberof google.chat.v1.SearchSpacesRequest + * @instance + */ + SearchSpacesRequest.prototype.query = ""; + + /** + * SearchSpacesRequest orderBy. + * @member {string} orderBy + * @memberof google.chat.v1.SearchSpacesRequest + * @instance + */ + SearchSpacesRequest.prototype.orderBy = ""; + + /** + * Creates a new SearchSpacesRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.SearchSpacesRequest + * @static + * @param {google.chat.v1.ISearchSpacesRequest=} [properties] Properties to set + * @returns {google.chat.v1.SearchSpacesRequest} SearchSpacesRequest instance + */ + SearchSpacesRequest.create = function create(properties) { + return new SearchSpacesRequest(properties); + }; + + /** + * Encodes the specified SearchSpacesRequest message. Does not implicitly {@link google.chat.v1.SearchSpacesRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.SearchSpacesRequest + * @static + * @param {google.chat.v1.ISearchSpacesRequest} message SearchSpacesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchSpacesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useAdminAccess); + 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.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.query); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified SearchSpacesRequest message, length delimited. Does not implicitly {@link google.chat.v1.SearchSpacesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.SearchSpacesRequest + * @static + * @param {google.chat.v1.ISearchSpacesRequest} message SearchSpacesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchSpacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchSpacesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.SearchSpacesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.SearchSpacesRequest} SearchSpacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchSpacesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SearchSpacesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.useAdminAccess = reader.bool(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.query = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchSpacesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.SearchSpacesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.SearchSpacesRequest} SearchSpacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchSpacesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchSpacesRequest message. + * @function verify + * @memberof google.chat.v1.SearchSpacesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchSpacesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean 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.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a SearchSpacesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.SearchSpacesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.SearchSpacesRequest} SearchSpacesRequest + */ + SearchSpacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SearchSpacesRequest) + return object; + var message = new $root.google.chat.v1.SearchSpacesRequest(); + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.query != null) + message.query = String(object.query); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a SearchSpacesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.SearchSpacesRequest + * @static + * @param {google.chat.v1.SearchSpacesRequest} message SearchSpacesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchSpacesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.useAdminAccess = false; + object.pageSize = 0; + object.pageToken = ""; + object.query = ""; + object.orderBy = ""; + } + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this SearchSpacesRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.SearchSpacesRequest + * @instance + * @returns {Object.} JSON object + */ + SearchSpacesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchSpacesRequest + * @function getTypeUrl + * @memberof google.chat.v1.SearchSpacesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchSpacesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.SearchSpacesRequest"; + }; + + return SearchSpacesRequest; + })(); + + v1.SearchSpacesResponse = (function() { + + /** + * Properties of a SearchSpacesResponse. + * @memberof google.chat.v1 + * @interface ISearchSpacesResponse + * @property {Array.|null} [spaces] SearchSpacesResponse spaces + * @property {string|null} [nextPageToken] SearchSpacesResponse nextPageToken + * @property {number|null} [totalSize] SearchSpacesResponse totalSize + */ + + /** + * Constructs a new SearchSpacesResponse. + * @memberof google.chat.v1 + * @classdesc Represents a SearchSpacesResponse. + * @implements ISearchSpacesResponse + * @constructor + * @param {google.chat.v1.ISearchSpacesResponse=} [properties] Properties to set + */ + function SearchSpacesResponse(properties) { + this.spaces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchSpacesResponse spaces. + * @member {Array.} spaces + * @memberof google.chat.v1.SearchSpacesResponse + * @instance + */ + SearchSpacesResponse.prototype.spaces = $util.emptyArray; + + /** + * SearchSpacesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.chat.v1.SearchSpacesResponse + * @instance + */ + SearchSpacesResponse.prototype.nextPageToken = ""; + + /** + * SearchSpacesResponse totalSize. + * @member {number} totalSize + * @memberof google.chat.v1.SearchSpacesResponse + * @instance + */ + SearchSpacesResponse.prototype.totalSize = 0; + + /** + * Creates a new SearchSpacesResponse instance using the specified properties. + * @function create + * @memberof google.chat.v1.SearchSpacesResponse + * @static + * @param {google.chat.v1.ISearchSpacesResponse=} [properties] Properties to set + * @returns {google.chat.v1.SearchSpacesResponse} SearchSpacesResponse instance + */ + SearchSpacesResponse.create = function create(properties) { + return new SearchSpacesResponse(properties); + }; + + /** + * Encodes the specified SearchSpacesResponse message. Does not implicitly {@link google.chat.v1.SearchSpacesResponse.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.SearchSpacesResponse + * @static + * @param {google.chat.v1.ISearchSpacesResponse} message SearchSpacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchSpacesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spaces != null && message.spaces.length) + for (var i = 0; i < message.spaces.length; ++i) + $root.google.chat.v1.Space.encode(message.spaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + return writer; + }; + + /** + * Encodes the specified SearchSpacesResponse message, length delimited. Does not implicitly {@link google.chat.v1.SearchSpacesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.SearchSpacesResponse + * @static + * @param {google.chat.v1.ISearchSpacesResponse} message SearchSpacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchSpacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchSpacesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.SearchSpacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.SearchSpacesResponse} SearchSpacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchSpacesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SearchSpacesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.spaces && message.spaces.length)) + message.spaces = []; + message.spaces.push($root.google.chat.v1.Space.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchSpacesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.SearchSpacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.SearchSpacesResponse} SearchSpacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchSpacesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchSpacesResponse message. + * @function verify + * @memberof google.chat.v1.SearchSpacesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchSpacesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spaces != null && message.hasOwnProperty("spaces")) { + if (!Array.isArray(message.spaces)) + return "spaces: array expected"; + for (var i = 0; i < message.spaces.length; ++i) { + var error = $root.google.chat.v1.Space.verify(message.spaces[i]); + if (error) + return "spaces." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; + + /** + * Creates a SearchSpacesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.SearchSpacesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.SearchSpacesResponse} SearchSpacesResponse + */ + SearchSpacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SearchSpacesResponse) + return object; + var message = new $root.google.chat.v1.SearchSpacesResponse(); + if (object.spaces) { + if (!Array.isArray(object.spaces)) + throw TypeError(".google.chat.v1.SearchSpacesResponse.spaces: array expected"); + message.spaces = []; + for (var i = 0; i < object.spaces.length; ++i) { + if (typeof object.spaces[i] !== "object") + throw TypeError(".google.chat.v1.SearchSpacesResponse.spaces: object expected"); + message.spaces[i] = $root.google.chat.v1.Space.fromObject(object.spaces[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a SearchSpacesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.SearchSpacesResponse + * @static + * @param {google.chat.v1.SearchSpacesResponse} message SearchSpacesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchSpacesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.spaces = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.spaces && message.spaces.length) { + object.spaces = []; + for (var j = 0; j < message.spaces.length; ++j) + object.spaces[j] = $root.google.chat.v1.Space.toObject(message.spaces[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this SearchSpacesResponse to JSON. + * @function toJSON + * @memberof google.chat.v1.SearchSpacesResponse + * @instance + * @returns {Object.} JSON object + */ + SearchSpacesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchSpacesResponse + * @function getTypeUrl + * @memberof google.chat.v1.SearchSpacesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchSpacesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.SearchSpacesResponse"; + }; + + return SearchSpacesResponse; + })(); + + v1.DeleteSpaceRequest = (function() { + + /** + * Properties of a DeleteSpaceRequest. + * @memberof google.chat.v1 + * @interface IDeleteSpaceRequest + * @property {string|null} [name] DeleteSpaceRequest name + * @property {boolean|null} [useAdminAccess] DeleteSpaceRequest useAdminAccess + */ + + /** + * Constructs a new DeleteSpaceRequest. + * @memberof google.chat.v1 + * @classdesc Represents a DeleteSpaceRequest. + * @implements IDeleteSpaceRequest + * @constructor + * @param {google.chat.v1.IDeleteSpaceRequest=} [properties] Properties to set + */ + function DeleteSpaceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSpaceRequest name. + * @member {string} name + * @memberof google.chat.v1.DeleteSpaceRequest + * @instance + */ + DeleteSpaceRequest.prototype.name = ""; + + /** + * DeleteSpaceRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.DeleteSpaceRequest + * @instance + */ + DeleteSpaceRequest.prototype.useAdminAccess = false; + + /** + * Creates a new DeleteSpaceRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.DeleteSpaceRequest + * @static + * @param {google.chat.v1.IDeleteSpaceRequest=} [properties] Properties to set + * @returns {google.chat.v1.DeleteSpaceRequest} DeleteSpaceRequest instance + */ + DeleteSpaceRequest.create = function create(properties) { + return new DeleteSpaceRequest(properties); + }; + + /** + * Encodes the specified DeleteSpaceRequest message. Does not implicitly {@link google.chat.v1.DeleteSpaceRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.DeleteSpaceRequest + * @static + * @param {google.chat.v1.IDeleteSpaceRequest} message DeleteSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSpaceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useAdminAccess); + return writer; + }; + + /** + * Encodes the specified DeleteSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteSpaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.DeleteSpaceRequest + * @static + * @param {google.chat.v1.IDeleteSpaceRequest} message DeleteSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSpaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.DeleteSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.DeleteSpaceRequest} DeleteSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSpaceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeleteSpaceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.useAdminAccess = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSpaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.DeleteSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.DeleteSpaceRequest} DeleteSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSpaceRequest message. + * @function verify + * @memberof google.chat.v1.DeleteSpaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSpaceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; + return null; + }; + + /** + * Creates a DeleteSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.DeleteSpaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.DeleteSpaceRequest} DeleteSpaceRequest + */ + DeleteSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DeleteSpaceRequest) + return object; + var message = new $root.google.chat.v1.DeleteSpaceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); + return message; + }; + + /** + * Creates a plain object from a DeleteSpaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.DeleteSpaceRequest + * @static + * @param {google.chat.v1.DeleteSpaceRequest} message DeleteSpaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSpaceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.useAdminAccess = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; + return object; + }; + + /** + * Converts this DeleteSpaceRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.DeleteSpaceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSpaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSpaceRequest + * @function getTypeUrl + * @memberof google.chat.v1.DeleteSpaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.DeleteSpaceRequest"; + }; + + return DeleteSpaceRequest; + })(); + + v1.CompleteImportSpaceRequest = (function() { + + /** + * Properties of a CompleteImportSpaceRequest. + * @memberof google.chat.v1 + * @interface ICompleteImportSpaceRequest + * @property {string|null} [name] CompleteImportSpaceRequest name + */ + + /** + * Constructs a new CompleteImportSpaceRequest. + * @memberof google.chat.v1 + * @classdesc Represents a CompleteImportSpaceRequest. + * @implements ICompleteImportSpaceRequest + * @constructor + * @param {google.chat.v1.ICompleteImportSpaceRequest=} [properties] Properties to set + */ + function CompleteImportSpaceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompleteImportSpaceRequest name. + * @member {string} name + * @memberof google.chat.v1.CompleteImportSpaceRequest + * @instance + */ + CompleteImportSpaceRequest.prototype.name = ""; + + /** + * Creates a new CompleteImportSpaceRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.CompleteImportSpaceRequest + * @static + * @param {google.chat.v1.ICompleteImportSpaceRequest=} [properties] Properties to set + * @returns {google.chat.v1.CompleteImportSpaceRequest} CompleteImportSpaceRequest instance + */ + CompleteImportSpaceRequest.create = function create(properties) { + return new CompleteImportSpaceRequest(properties); + }; + + /** + * Encodes the specified CompleteImportSpaceRequest message. Does not implicitly {@link google.chat.v1.CompleteImportSpaceRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CompleteImportSpaceRequest + * @static + * @param {google.chat.v1.ICompleteImportSpaceRequest} message CompleteImportSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteImportSpaceRequest.encode = function encode(message, writer) { + 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 CompleteImportSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.CompleteImportSpaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CompleteImportSpaceRequest + * @static + * @param {google.chat.v1.ICompleteImportSpaceRequest} message CompleteImportSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteImportSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompleteImportSpaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CompleteImportSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CompleteImportSpaceRequest} CompleteImportSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteImportSpaceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CompleteImportSpaceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompleteImportSpaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CompleteImportSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CompleteImportSpaceRequest} CompleteImportSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteImportSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompleteImportSpaceRequest message. + * @function verify + * @memberof google.chat.v1.CompleteImportSpaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteImportSpaceRequest.verify = function verify(message) { + if (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 CompleteImportSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CompleteImportSpaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CompleteImportSpaceRequest} CompleteImportSpaceRequest + */ + CompleteImportSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CompleteImportSpaceRequest) + return object; + var message = new $root.google.chat.v1.CompleteImportSpaceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CompleteImportSpaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CompleteImportSpaceRequest + * @static + * @param {google.chat.v1.CompleteImportSpaceRequest} message CompleteImportSpaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteImportSpaceRequest.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 CompleteImportSpaceRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.CompleteImportSpaceRequest + * @instance + * @returns {Object.} JSON object + */ + CompleteImportSpaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompleteImportSpaceRequest + * @function getTypeUrl + * @memberof google.chat.v1.CompleteImportSpaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompleteImportSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CompleteImportSpaceRequest"; + }; + + return CompleteImportSpaceRequest; + })(); + + v1.CompleteImportSpaceResponse = (function() { + + /** + * Properties of a CompleteImportSpaceResponse. + * @memberof google.chat.v1 + * @interface ICompleteImportSpaceResponse + * @property {google.chat.v1.ISpace|null} [space] CompleteImportSpaceResponse space + */ + + /** + * Constructs a new CompleteImportSpaceResponse. + * @memberof google.chat.v1 + * @classdesc Represents a CompleteImportSpaceResponse. + * @implements ICompleteImportSpaceResponse + * @constructor + * @param {google.chat.v1.ICompleteImportSpaceResponse=} [properties] Properties to set + */ + function CompleteImportSpaceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompleteImportSpaceResponse space. + * @member {google.chat.v1.ISpace|null|undefined} space + * @memberof google.chat.v1.CompleteImportSpaceResponse + * @instance + */ + CompleteImportSpaceResponse.prototype.space = null; + + /** + * Creates a new CompleteImportSpaceResponse instance using the specified properties. + * @function create + * @memberof google.chat.v1.CompleteImportSpaceResponse + * @static + * @param {google.chat.v1.ICompleteImportSpaceResponse=} [properties] Properties to set + * @returns {google.chat.v1.CompleteImportSpaceResponse} CompleteImportSpaceResponse instance + */ + CompleteImportSpaceResponse.create = function create(properties) { + return new CompleteImportSpaceResponse(properties); + }; + + /** + * Encodes the specified CompleteImportSpaceResponse message. Does not implicitly {@link google.chat.v1.CompleteImportSpaceResponse.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CompleteImportSpaceResponse + * @static + * @param {google.chat.v1.ICompleteImportSpaceResponse} message CompleteImportSpaceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteImportSpaceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.space != null && Object.hasOwnProperty.call(message, "space")) + $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompleteImportSpaceResponse message, length delimited. Does not implicitly {@link google.chat.v1.CompleteImportSpaceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CompleteImportSpaceResponse + * @static + * @param {google.chat.v1.ICompleteImportSpaceResponse} message CompleteImportSpaceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteImportSpaceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompleteImportSpaceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CompleteImportSpaceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CompleteImportSpaceResponse} CompleteImportSpaceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteImportSpaceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CompleteImportSpaceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompleteImportSpaceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CompleteImportSpaceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CompleteImportSpaceResponse} CompleteImportSpaceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteImportSpaceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompleteImportSpaceResponse message. + * @function verify + * @memberof google.chat.v1.CompleteImportSpaceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteImportSpaceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.space != null && message.hasOwnProperty("space")) { + var error = $root.google.chat.v1.Space.verify(message.space); + if (error) + return "space." + error; + } + return null; + }; + + /** + * Creates a CompleteImportSpaceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CompleteImportSpaceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CompleteImportSpaceResponse} CompleteImportSpaceResponse + */ + CompleteImportSpaceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CompleteImportSpaceResponse) + return object; + var message = new $root.google.chat.v1.CompleteImportSpaceResponse(); + if (object.space != null) { + if (typeof object.space !== "object") + throw TypeError(".google.chat.v1.CompleteImportSpaceResponse.space: object expected"); + message.space = $root.google.chat.v1.Space.fromObject(object.space); + } + return message; + }; + + /** + * Creates a plain object from a CompleteImportSpaceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CompleteImportSpaceResponse + * @static + * @param {google.chat.v1.CompleteImportSpaceResponse} message CompleteImportSpaceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteImportSpaceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.space = null; + if (message.space != null && message.hasOwnProperty("space")) + object.space = $root.google.chat.v1.Space.toObject(message.space, options); + return object; + }; + + /** + * Converts this CompleteImportSpaceResponse to JSON. + * @function toJSON + * @memberof google.chat.v1.CompleteImportSpaceResponse + * @instance + * @returns {Object.} JSON object + */ + CompleteImportSpaceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompleteImportSpaceResponse + * @function getTypeUrl + * @memberof google.chat.v1.CompleteImportSpaceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompleteImportSpaceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CompleteImportSpaceResponse"; + }; + + return CompleteImportSpaceResponse; + })(); + + /** + * HistoryState enum. + * @name google.chat.v1.HistoryState + * @enum {number} + * @property {number} HISTORY_STATE_UNSPECIFIED=0 HISTORY_STATE_UNSPECIFIED value + * @property {number} HISTORY_OFF=1 HISTORY_OFF value + * @property {number} HISTORY_ON=2 HISTORY_ON value + */ + v1.HistoryState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HISTORY_OFF"] = 1; + values[valuesById[2] = "HISTORY_ON"] = 2; + return values; + })(); + + v1.SpaceEvent = (function() { + + /** + * Properties of a SpaceEvent. + * @memberof google.chat.v1 + * @interface ISpaceEvent + * @property {string|null} [name] SpaceEvent name + * @property {google.protobuf.ITimestamp|null} [eventTime] SpaceEvent eventTime + * @property {string|null} [eventType] SpaceEvent eventType + * @property {google.chat.v1.IMessageCreatedEventData|null} [messageCreatedEventData] SpaceEvent messageCreatedEventData + * @property {google.chat.v1.IMessageUpdatedEventData|null} [messageUpdatedEventData] SpaceEvent messageUpdatedEventData + * @property {google.chat.v1.IMessageDeletedEventData|null} [messageDeletedEventData] SpaceEvent messageDeletedEventData + * @property {google.chat.v1.IMessageBatchCreatedEventData|null} [messageBatchCreatedEventData] SpaceEvent messageBatchCreatedEventData + * @property {google.chat.v1.IMessageBatchUpdatedEventData|null} [messageBatchUpdatedEventData] SpaceEvent messageBatchUpdatedEventData + * @property {google.chat.v1.IMessageBatchDeletedEventData|null} [messageBatchDeletedEventData] SpaceEvent messageBatchDeletedEventData + * @property {google.chat.v1.ISpaceUpdatedEventData|null} [spaceUpdatedEventData] SpaceEvent spaceUpdatedEventData + * @property {google.chat.v1.ISpaceBatchUpdatedEventData|null} [spaceBatchUpdatedEventData] SpaceEvent spaceBatchUpdatedEventData + * @property {google.chat.v1.IMembershipCreatedEventData|null} [membershipCreatedEventData] SpaceEvent membershipCreatedEventData + * @property {google.chat.v1.IMembershipUpdatedEventData|null} [membershipUpdatedEventData] SpaceEvent membershipUpdatedEventData + * @property {google.chat.v1.IMembershipDeletedEventData|null} [membershipDeletedEventData] SpaceEvent membershipDeletedEventData + * @property {google.chat.v1.IMembershipBatchCreatedEventData|null} [membershipBatchCreatedEventData] SpaceEvent membershipBatchCreatedEventData + * @property {google.chat.v1.IMembershipBatchUpdatedEventData|null} [membershipBatchUpdatedEventData] SpaceEvent membershipBatchUpdatedEventData + * @property {google.chat.v1.IMembershipBatchDeletedEventData|null} [membershipBatchDeletedEventData] SpaceEvent membershipBatchDeletedEventData + * @property {google.chat.v1.IReactionCreatedEventData|null} [reactionCreatedEventData] SpaceEvent reactionCreatedEventData + * @property {google.chat.v1.IReactionDeletedEventData|null} [reactionDeletedEventData] SpaceEvent reactionDeletedEventData + * @property {google.chat.v1.IReactionBatchCreatedEventData|null} [reactionBatchCreatedEventData] SpaceEvent reactionBatchCreatedEventData + * @property {google.chat.v1.IReactionBatchDeletedEventData|null} [reactionBatchDeletedEventData] SpaceEvent reactionBatchDeletedEventData + */ + + /** + * Constructs a new SpaceEvent. + * @memberof google.chat.v1 + * @classdesc Represents a SpaceEvent. + * @implements ISpaceEvent + * @constructor + * @param {google.chat.v1.ISpaceEvent=} [properties] Properties to set + */ + function SpaceEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpaceEvent name. + * @member {string} name + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.name = ""; + + /** + * SpaceEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.eventTime = null; + + /** + * SpaceEvent eventType. + * @member {string} eventType + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.eventType = ""; + + /** + * SpaceEvent messageCreatedEventData. + * @member {google.chat.v1.IMessageCreatedEventData|null|undefined} messageCreatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.messageCreatedEventData = null; + + /** + * SpaceEvent messageUpdatedEventData. + * @member {google.chat.v1.IMessageUpdatedEventData|null|undefined} messageUpdatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.messageUpdatedEventData = null; + + /** + * SpaceEvent messageDeletedEventData. + * @member {google.chat.v1.IMessageDeletedEventData|null|undefined} messageDeletedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.messageDeletedEventData = null; + + /** + * SpaceEvent messageBatchCreatedEventData. + * @member {google.chat.v1.IMessageBatchCreatedEventData|null|undefined} messageBatchCreatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.messageBatchCreatedEventData = null; + + /** + * SpaceEvent messageBatchUpdatedEventData. + * @member {google.chat.v1.IMessageBatchUpdatedEventData|null|undefined} messageBatchUpdatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.messageBatchUpdatedEventData = null; + + /** + * SpaceEvent messageBatchDeletedEventData. + * @member {google.chat.v1.IMessageBatchDeletedEventData|null|undefined} messageBatchDeletedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.messageBatchDeletedEventData = null; + + /** + * SpaceEvent spaceUpdatedEventData. + * @member {google.chat.v1.ISpaceUpdatedEventData|null|undefined} spaceUpdatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.spaceUpdatedEventData = null; + + /** + * SpaceEvent spaceBatchUpdatedEventData. + * @member {google.chat.v1.ISpaceBatchUpdatedEventData|null|undefined} spaceBatchUpdatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.spaceBatchUpdatedEventData = null; + + /** + * SpaceEvent membershipCreatedEventData. + * @member {google.chat.v1.IMembershipCreatedEventData|null|undefined} membershipCreatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.membershipCreatedEventData = null; + + /** + * SpaceEvent membershipUpdatedEventData. + * @member {google.chat.v1.IMembershipUpdatedEventData|null|undefined} membershipUpdatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.membershipUpdatedEventData = null; + + /** + * SpaceEvent membershipDeletedEventData. + * @member {google.chat.v1.IMembershipDeletedEventData|null|undefined} membershipDeletedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.membershipDeletedEventData = null; + + /** + * SpaceEvent membershipBatchCreatedEventData. + * @member {google.chat.v1.IMembershipBatchCreatedEventData|null|undefined} membershipBatchCreatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.membershipBatchCreatedEventData = null; + + /** + * SpaceEvent membershipBatchUpdatedEventData. + * @member {google.chat.v1.IMembershipBatchUpdatedEventData|null|undefined} membershipBatchUpdatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.membershipBatchUpdatedEventData = null; + + /** + * SpaceEvent membershipBatchDeletedEventData. + * @member {google.chat.v1.IMembershipBatchDeletedEventData|null|undefined} membershipBatchDeletedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.membershipBatchDeletedEventData = null; + + /** + * SpaceEvent reactionCreatedEventData. + * @member {google.chat.v1.IReactionCreatedEventData|null|undefined} reactionCreatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.reactionCreatedEventData = null; + + /** + * SpaceEvent reactionDeletedEventData. + * @member {google.chat.v1.IReactionDeletedEventData|null|undefined} reactionDeletedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.reactionDeletedEventData = null; + + /** + * SpaceEvent reactionBatchCreatedEventData. + * @member {google.chat.v1.IReactionBatchCreatedEventData|null|undefined} reactionBatchCreatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.reactionBatchCreatedEventData = null; + + /** + * SpaceEvent reactionBatchDeletedEventData. + * @member {google.chat.v1.IReactionBatchDeletedEventData|null|undefined} reactionBatchDeletedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.reactionBatchDeletedEventData = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SpaceEvent payload. + * @member {"messageCreatedEventData"|"messageUpdatedEventData"|"messageDeletedEventData"|"messageBatchCreatedEventData"|"messageBatchUpdatedEventData"|"messageBatchDeletedEventData"|"spaceUpdatedEventData"|"spaceBatchUpdatedEventData"|"membershipCreatedEventData"|"membershipUpdatedEventData"|"membershipDeletedEventData"|"membershipBatchCreatedEventData"|"membershipBatchUpdatedEventData"|"membershipBatchDeletedEventData"|"reactionCreatedEventData"|"reactionDeletedEventData"|"reactionBatchCreatedEventData"|"reactionBatchDeletedEventData"|undefined} payload + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + Object.defineProperty(SpaceEvent.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["messageCreatedEventData", "messageUpdatedEventData", "messageDeletedEventData", "messageBatchCreatedEventData", "messageBatchUpdatedEventData", "messageBatchDeletedEventData", "spaceUpdatedEventData", "spaceBatchUpdatedEventData", "membershipCreatedEventData", "membershipUpdatedEventData", "membershipDeletedEventData", "membershipBatchCreatedEventData", "membershipBatchUpdatedEventData", "membershipBatchDeletedEventData", "reactionCreatedEventData", "reactionDeletedEventData", "reactionBatchCreatedEventData", "reactionBatchDeletedEventData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpaceEvent instance using the specified properties. + * @function create + * @memberof google.chat.v1.SpaceEvent + * @static + * @param {google.chat.v1.ISpaceEvent=} [properties] Properties to set + * @returns {google.chat.v1.SpaceEvent} SpaceEvent instance + */ + SpaceEvent.create = function create(properties) { + return new SpaceEvent(properties); + }; + + /** + * Encodes the specified SpaceEvent message. Does not implicitly {@link google.chat.v1.SpaceEvent.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.SpaceEvent + * @static + * @param {google.chat.v1.ISpaceEvent} message SpaceEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpaceEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.eventType); + if (message.messageCreatedEventData != null && Object.hasOwnProperty.call(message, "messageCreatedEventData")) + $root.google.chat.v1.MessageCreatedEventData.encode(message.messageCreatedEventData, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.messageUpdatedEventData != null && Object.hasOwnProperty.call(message, "messageUpdatedEventData")) + $root.google.chat.v1.MessageUpdatedEventData.encode(message.messageUpdatedEventData, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.messageDeletedEventData != null && Object.hasOwnProperty.call(message, "messageDeletedEventData")) + $root.google.chat.v1.MessageDeletedEventData.encode(message.messageDeletedEventData, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.spaceUpdatedEventData != null && Object.hasOwnProperty.call(message, "spaceUpdatedEventData")) + $root.google.chat.v1.SpaceUpdatedEventData.encode(message.spaceUpdatedEventData, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.membershipCreatedEventData != null && Object.hasOwnProperty.call(message, "membershipCreatedEventData")) + $root.google.chat.v1.MembershipCreatedEventData.encode(message.membershipCreatedEventData, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.membershipUpdatedEventData != null && Object.hasOwnProperty.call(message, "membershipUpdatedEventData")) + $root.google.chat.v1.MembershipUpdatedEventData.encode(message.membershipUpdatedEventData, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.reactionCreatedEventData != null && Object.hasOwnProperty.call(message, "reactionCreatedEventData")) + $root.google.chat.v1.ReactionCreatedEventData.encode(message.reactionCreatedEventData, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.reactionDeletedEventData != null && Object.hasOwnProperty.call(message, "reactionDeletedEventData")) + $root.google.chat.v1.ReactionDeletedEventData.encode(message.reactionDeletedEventData, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.messageBatchCreatedEventData != null && Object.hasOwnProperty.call(message, "messageBatchCreatedEventData")) + $root.google.chat.v1.MessageBatchCreatedEventData.encode(message.messageBatchCreatedEventData, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.messageBatchUpdatedEventData != null && Object.hasOwnProperty.call(message, "messageBatchUpdatedEventData")) + $root.google.chat.v1.MessageBatchUpdatedEventData.encode(message.messageBatchUpdatedEventData, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.messageBatchDeletedEventData != null && Object.hasOwnProperty.call(message, "messageBatchDeletedEventData")) + $root.google.chat.v1.MessageBatchDeletedEventData.encode(message.messageBatchDeletedEventData, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.spaceBatchUpdatedEventData != null && Object.hasOwnProperty.call(message, "spaceBatchUpdatedEventData")) + $root.google.chat.v1.SpaceBatchUpdatedEventData.encode(message.spaceBatchUpdatedEventData, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.membershipBatchCreatedEventData != null && Object.hasOwnProperty.call(message, "membershipBatchCreatedEventData")) + $root.google.chat.v1.MembershipBatchCreatedEventData.encode(message.membershipBatchCreatedEventData, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.membershipBatchUpdatedEventData != null && Object.hasOwnProperty.call(message, "membershipBatchUpdatedEventData")) + $root.google.chat.v1.MembershipBatchUpdatedEventData.encode(message.membershipBatchUpdatedEventData, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.membershipBatchDeletedEventData != null && Object.hasOwnProperty.call(message, "membershipBatchDeletedEventData")) + $root.google.chat.v1.MembershipBatchDeletedEventData.encode(message.membershipBatchDeletedEventData, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.reactionBatchCreatedEventData != null && Object.hasOwnProperty.call(message, "reactionBatchCreatedEventData")) + $root.google.chat.v1.ReactionBatchCreatedEventData.encode(message.reactionBatchCreatedEventData, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.reactionBatchDeletedEventData != null && Object.hasOwnProperty.call(message, "reactionBatchDeletedEventData")) + $root.google.chat.v1.ReactionBatchDeletedEventData.encode(message.reactionBatchDeletedEventData, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.membershipDeletedEventData != null && Object.hasOwnProperty.call(message, "membershipDeletedEventData")) + $root.google.chat.v1.MembershipDeletedEventData.encode(message.membershipDeletedEventData, writer.uint32(/* id 219, wireType 2 =*/1754).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpaceEvent message, length delimited. Does not implicitly {@link google.chat.v1.SpaceEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.SpaceEvent + * @static + * @param {google.chat.v1.ISpaceEvent} message SpaceEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpaceEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpaceEvent message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.SpaceEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.SpaceEvent} SpaceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpaceEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SpaceEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.eventType = reader.string(); + break; + } + case 12: { + message.messageCreatedEventData = $root.google.chat.v1.MessageCreatedEventData.decode(reader, reader.uint32()); + break; + } + case 13: { + message.messageUpdatedEventData = $root.google.chat.v1.MessageUpdatedEventData.decode(reader, reader.uint32()); + break; + } + case 14: { + message.messageDeletedEventData = $root.google.chat.v1.MessageDeletedEventData.decode(reader, reader.uint32()); + break; + } + case 26: { + message.messageBatchCreatedEventData = $root.google.chat.v1.MessageBatchCreatedEventData.decode(reader, reader.uint32()); + break; + } + case 27: { + message.messageBatchUpdatedEventData = $root.google.chat.v1.MessageBatchUpdatedEventData.decode(reader, reader.uint32()); + break; + } + case 28: { + message.messageBatchDeletedEventData = $root.google.chat.v1.MessageBatchDeletedEventData.decode(reader, reader.uint32()); + break; + } + case 15: { + message.spaceUpdatedEventData = $root.google.chat.v1.SpaceUpdatedEventData.decode(reader, reader.uint32()); + break; + } + case 29: { + message.spaceBatchUpdatedEventData = $root.google.chat.v1.SpaceBatchUpdatedEventData.decode(reader, reader.uint32()); + break; + } + case 17: { + message.membershipCreatedEventData = $root.google.chat.v1.MembershipCreatedEventData.decode(reader, reader.uint32()); + break; + } + case 18: { + message.membershipUpdatedEventData = $root.google.chat.v1.MembershipUpdatedEventData.decode(reader, reader.uint32()); + break; + } + case 219: { + message.membershipDeletedEventData = $root.google.chat.v1.MembershipDeletedEventData.decode(reader, reader.uint32()); + break; + } + case 31: { + message.membershipBatchCreatedEventData = $root.google.chat.v1.MembershipBatchCreatedEventData.decode(reader, reader.uint32()); + break; + } + case 32: { + message.membershipBatchUpdatedEventData = $root.google.chat.v1.MembershipBatchUpdatedEventData.decode(reader, reader.uint32()); + break; + } + case 33: { + message.membershipBatchDeletedEventData = $root.google.chat.v1.MembershipBatchDeletedEventData.decode(reader, reader.uint32()); + break; + } + case 21: { + message.reactionCreatedEventData = $root.google.chat.v1.ReactionCreatedEventData.decode(reader, reader.uint32()); + break; + } + case 22: { + message.reactionDeletedEventData = $root.google.chat.v1.ReactionDeletedEventData.decode(reader, reader.uint32()); + break; + } + case 34: { + message.reactionBatchCreatedEventData = $root.google.chat.v1.ReactionBatchCreatedEventData.decode(reader, reader.uint32()); + break; + } + case 35: { + message.reactionBatchDeletedEventData = $root.google.chat.v1.ReactionBatchDeletedEventData.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpaceEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.SpaceEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.SpaceEvent} SpaceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpaceEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpaceEvent message. + * @function verify + * @memberof google.chat.v1.SpaceEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpaceEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.eventType != null && message.hasOwnProperty("eventType")) + if (!$util.isString(message.eventType)) + return "eventType: string expected"; + if (message.messageCreatedEventData != null && message.hasOwnProperty("messageCreatedEventData")) { + properties.payload = 1; + { + var error = $root.google.chat.v1.MessageCreatedEventData.verify(message.messageCreatedEventData); + if (error) + return "messageCreatedEventData." + error; + } + } + if (message.messageUpdatedEventData != null && message.hasOwnProperty("messageUpdatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MessageUpdatedEventData.verify(message.messageUpdatedEventData); + if (error) + return "messageUpdatedEventData." + error; + } + } + if (message.messageDeletedEventData != null && message.hasOwnProperty("messageDeletedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MessageDeletedEventData.verify(message.messageDeletedEventData); + if (error) + return "messageDeletedEventData." + error; + } + } + if (message.messageBatchCreatedEventData != null && message.hasOwnProperty("messageBatchCreatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MessageBatchCreatedEventData.verify(message.messageBatchCreatedEventData); + if (error) + return "messageBatchCreatedEventData." + error; + } + } + if (message.messageBatchUpdatedEventData != null && message.hasOwnProperty("messageBatchUpdatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MessageBatchUpdatedEventData.verify(message.messageBatchUpdatedEventData); + if (error) + return "messageBatchUpdatedEventData." + error; + } + } + if (message.messageBatchDeletedEventData != null && message.hasOwnProperty("messageBatchDeletedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MessageBatchDeletedEventData.verify(message.messageBatchDeletedEventData); + if (error) + return "messageBatchDeletedEventData." + error; + } + } + if (message.spaceUpdatedEventData != null && message.hasOwnProperty("spaceUpdatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.SpaceUpdatedEventData.verify(message.spaceUpdatedEventData); + if (error) + return "spaceUpdatedEventData." + error; + } + } + if (message.spaceBatchUpdatedEventData != null && message.hasOwnProperty("spaceBatchUpdatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.SpaceBatchUpdatedEventData.verify(message.spaceBatchUpdatedEventData); + if (error) + return "spaceBatchUpdatedEventData." + error; + } + } + if (message.membershipCreatedEventData != null && message.hasOwnProperty("membershipCreatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MembershipCreatedEventData.verify(message.membershipCreatedEventData); + if (error) + return "membershipCreatedEventData." + error; + } + } + if (message.membershipUpdatedEventData != null && message.hasOwnProperty("membershipUpdatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MembershipUpdatedEventData.verify(message.membershipUpdatedEventData); + if (error) + return "membershipUpdatedEventData." + error; + } + } + if (message.membershipDeletedEventData != null && message.hasOwnProperty("membershipDeletedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MembershipDeletedEventData.verify(message.membershipDeletedEventData); + if (error) + return "membershipDeletedEventData." + error; + } + } + if (message.membershipBatchCreatedEventData != null && message.hasOwnProperty("membershipBatchCreatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MembershipBatchCreatedEventData.verify(message.membershipBatchCreatedEventData); + if (error) + return "membershipBatchCreatedEventData." + error; + } + } + if (message.membershipBatchUpdatedEventData != null && message.hasOwnProperty("membershipBatchUpdatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MembershipBatchUpdatedEventData.verify(message.membershipBatchUpdatedEventData); + if (error) + return "membershipBatchUpdatedEventData." + error; + } + } + if (message.membershipBatchDeletedEventData != null && message.hasOwnProperty("membershipBatchDeletedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MembershipBatchDeletedEventData.verify(message.membershipBatchDeletedEventData); + if (error) + return "membershipBatchDeletedEventData." + error; + } + } + if (message.reactionCreatedEventData != null && message.hasOwnProperty("reactionCreatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.ReactionCreatedEventData.verify(message.reactionCreatedEventData); + if (error) + return "reactionCreatedEventData." + error; + } + } + if (message.reactionDeletedEventData != null && message.hasOwnProperty("reactionDeletedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.ReactionDeletedEventData.verify(message.reactionDeletedEventData); + if (error) + return "reactionDeletedEventData." + error; + } + } + if (message.reactionBatchCreatedEventData != null && message.hasOwnProperty("reactionBatchCreatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.ReactionBatchCreatedEventData.verify(message.reactionBatchCreatedEventData); + if (error) + return "reactionBatchCreatedEventData." + error; + } + } + if (message.reactionBatchDeletedEventData != null && message.hasOwnProperty("reactionBatchDeletedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.ReactionBatchDeletedEventData.verify(message.reactionBatchDeletedEventData); + if (error) + return "reactionBatchDeletedEventData." + error; + } + } + return null; + }; + + /** + * Creates a SpaceEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.SpaceEvent + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.SpaceEvent} SpaceEvent + */ + SpaceEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SpaceEvent) + return object; + var message = new $root.google.chat.v1.SpaceEvent(); + if (object.name != null) + message.name = String(object.name); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.eventType != null) + message.eventType = String(object.eventType); + if (object.messageCreatedEventData != null) { + if (typeof object.messageCreatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.messageCreatedEventData: object expected"); + message.messageCreatedEventData = $root.google.chat.v1.MessageCreatedEventData.fromObject(object.messageCreatedEventData); + } + if (object.messageUpdatedEventData != null) { + if (typeof object.messageUpdatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.messageUpdatedEventData: object expected"); + message.messageUpdatedEventData = $root.google.chat.v1.MessageUpdatedEventData.fromObject(object.messageUpdatedEventData); + } + if (object.messageDeletedEventData != null) { + if (typeof object.messageDeletedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.messageDeletedEventData: object expected"); + message.messageDeletedEventData = $root.google.chat.v1.MessageDeletedEventData.fromObject(object.messageDeletedEventData); + } + if (object.messageBatchCreatedEventData != null) { + if (typeof object.messageBatchCreatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.messageBatchCreatedEventData: object expected"); + message.messageBatchCreatedEventData = $root.google.chat.v1.MessageBatchCreatedEventData.fromObject(object.messageBatchCreatedEventData); + } + if (object.messageBatchUpdatedEventData != null) { + if (typeof object.messageBatchUpdatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.messageBatchUpdatedEventData: object expected"); + message.messageBatchUpdatedEventData = $root.google.chat.v1.MessageBatchUpdatedEventData.fromObject(object.messageBatchUpdatedEventData); + } + if (object.messageBatchDeletedEventData != null) { + if (typeof object.messageBatchDeletedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.messageBatchDeletedEventData: object expected"); + message.messageBatchDeletedEventData = $root.google.chat.v1.MessageBatchDeletedEventData.fromObject(object.messageBatchDeletedEventData); + } + if (object.spaceUpdatedEventData != null) { + if (typeof object.spaceUpdatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.spaceUpdatedEventData: object expected"); + message.spaceUpdatedEventData = $root.google.chat.v1.SpaceUpdatedEventData.fromObject(object.spaceUpdatedEventData); + } + if (object.spaceBatchUpdatedEventData != null) { + if (typeof object.spaceBatchUpdatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.spaceBatchUpdatedEventData: object expected"); + message.spaceBatchUpdatedEventData = $root.google.chat.v1.SpaceBatchUpdatedEventData.fromObject(object.spaceBatchUpdatedEventData); + } + if (object.membershipCreatedEventData != null) { + if (typeof object.membershipCreatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.membershipCreatedEventData: object expected"); + message.membershipCreatedEventData = $root.google.chat.v1.MembershipCreatedEventData.fromObject(object.membershipCreatedEventData); + } + if (object.membershipUpdatedEventData != null) { + if (typeof object.membershipUpdatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.membershipUpdatedEventData: object expected"); + message.membershipUpdatedEventData = $root.google.chat.v1.MembershipUpdatedEventData.fromObject(object.membershipUpdatedEventData); + } + if (object.membershipDeletedEventData != null) { + if (typeof object.membershipDeletedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.membershipDeletedEventData: object expected"); + message.membershipDeletedEventData = $root.google.chat.v1.MembershipDeletedEventData.fromObject(object.membershipDeletedEventData); + } + if (object.membershipBatchCreatedEventData != null) { + if (typeof object.membershipBatchCreatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.membershipBatchCreatedEventData: object expected"); + message.membershipBatchCreatedEventData = $root.google.chat.v1.MembershipBatchCreatedEventData.fromObject(object.membershipBatchCreatedEventData); + } + if (object.membershipBatchUpdatedEventData != null) { + if (typeof object.membershipBatchUpdatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.membershipBatchUpdatedEventData: object expected"); + message.membershipBatchUpdatedEventData = $root.google.chat.v1.MembershipBatchUpdatedEventData.fromObject(object.membershipBatchUpdatedEventData); + } + if (object.membershipBatchDeletedEventData != null) { + if (typeof object.membershipBatchDeletedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.membershipBatchDeletedEventData: object expected"); + message.membershipBatchDeletedEventData = $root.google.chat.v1.MembershipBatchDeletedEventData.fromObject(object.membershipBatchDeletedEventData); + } + if (object.reactionCreatedEventData != null) { + if (typeof object.reactionCreatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.reactionCreatedEventData: object expected"); + message.reactionCreatedEventData = $root.google.chat.v1.ReactionCreatedEventData.fromObject(object.reactionCreatedEventData); + } + if (object.reactionDeletedEventData != null) { + if (typeof object.reactionDeletedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.reactionDeletedEventData: object expected"); + message.reactionDeletedEventData = $root.google.chat.v1.ReactionDeletedEventData.fromObject(object.reactionDeletedEventData); + } + if (object.reactionBatchCreatedEventData != null) { + if (typeof object.reactionBatchCreatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.reactionBatchCreatedEventData: object expected"); + message.reactionBatchCreatedEventData = $root.google.chat.v1.ReactionBatchCreatedEventData.fromObject(object.reactionBatchCreatedEventData); + } + if (object.reactionBatchDeletedEventData != null) { + if (typeof object.reactionBatchDeletedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.reactionBatchDeletedEventData: object expected"); + message.reactionBatchDeletedEventData = $root.google.chat.v1.ReactionBatchDeletedEventData.fromObject(object.reactionBatchDeletedEventData); + } + return message; + }; + + /** + * Creates a plain object from a SpaceEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.SpaceEvent + * @static + * @param {google.chat.v1.SpaceEvent} message SpaceEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpaceEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.eventTime = null; + object.eventType = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = message.eventType; + if (message.messageCreatedEventData != null && message.hasOwnProperty("messageCreatedEventData")) { + object.messageCreatedEventData = $root.google.chat.v1.MessageCreatedEventData.toObject(message.messageCreatedEventData, options); + if (options.oneofs) + object.payload = "messageCreatedEventData"; + } + if (message.messageUpdatedEventData != null && message.hasOwnProperty("messageUpdatedEventData")) { + object.messageUpdatedEventData = $root.google.chat.v1.MessageUpdatedEventData.toObject(message.messageUpdatedEventData, options); + if (options.oneofs) + object.payload = "messageUpdatedEventData"; + } + if (message.messageDeletedEventData != null && message.hasOwnProperty("messageDeletedEventData")) { + object.messageDeletedEventData = $root.google.chat.v1.MessageDeletedEventData.toObject(message.messageDeletedEventData, options); + if (options.oneofs) + object.payload = "messageDeletedEventData"; + } + if (message.spaceUpdatedEventData != null && message.hasOwnProperty("spaceUpdatedEventData")) { + object.spaceUpdatedEventData = $root.google.chat.v1.SpaceUpdatedEventData.toObject(message.spaceUpdatedEventData, options); + if (options.oneofs) + object.payload = "spaceUpdatedEventData"; + } + if (message.membershipCreatedEventData != null && message.hasOwnProperty("membershipCreatedEventData")) { + object.membershipCreatedEventData = $root.google.chat.v1.MembershipCreatedEventData.toObject(message.membershipCreatedEventData, options); + if (options.oneofs) + object.payload = "membershipCreatedEventData"; + } + if (message.membershipUpdatedEventData != null && message.hasOwnProperty("membershipUpdatedEventData")) { + object.membershipUpdatedEventData = $root.google.chat.v1.MembershipUpdatedEventData.toObject(message.membershipUpdatedEventData, options); + if (options.oneofs) + object.payload = "membershipUpdatedEventData"; + } + if (message.reactionCreatedEventData != null && message.hasOwnProperty("reactionCreatedEventData")) { + object.reactionCreatedEventData = $root.google.chat.v1.ReactionCreatedEventData.toObject(message.reactionCreatedEventData, options); + if (options.oneofs) + object.payload = "reactionCreatedEventData"; + } + if (message.reactionDeletedEventData != null && message.hasOwnProperty("reactionDeletedEventData")) { + object.reactionDeletedEventData = $root.google.chat.v1.ReactionDeletedEventData.toObject(message.reactionDeletedEventData, options); + if (options.oneofs) + object.payload = "reactionDeletedEventData"; + } + if (message.messageBatchCreatedEventData != null && message.hasOwnProperty("messageBatchCreatedEventData")) { + object.messageBatchCreatedEventData = $root.google.chat.v1.MessageBatchCreatedEventData.toObject(message.messageBatchCreatedEventData, options); + if (options.oneofs) + object.payload = "messageBatchCreatedEventData"; + } + if (message.messageBatchUpdatedEventData != null && message.hasOwnProperty("messageBatchUpdatedEventData")) { + object.messageBatchUpdatedEventData = $root.google.chat.v1.MessageBatchUpdatedEventData.toObject(message.messageBatchUpdatedEventData, options); + if (options.oneofs) + object.payload = "messageBatchUpdatedEventData"; + } + if (message.messageBatchDeletedEventData != null && message.hasOwnProperty("messageBatchDeletedEventData")) { + object.messageBatchDeletedEventData = $root.google.chat.v1.MessageBatchDeletedEventData.toObject(message.messageBatchDeletedEventData, options); + if (options.oneofs) + object.payload = "messageBatchDeletedEventData"; + } + if (message.spaceBatchUpdatedEventData != null && message.hasOwnProperty("spaceBatchUpdatedEventData")) { + object.spaceBatchUpdatedEventData = $root.google.chat.v1.SpaceBatchUpdatedEventData.toObject(message.spaceBatchUpdatedEventData, options); + if (options.oneofs) + object.payload = "spaceBatchUpdatedEventData"; + } + if (message.membershipBatchCreatedEventData != null && message.hasOwnProperty("membershipBatchCreatedEventData")) { + object.membershipBatchCreatedEventData = $root.google.chat.v1.MembershipBatchCreatedEventData.toObject(message.membershipBatchCreatedEventData, options); + if (options.oneofs) + object.payload = "membershipBatchCreatedEventData"; + } + if (message.membershipBatchUpdatedEventData != null && message.hasOwnProperty("membershipBatchUpdatedEventData")) { + object.membershipBatchUpdatedEventData = $root.google.chat.v1.MembershipBatchUpdatedEventData.toObject(message.membershipBatchUpdatedEventData, options); + if (options.oneofs) + object.payload = "membershipBatchUpdatedEventData"; + } + if (message.membershipBatchDeletedEventData != null && message.hasOwnProperty("membershipBatchDeletedEventData")) { + object.membershipBatchDeletedEventData = $root.google.chat.v1.MembershipBatchDeletedEventData.toObject(message.membershipBatchDeletedEventData, options); + if (options.oneofs) + object.payload = "membershipBatchDeletedEventData"; + } + if (message.reactionBatchCreatedEventData != null && message.hasOwnProperty("reactionBatchCreatedEventData")) { + object.reactionBatchCreatedEventData = $root.google.chat.v1.ReactionBatchCreatedEventData.toObject(message.reactionBatchCreatedEventData, options); + if (options.oneofs) + object.payload = "reactionBatchCreatedEventData"; + } + if (message.reactionBatchDeletedEventData != null && message.hasOwnProperty("reactionBatchDeletedEventData")) { + object.reactionBatchDeletedEventData = $root.google.chat.v1.ReactionBatchDeletedEventData.toObject(message.reactionBatchDeletedEventData, options); + if (options.oneofs) + object.payload = "reactionBatchDeletedEventData"; + } + if (message.membershipDeletedEventData != null && message.hasOwnProperty("membershipDeletedEventData")) { + object.membershipDeletedEventData = $root.google.chat.v1.MembershipDeletedEventData.toObject(message.membershipDeletedEventData, options); + if (options.oneofs) + object.payload = "membershipDeletedEventData"; + } + return object; + }; + + /** + * Converts this SpaceEvent to JSON. + * @function toJSON + * @memberof google.chat.v1.SpaceEvent + * @instance + * @returns {Object.} JSON object + */ + SpaceEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpaceEvent + * @function getTypeUrl + * @memberof google.chat.v1.SpaceEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpaceEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.SpaceEvent"; + }; + + return SpaceEvent; + })(); + + v1.GetSpaceEventRequest = (function() { + + /** + * Properties of a GetSpaceEventRequest. + * @memberof google.chat.v1 + * @interface IGetSpaceEventRequest + * @property {string|null} [name] GetSpaceEventRequest name + */ + + /** + * Constructs a new GetSpaceEventRequest. + * @memberof google.chat.v1 + * @classdesc Represents a GetSpaceEventRequest. + * @implements IGetSpaceEventRequest + * @constructor + * @param {google.chat.v1.IGetSpaceEventRequest=} [properties] Properties to set + */ + function GetSpaceEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSpaceEventRequest name. + * @member {string} name + * @memberof google.chat.v1.GetSpaceEventRequest + * @instance + */ + GetSpaceEventRequest.prototype.name = ""; + + /** + * Creates a new GetSpaceEventRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.GetSpaceEventRequest + * @static + * @param {google.chat.v1.IGetSpaceEventRequest=} [properties] Properties to set + * @returns {google.chat.v1.GetSpaceEventRequest} GetSpaceEventRequest instance + */ + GetSpaceEventRequest.create = function create(properties) { + return new GetSpaceEventRequest(properties); + }; + + /** + * Encodes the specified GetSpaceEventRequest message. Does not implicitly {@link google.chat.v1.GetSpaceEventRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.GetSpaceEventRequest + * @static + * @param {google.chat.v1.IGetSpaceEventRequest} message GetSpaceEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpaceEventRequest.encode = function encode(message, writer) { + 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 GetSpaceEventRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetSpaceEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.GetSpaceEventRequest + * @static + * @param {google.chat.v1.IGetSpaceEventRequest} message GetSpaceEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpaceEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSpaceEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.GetSpaceEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.GetSpaceEventRequest} GetSpaceEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpaceEventRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetSpaceEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSpaceEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.GetSpaceEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.GetSpaceEventRequest} GetSpaceEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpaceEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSpaceEventRequest message. + * @function verify + * @memberof google.chat.v1.GetSpaceEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSpaceEventRequest.verify = function verify(message) { + if (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 GetSpaceEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.GetSpaceEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.GetSpaceEventRequest} GetSpaceEventRequest + */ + GetSpaceEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.GetSpaceEventRequest) + return object; + var message = new $root.google.chat.v1.GetSpaceEventRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSpaceEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.GetSpaceEventRequest + * @static + * @param {google.chat.v1.GetSpaceEventRequest} message GetSpaceEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSpaceEventRequest.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 GetSpaceEventRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.GetSpaceEventRequest + * @instance + * @returns {Object.} JSON object + */ + GetSpaceEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSpaceEventRequest + * @function getTypeUrl + * @memberof google.chat.v1.GetSpaceEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSpaceEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.GetSpaceEventRequest"; + }; + + return GetSpaceEventRequest; + })(); + + v1.ListSpaceEventsRequest = (function() { + + /** + * Properties of a ListSpaceEventsRequest. + * @memberof google.chat.v1 + * @interface IListSpaceEventsRequest + * @property {string|null} [parent] ListSpaceEventsRequest parent + * @property {number|null} [pageSize] ListSpaceEventsRequest pageSize + * @property {string|null} [pageToken] ListSpaceEventsRequest pageToken + * @property {string|null} [filter] ListSpaceEventsRequest filter + */ + + /** + * Constructs a new ListSpaceEventsRequest. + * @memberof google.chat.v1 + * @classdesc Represents a ListSpaceEventsRequest. + * @implements IListSpaceEventsRequest + * @constructor + * @param {google.chat.v1.IListSpaceEventsRequest=} [properties] Properties to set + */ + function ListSpaceEventsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSpaceEventsRequest parent. + * @member {string} parent + * @memberof google.chat.v1.ListSpaceEventsRequest + * @instance + */ + ListSpaceEventsRequest.prototype.parent = ""; + + /** + * ListSpaceEventsRequest pageSize. + * @member {number} pageSize + * @memberof google.chat.v1.ListSpaceEventsRequest + * @instance + */ + ListSpaceEventsRequest.prototype.pageSize = 0; + + /** + * ListSpaceEventsRequest pageToken. + * @member {string} pageToken + * @memberof google.chat.v1.ListSpaceEventsRequest + * @instance + */ + ListSpaceEventsRequest.prototype.pageToken = ""; + + /** + * ListSpaceEventsRequest filter. + * @member {string} filter + * @memberof google.chat.v1.ListSpaceEventsRequest + * @instance + */ + ListSpaceEventsRequest.prototype.filter = ""; + + /** + * Creates a new ListSpaceEventsRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListSpaceEventsRequest + * @static + * @param {google.chat.v1.IListSpaceEventsRequest=} [properties] Properties to set + * @returns {google.chat.v1.ListSpaceEventsRequest} ListSpaceEventsRequest instance + */ + ListSpaceEventsRequest.create = function create(properties) { + return new ListSpaceEventsRequest(properties); + }; + + /** + * Encodes the specified ListSpaceEventsRequest message. Does not implicitly {@link google.chat.v1.ListSpaceEventsRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListSpaceEventsRequest + * @static + * @param {google.chat.v1.IListSpaceEventsRequest} message ListSpaceEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpaceEventsRequest.encode = function encode(message, writer) { + if (!writer) + 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 5, wireType 0 =*/40).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListSpaceEventsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListSpaceEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListSpaceEventsRequest + * @static + * @param {google.chat.v1.IListSpaceEventsRequest} message ListSpaceEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpaceEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSpaceEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListSpaceEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListSpaceEventsRequest} ListSpaceEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpaceEventsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListSpaceEventsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 5: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSpaceEventsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListSpaceEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListSpaceEventsRequest} ListSpaceEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpaceEventsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSpaceEventsRequest message. + * @function verify + * @memberof google.chat.v1.ListSpaceEventsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSpaceEventsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListSpaceEventsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListSpaceEventsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListSpaceEventsRequest} ListSpaceEventsRequest + */ + ListSpaceEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListSpaceEventsRequest) + return object; + var message = new $root.google.chat.v1.ListSpaceEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListSpaceEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListSpaceEventsRequest + * @static + * @param {google.chat.v1.ListSpaceEventsRequest} message ListSpaceEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSpaceEventsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListSpaceEventsRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.ListSpaceEventsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSpaceEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSpaceEventsRequest + * @function getTypeUrl + * @memberof google.chat.v1.ListSpaceEventsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSpaceEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListSpaceEventsRequest"; + }; + + return ListSpaceEventsRequest; + })(); + + v1.ListSpaceEventsResponse = (function() { + + /** + * Properties of a ListSpaceEventsResponse. + * @memberof google.chat.v1 + * @interface IListSpaceEventsResponse + * @property {Array.|null} [spaceEvents] ListSpaceEventsResponse spaceEvents + * @property {string|null} [nextPageToken] ListSpaceEventsResponse nextPageToken + */ + + /** + * Constructs a new ListSpaceEventsResponse. + * @memberof google.chat.v1 + * @classdesc Represents a ListSpaceEventsResponse. + * @implements IListSpaceEventsResponse + * @constructor + * @param {google.chat.v1.IListSpaceEventsResponse=} [properties] Properties to set + */ + function ListSpaceEventsResponse(properties) { + this.spaceEvents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSpaceEventsResponse spaceEvents. + * @member {Array.} spaceEvents + * @memberof google.chat.v1.ListSpaceEventsResponse + * @instance + */ + ListSpaceEventsResponse.prototype.spaceEvents = $util.emptyArray; + + /** + * ListSpaceEventsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.chat.v1.ListSpaceEventsResponse + * @instance + */ + ListSpaceEventsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSpaceEventsResponse instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListSpaceEventsResponse + * @static + * @param {google.chat.v1.IListSpaceEventsResponse=} [properties] Properties to set + * @returns {google.chat.v1.ListSpaceEventsResponse} ListSpaceEventsResponse instance + */ + ListSpaceEventsResponse.create = function create(properties) { + return new ListSpaceEventsResponse(properties); + }; + + /** + * Encodes the specified ListSpaceEventsResponse message. Does not implicitly {@link google.chat.v1.ListSpaceEventsResponse.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListSpaceEventsResponse + * @static + * @param {google.chat.v1.IListSpaceEventsResponse} message ListSpaceEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpaceEventsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spaceEvents != null && message.spaceEvents.length) + for (var i = 0; i < message.spaceEvents.length; ++i) + $root.google.chat.v1.SpaceEvent.encode(message.spaceEvents[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 ListSpaceEventsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListSpaceEventsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListSpaceEventsResponse + * @static + * @param {google.chat.v1.IListSpaceEventsResponse} message ListSpaceEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpaceEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSpaceEventsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListSpaceEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListSpaceEventsResponse} ListSpaceEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpaceEventsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListSpaceEventsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.spaceEvents && message.spaceEvents.length)) + message.spaceEvents = []; + message.spaceEvents.push($root.google.chat.v1.SpaceEvent.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSpaceEventsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListSpaceEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListSpaceEventsResponse} ListSpaceEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpaceEventsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSpaceEventsResponse message. + * @function verify + * @memberof google.chat.v1.ListSpaceEventsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSpaceEventsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spaceEvents != null && message.hasOwnProperty("spaceEvents")) { + if (!Array.isArray(message.spaceEvents)) + return "spaceEvents: array expected"; + for (var i = 0; i < message.spaceEvents.length; ++i) { + var error = $root.google.chat.v1.SpaceEvent.verify(message.spaceEvents[i]); + if (error) + return "spaceEvents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSpaceEventsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListSpaceEventsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListSpaceEventsResponse} ListSpaceEventsResponse + */ + ListSpaceEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListSpaceEventsResponse) + return object; + var message = new $root.google.chat.v1.ListSpaceEventsResponse(); + if (object.spaceEvents) { + if (!Array.isArray(object.spaceEvents)) + throw TypeError(".google.chat.v1.ListSpaceEventsResponse.spaceEvents: array expected"); + message.spaceEvents = []; + for (var i = 0; i < object.spaceEvents.length; ++i) { + if (typeof object.spaceEvents[i] !== "object") + throw TypeError(".google.chat.v1.ListSpaceEventsResponse.spaceEvents: object expected"); + message.spaceEvents[i] = $root.google.chat.v1.SpaceEvent.fromObject(object.spaceEvents[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSpaceEventsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListSpaceEventsResponse + * @static + * @param {google.chat.v1.ListSpaceEventsResponse} message ListSpaceEventsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSpaceEventsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.spaceEvents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.spaceEvents && message.spaceEvents.length) { + object.spaceEvents = []; + for (var j = 0; j < message.spaceEvents.length; ++j) + object.spaceEvents[j] = $root.google.chat.v1.SpaceEvent.toObject(message.spaceEvents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSpaceEventsResponse to JSON. + * @function toJSON + * @memberof google.chat.v1.ListSpaceEventsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSpaceEventsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSpaceEventsResponse + * @function getTypeUrl + * @memberof google.chat.v1.ListSpaceEventsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSpaceEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListSpaceEventsResponse"; + }; + + return ListSpaceEventsResponse; + })(); + + v1.MembershipCreatedEventData = (function() { + + /** + * Properties of a MembershipCreatedEventData. + * @memberof google.chat.v1 + * @interface IMembershipCreatedEventData + * @property {google.chat.v1.IMembership|null} [membership] MembershipCreatedEventData membership + */ + + /** + * Constructs a new MembershipCreatedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a MembershipCreatedEventData. + * @implements IMembershipCreatedEventData + * @constructor + * @param {google.chat.v1.IMembershipCreatedEventData=} [properties] Properties to set + */ + function MembershipCreatedEventData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MembershipCreatedEventData membership. + * @member {google.chat.v1.IMembership|null|undefined} membership + * @memberof google.chat.v1.MembershipCreatedEventData + * @instance + */ + MembershipCreatedEventData.prototype.membership = null; + + /** + * Creates a new MembershipCreatedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.MembershipCreatedEventData + * @static + * @param {google.chat.v1.IMembershipCreatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MembershipCreatedEventData} MembershipCreatedEventData instance + */ + MembershipCreatedEventData.create = function create(properties) { + return new MembershipCreatedEventData(properties); + }; + + /** + * Encodes the specified MembershipCreatedEventData message. Does not implicitly {@link google.chat.v1.MembershipCreatedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MembershipCreatedEventData + * @static + * @param {google.chat.v1.IMembershipCreatedEventData} message MembershipCreatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipCreatedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + $root.google.chat.v1.Membership.encode(message.membership, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MembershipCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipCreatedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MembershipCreatedEventData + * @static + * @param {google.chat.v1.IMembershipCreatedEventData} message MembershipCreatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MembershipCreatedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MembershipCreatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MembershipCreatedEventData} MembershipCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipCreatedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipCreatedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MembershipCreatedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MembershipCreatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MembershipCreatedEventData} MembershipCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipCreatedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MembershipCreatedEventData message. + * @function verify + * @memberof google.chat.v1.MembershipCreatedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MembershipCreatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.membership != null && message.hasOwnProperty("membership")) { + var error = $root.google.chat.v1.Membership.verify(message.membership); + if (error) + return "membership." + error; + } + return null; + }; + + /** + * Creates a MembershipCreatedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MembershipCreatedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MembershipCreatedEventData} MembershipCreatedEventData + */ + MembershipCreatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MembershipCreatedEventData) + return object; + var message = new $root.google.chat.v1.MembershipCreatedEventData(); + if (object.membership != null) { + if (typeof object.membership !== "object") + throw TypeError(".google.chat.v1.MembershipCreatedEventData.membership: object expected"); + message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); + } + return message; + }; + + /** + * Creates a plain object from a MembershipCreatedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MembershipCreatedEventData + * @static + * @param {google.chat.v1.MembershipCreatedEventData} message MembershipCreatedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MembershipCreatedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.membership = null; + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); + return object; + }; + + /** + * Converts this MembershipCreatedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.MembershipCreatedEventData + * @instance + * @returns {Object.} JSON object + */ + MembershipCreatedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MembershipCreatedEventData + * @function getTypeUrl + * @memberof google.chat.v1.MembershipCreatedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MembershipCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MembershipCreatedEventData"; + }; + + return MembershipCreatedEventData; + })(); + + v1.MembershipDeletedEventData = (function() { + + /** + * Properties of a MembershipDeletedEventData. + * @memberof google.chat.v1 + * @interface IMembershipDeletedEventData + * @property {google.chat.v1.IMembership|null} [membership] MembershipDeletedEventData membership + */ + + /** + * Constructs a new MembershipDeletedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a MembershipDeletedEventData. + * @implements IMembershipDeletedEventData + * @constructor + * @param {google.chat.v1.IMembershipDeletedEventData=} [properties] Properties to set + */ + function MembershipDeletedEventData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MembershipDeletedEventData membership. + * @member {google.chat.v1.IMembership|null|undefined} membership + * @memberof google.chat.v1.MembershipDeletedEventData + * @instance + */ + MembershipDeletedEventData.prototype.membership = null; + + /** + * Creates a new MembershipDeletedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.MembershipDeletedEventData + * @static + * @param {google.chat.v1.IMembershipDeletedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MembershipDeletedEventData} MembershipDeletedEventData instance + */ + MembershipDeletedEventData.create = function create(properties) { + return new MembershipDeletedEventData(properties); + }; + + /** + * Encodes the specified MembershipDeletedEventData message. Does not implicitly {@link google.chat.v1.MembershipDeletedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MembershipDeletedEventData + * @static + * @param {google.chat.v1.IMembershipDeletedEventData} message MembershipDeletedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipDeletedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + $root.google.chat.v1.Membership.encode(message.membership, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MembershipDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipDeletedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MembershipDeletedEventData + * @static + * @param {google.chat.v1.IMembershipDeletedEventData} message MembershipDeletedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MembershipDeletedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MembershipDeletedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MembershipDeletedEventData} MembershipDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipDeletedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipDeletedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MembershipDeletedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MembershipDeletedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MembershipDeletedEventData} MembershipDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipDeletedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MembershipDeletedEventData message. + * @function verify + * @memberof google.chat.v1.MembershipDeletedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MembershipDeletedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.membership != null && message.hasOwnProperty("membership")) { + var error = $root.google.chat.v1.Membership.verify(message.membership); + if (error) + return "membership." + error; + } + return null; + }; + + /** + * Creates a MembershipDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MembershipDeletedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MembershipDeletedEventData} MembershipDeletedEventData + */ + MembershipDeletedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MembershipDeletedEventData) + return object; + var message = new $root.google.chat.v1.MembershipDeletedEventData(); + if (object.membership != null) { + if (typeof object.membership !== "object") + throw TypeError(".google.chat.v1.MembershipDeletedEventData.membership: object expected"); + message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); + } + return message; + }; + + /** + * Creates a plain object from a MembershipDeletedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MembershipDeletedEventData + * @static + * @param {google.chat.v1.MembershipDeletedEventData} message MembershipDeletedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MembershipDeletedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.membership = null; + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); + return object; + }; + + /** + * Converts this MembershipDeletedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.MembershipDeletedEventData + * @instance + * @returns {Object.} JSON object + */ + MembershipDeletedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MembershipDeletedEventData + * @function getTypeUrl + * @memberof google.chat.v1.MembershipDeletedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MembershipDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MembershipDeletedEventData"; + }; + + return MembershipDeletedEventData; + })(); + + v1.MembershipUpdatedEventData = (function() { + + /** + * Properties of a MembershipUpdatedEventData. + * @memberof google.chat.v1 + * @interface IMembershipUpdatedEventData + * @property {google.chat.v1.IMembership|null} [membership] MembershipUpdatedEventData membership + */ + + /** + * Constructs a new MembershipUpdatedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a MembershipUpdatedEventData. + * @implements IMembershipUpdatedEventData + * @constructor + * @param {google.chat.v1.IMembershipUpdatedEventData=} [properties] Properties to set + */ + function MembershipUpdatedEventData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MembershipUpdatedEventData membership. + * @member {google.chat.v1.IMembership|null|undefined} membership + * @memberof google.chat.v1.MembershipUpdatedEventData + * @instance + */ + MembershipUpdatedEventData.prototype.membership = null; + + /** + * Creates a new MembershipUpdatedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.MembershipUpdatedEventData + * @static + * @param {google.chat.v1.IMembershipUpdatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MembershipUpdatedEventData} MembershipUpdatedEventData instance + */ + MembershipUpdatedEventData.create = function create(properties) { + return new MembershipUpdatedEventData(properties); + }; + + /** + * Encodes the specified MembershipUpdatedEventData message. Does not implicitly {@link google.chat.v1.MembershipUpdatedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MembershipUpdatedEventData + * @static + * @param {google.chat.v1.IMembershipUpdatedEventData} message MembershipUpdatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipUpdatedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + $root.google.chat.v1.Membership.encode(message.membership, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MembershipUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipUpdatedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MembershipUpdatedEventData + * @static + * @param {google.chat.v1.IMembershipUpdatedEventData} message MembershipUpdatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MembershipUpdatedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MembershipUpdatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MembershipUpdatedEventData} MembershipUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipUpdatedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipUpdatedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MembershipUpdatedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MembershipUpdatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MembershipUpdatedEventData} MembershipUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MembershipUpdatedEventData message. + * @function verify + * @memberof google.chat.v1.MembershipUpdatedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MembershipUpdatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.membership != null && message.hasOwnProperty("membership")) { + var error = $root.google.chat.v1.Membership.verify(message.membership); + if (error) + return "membership." + error; + } + return null; + }; + + /** + * Creates a MembershipUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MembershipUpdatedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MembershipUpdatedEventData} MembershipUpdatedEventData + */ + MembershipUpdatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MembershipUpdatedEventData) + return object; + var message = new $root.google.chat.v1.MembershipUpdatedEventData(); + if (object.membership != null) { + if (typeof object.membership !== "object") + throw TypeError(".google.chat.v1.MembershipUpdatedEventData.membership: object expected"); + message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); + } + return message; + }; + + /** + * Creates a plain object from a MembershipUpdatedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MembershipUpdatedEventData + * @static + * @param {google.chat.v1.MembershipUpdatedEventData} message MembershipUpdatedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MembershipUpdatedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.membership = null; + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); + return object; + }; + + /** + * Converts this MembershipUpdatedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.MembershipUpdatedEventData + * @instance + * @returns {Object.} JSON object + */ + MembershipUpdatedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MembershipUpdatedEventData + * @function getTypeUrl + * @memberof google.chat.v1.MembershipUpdatedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MembershipUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MembershipUpdatedEventData"; + }; + + return MembershipUpdatedEventData; + })(); + + v1.MembershipBatchCreatedEventData = (function() { + + /** + * Properties of a MembershipBatchCreatedEventData. + * @memberof google.chat.v1 + * @interface IMembershipBatchCreatedEventData + * @property {Array.|null} [memberships] MembershipBatchCreatedEventData memberships + */ + + /** + * Constructs a new MembershipBatchCreatedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a MembershipBatchCreatedEventData. + * @implements IMembershipBatchCreatedEventData + * @constructor + * @param {google.chat.v1.IMembershipBatchCreatedEventData=} [properties] Properties to set + */ + function MembershipBatchCreatedEventData(properties) { + this.memberships = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MembershipBatchCreatedEventData memberships. + * @member {Array.} memberships + * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @instance + */ + MembershipBatchCreatedEventData.prototype.memberships = $util.emptyArray; + + /** + * Creates a new MembershipBatchCreatedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @static + * @param {google.chat.v1.IMembershipBatchCreatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MembershipBatchCreatedEventData} MembershipBatchCreatedEventData instance + */ + MembershipBatchCreatedEventData.create = function create(properties) { + return new MembershipBatchCreatedEventData(properties); + }; + + /** + * Encodes the specified MembershipBatchCreatedEventData message. Does not implicitly {@link google.chat.v1.MembershipBatchCreatedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @static + * @param {google.chat.v1.IMembershipBatchCreatedEventData} message MembershipBatchCreatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipBatchCreatedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memberships != null && message.memberships.length) + for (var i = 0; i < message.memberships.length; ++i) + $root.google.chat.v1.MembershipCreatedEventData.encode(message.memberships[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MembershipBatchCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipBatchCreatedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @static + * @param {google.chat.v1.IMembershipBatchCreatedEventData} message MembershipBatchCreatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipBatchCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MembershipBatchCreatedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MembershipBatchCreatedEventData} MembershipBatchCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipBatchCreatedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipBatchCreatedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.memberships && message.memberships.length)) + message.memberships = []; + message.memberships.push($root.google.chat.v1.MembershipCreatedEventData.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MembershipBatchCreatedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MembershipBatchCreatedEventData} MembershipBatchCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipBatchCreatedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MembershipBatchCreatedEventData message. + * @function verify + * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MembershipBatchCreatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memberships != null && message.hasOwnProperty("memberships")) { + if (!Array.isArray(message.memberships)) + return "memberships: array expected"; + for (var i = 0; i < message.memberships.length; ++i) { + var error = $root.google.chat.v1.MembershipCreatedEventData.verify(message.memberships[i]); + if (error) + return "memberships." + error; + } + } + return null; + }; + + /** + * Creates a MembershipBatchCreatedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MembershipBatchCreatedEventData} MembershipBatchCreatedEventData + */ + MembershipBatchCreatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MembershipBatchCreatedEventData) + return object; + var message = new $root.google.chat.v1.MembershipBatchCreatedEventData(); + if (object.memberships) { + if (!Array.isArray(object.memberships)) + throw TypeError(".google.chat.v1.MembershipBatchCreatedEventData.memberships: array expected"); + message.memberships = []; + for (var i = 0; i < object.memberships.length; ++i) { + if (typeof object.memberships[i] !== "object") + throw TypeError(".google.chat.v1.MembershipBatchCreatedEventData.memberships: object expected"); + message.memberships[i] = $root.google.chat.v1.MembershipCreatedEventData.fromObject(object.memberships[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MembershipBatchCreatedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @static + * @param {google.chat.v1.MembershipBatchCreatedEventData} message MembershipBatchCreatedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MembershipBatchCreatedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.memberships = []; + if (message.memberships && message.memberships.length) { + object.memberships = []; + for (var j = 0; j < message.memberships.length; ++j) + object.memberships[j] = $root.google.chat.v1.MembershipCreatedEventData.toObject(message.memberships[j], options); + } + return object; + }; + + /** + * Converts this MembershipBatchCreatedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @instance + * @returns {Object.} JSON object + */ + MembershipBatchCreatedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MembershipBatchCreatedEventData + * @function getTypeUrl + * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MembershipBatchCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MembershipBatchCreatedEventData"; + }; + + return MembershipBatchCreatedEventData; + })(); + + v1.MembershipBatchUpdatedEventData = (function() { + + /** + * Properties of a MembershipBatchUpdatedEventData. + * @memberof google.chat.v1 + * @interface IMembershipBatchUpdatedEventData + * @property {Array.|null} [memberships] MembershipBatchUpdatedEventData memberships + */ + + /** + * Constructs a new MembershipBatchUpdatedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a MembershipBatchUpdatedEventData. + * @implements IMembershipBatchUpdatedEventData + * @constructor + * @param {google.chat.v1.IMembershipBatchUpdatedEventData=} [properties] Properties to set + */ + function MembershipBatchUpdatedEventData(properties) { + this.memberships = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MembershipBatchUpdatedEventData memberships. + * @member {Array.} memberships + * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @instance + */ + MembershipBatchUpdatedEventData.prototype.memberships = $util.emptyArray; + + /** + * Creates a new MembershipBatchUpdatedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @static + * @param {google.chat.v1.IMembershipBatchUpdatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MembershipBatchUpdatedEventData} MembershipBatchUpdatedEventData instance + */ + MembershipBatchUpdatedEventData.create = function create(properties) { + return new MembershipBatchUpdatedEventData(properties); + }; + + /** + * Encodes the specified MembershipBatchUpdatedEventData message. Does not implicitly {@link google.chat.v1.MembershipBatchUpdatedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @static + * @param {google.chat.v1.IMembershipBatchUpdatedEventData} message MembershipBatchUpdatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipBatchUpdatedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memberships != null && message.memberships.length) + for (var i = 0; i < message.memberships.length; ++i) + $root.google.chat.v1.MembershipUpdatedEventData.encode(message.memberships[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MembershipBatchUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipBatchUpdatedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @static + * @param {google.chat.v1.IMembershipBatchUpdatedEventData} message MembershipBatchUpdatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipBatchUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MembershipBatchUpdatedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MembershipBatchUpdatedEventData} MembershipBatchUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipBatchUpdatedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipBatchUpdatedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.memberships && message.memberships.length)) + message.memberships = []; + message.memberships.push($root.google.chat.v1.MembershipUpdatedEventData.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MembershipBatchUpdatedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MembershipBatchUpdatedEventData} MembershipBatchUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipBatchUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MembershipBatchUpdatedEventData message. + * @function verify + * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MembershipBatchUpdatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memberships != null && message.hasOwnProperty("memberships")) { + if (!Array.isArray(message.memberships)) + return "memberships: array expected"; + for (var i = 0; i < message.memberships.length; ++i) { + var error = $root.google.chat.v1.MembershipUpdatedEventData.verify(message.memberships[i]); + if (error) + return "memberships." + error; + } + } + return null; + }; + + /** + * Creates a MembershipBatchUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MembershipBatchUpdatedEventData} MembershipBatchUpdatedEventData + */ + MembershipBatchUpdatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MembershipBatchUpdatedEventData) + return object; + var message = new $root.google.chat.v1.MembershipBatchUpdatedEventData(); + if (object.memberships) { + if (!Array.isArray(object.memberships)) + throw TypeError(".google.chat.v1.MembershipBatchUpdatedEventData.memberships: array expected"); + message.memberships = []; + for (var i = 0; i < object.memberships.length; ++i) { + if (typeof object.memberships[i] !== "object") + throw TypeError(".google.chat.v1.MembershipBatchUpdatedEventData.memberships: object expected"); + message.memberships[i] = $root.google.chat.v1.MembershipUpdatedEventData.fromObject(object.memberships[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MembershipBatchUpdatedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @static + * @param {google.chat.v1.MembershipBatchUpdatedEventData} message MembershipBatchUpdatedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MembershipBatchUpdatedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.memberships = []; + if (message.memberships && message.memberships.length) { + object.memberships = []; + for (var j = 0; j < message.memberships.length; ++j) + object.memberships[j] = $root.google.chat.v1.MembershipUpdatedEventData.toObject(message.memberships[j], options); + } + return object; + }; + + /** + * Converts this MembershipBatchUpdatedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @instance + * @returns {Object.} JSON object + */ + MembershipBatchUpdatedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MembershipBatchUpdatedEventData + * @function getTypeUrl + * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MembershipBatchUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MembershipBatchUpdatedEventData"; + }; + + return MembershipBatchUpdatedEventData; + })(); + + v1.MembershipBatchDeletedEventData = (function() { + + /** + * Properties of a MembershipBatchDeletedEventData. + * @memberof google.chat.v1 + * @interface IMembershipBatchDeletedEventData + * @property {Array.|null} [memberships] MembershipBatchDeletedEventData memberships + */ + + /** + * Constructs a new MembershipBatchDeletedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a MembershipBatchDeletedEventData. + * @implements IMembershipBatchDeletedEventData + * @constructor + * @param {google.chat.v1.IMembershipBatchDeletedEventData=} [properties] Properties to set + */ + function MembershipBatchDeletedEventData(properties) { + this.memberships = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MembershipBatchDeletedEventData memberships. + * @member {Array.} memberships + * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @instance + */ + MembershipBatchDeletedEventData.prototype.memberships = $util.emptyArray; + + /** + * Creates a new MembershipBatchDeletedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @static + * @param {google.chat.v1.IMembershipBatchDeletedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MembershipBatchDeletedEventData} MembershipBatchDeletedEventData instance + */ + MembershipBatchDeletedEventData.create = function create(properties) { + return new MembershipBatchDeletedEventData(properties); + }; + + /** + * Encodes the specified MembershipBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.MembershipBatchDeletedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @static + * @param {google.chat.v1.IMembershipBatchDeletedEventData} message MembershipBatchDeletedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipBatchDeletedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memberships != null && message.memberships.length) + for (var i = 0; i < message.memberships.length; ++i) + $root.google.chat.v1.MembershipDeletedEventData.encode(message.memberships[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MembershipBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipBatchDeletedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @static + * @param {google.chat.v1.IMembershipBatchDeletedEventData} message MembershipBatchDeletedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipBatchDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MembershipBatchDeletedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MembershipBatchDeletedEventData} MembershipBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipBatchDeletedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipBatchDeletedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.memberships && message.memberships.length)) + message.memberships = []; + message.memberships.push($root.google.chat.v1.MembershipDeletedEventData.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MembershipBatchDeletedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MembershipBatchDeletedEventData} MembershipBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipBatchDeletedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MembershipBatchDeletedEventData message. + * @function verify + * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MembershipBatchDeletedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memberships != null && message.hasOwnProperty("memberships")) { + if (!Array.isArray(message.memberships)) + return "memberships: array expected"; + for (var i = 0; i < message.memberships.length; ++i) { + var error = $root.google.chat.v1.MembershipDeletedEventData.verify(message.memberships[i]); + if (error) + return "memberships." + error; + } + } + return null; + }; + + /** + * Creates a MembershipBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MembershipBatchDeletedEventData} MembershipBatchDeletedEventData + */ + MembershipBatchDeletedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MembershipBatchDeletedEventData) + return object; + var message = new $root.google.chat.v1.MembershipBatchDeletedEventData(); + if (object.memberships) { + if (!Array.isArray(object.memberships)) + throw TypeError(".google.chat.v1.MembershipBatchDeletedEventData.memberships: array expected"); + message.memberships = []; + for (var i = 0; i < object.memberships.length; ++i) { + if (typeof object.memberships[i] !== "object") + throw TypeError(".google.chat.v1.MembershipBatchDeletedEventData.memberships: object expected"); + message.memberships[i] = $root.google.chat.v1.MembershipDeletedEventData.fromObject(object.memberships[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MembershipBatchDeletedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @static + * @param {google.chat.v1.MembershipBatchDeletedEventData} message MembershipBatchDeletedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MembershipBatchDeletedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.memberships = []; + if (message.memberships && message.memberships.length) { + object.memberships = []; + for (var j = 0; j < message.memberships.length; ++j) + object.memberships[j] = $root.google.chat.v1.MembershipDeletedEventData.toObject(message.memberships[j], options); + } + return object; + }; + + /** + * Converts this MembershipBatchDeletedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @instance + * @returns {Object.} JSON object + */ + MembershipBatchDeletedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MembershipBatchDeletedEventData + * @function getTypeUrl + * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MembershipBatchDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MembershipBatchDeletedEventData"; + }; + + return MembershipBatchDeletedEventData; + })(); + + v1.MessageCreatedEventData = (function() { + + /** + * Properties of a MessageCreatedEventData. + * @memberof google.chat.v1 + * @interface IMessageCreatedEventData + * @property {google.chat.v1.IMessage|null} [message] MessageCreatedEventData message + */ + + /** + * Constructs a new MessageCreatedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a MessageCreatedEventData. + * @implements IMessageCreatedEventData + * @constructor + * @param {google.chat.v1.IMessageCreatedEventData=} [properties] Properties to set + */ + function MessageCreatedEventData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageCreatedEventData message. + * @member {google.chat.v1.IMessage|null|undefined} message + * @memberof google.chat.v1.MessageCreatedEventData + * @instance + */ + MessageCreatedEventData.prototype.message = null; + + /** + * Creates a new MessageCreatedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.MessageCreatedEventData + * @static + * @param {google.chat.v1.IMessageCreatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MessageCreatedEventData} MessageCreatedEventData instance + */ + MessageCreatedEventData.create = function create(properties) { + return new MessageCreatedEventData(properties); + }; + + /** + * Encodes the specified MessageCreatedEventData message. Does not implicitly {@link google.chat.v1.MessageCreatedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MessageCreatedEventData + * @static + * @param {google.chat.v1.IMessageCreatedEventData} message MessageCreatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageCreatedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.chat.v1.Message.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageCreatedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MessageCreatedEventData + * @static + * @param {google.chat.v1.IMessageCreatedEventData} message MessageCreatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageCreatedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MessageCreatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MessageCreatedEventData} MessageCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageCreatedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageCreatedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageCreatedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MessageCreatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MessageCreatedEventData} MessageCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageCreatedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageCreatedEventData message. + * @function verify + * @memberof google.chat.v1.MessageCreatedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageCreatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.chat.v1.Message.verify(message.message); + if (error) + return "message." + error; + } + return null; + }; + + /** + * Creates a MessageCreatedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MessageCreatedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MessageCreatedEventData} MessageCreatedEventData + */ + MessageCreatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MessageCreatedEventData) + return object; + var message = new $root.google.chat.v1.MessageCreatedEventData(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.chat.v1.MessageCreatedEventData.message: object expected"); + message.message = $root.google.chat.v1.Message.fromObject(object.message); + } + return message; + }; + + /** + * Creates a plain object from a MessageCreatedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MessageCreatedEventData + * @static + * @param {google.chat.v1.MessageCreatedEventData} message MessageCreatedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageCreatedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.message = null; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.chat.v1.Message.toObject(message.message, options); + return object; + }; + + /** + * Converts this MessageCreatedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.MessageCreatedEventData + * @instance + * @returns {Object.} JSON object + */ + MessageCreatedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageCreatedEventData + * @function getTypeUrl + * @memberof google.chat.v1.MessageCreatedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MessageCreatedEventData"; + }; + + return MessageCreatedEventData; + })(); + + v1.MessageUpdatedEventData = (function() { + + /** + * Properties of a MessageUpdatedEventData. + * @memberof google.chat.v1 + * @interface IMessageUpdatedEventData + * @property {google.chat.v1.IMessage|null} [message] MessageUpdatedEventData message + */ + + /** + * Constructs a new MessageUpdatedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a MessageUpdatedEventData. + * @implements IMessageUpdatedEventData + * @constructor + * @param {google.chat.v1.IMessageUpdatedEventData=} [properties] Properties to set + */ + function MessageUpdatedEventData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageUpdatedEventData message. + * @member {google.chat.v1.IMessage|null|undefined} message + * @memberof google.chat.v1.MessageUpdatedEventData + * @instance + */ + MessageUpdatedEventData.prototype.message = null; + + /** + * Creates a new MessageUpdatedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.MessageUpdatedEventData + * @static + * @param {google.chat.v1.IMessageUpdatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MessageUpdatedEventData} MessageUpdatedEventData instance + */ + MessageUpdatedEventData.create = function create(properties) { + return new MessageUpdatedEventData(properties); + }; + + /** + * Encodes the specified MessageUpdatedEventData message. Does not implicitly {@link google.chat.v1.MessageUpdatedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MessageUpdatedEventData + * @static + * @param {google.chat.v1.IMessageUpdatedEventData} message MessageUpdatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageUpdatedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.chat.v1.Message.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageUpdatedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MessageUpdatedEventData + * @static + * @param {google.chat.v1.IMessageUpdatedEventData} message MessageUpdatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageUpdatedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MessageUpdatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MessageUpdatedEventData} MessageUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageUpdatedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageUpdatedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageUpdatedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MessageUpdatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MessageUpdatedEventData} MessageUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageUpdatedEventData message. + * @function verify + * @memberof google.chat.v1.MessageUpdatedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageUpdatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.chat.v1.Message.verify(message.message); + if (error) + return "message." + error; + } + return null; + }; + + /** + * Creates a MessageUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MessageUpdatedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MessageUpdatedEventData} MessageUpdatedEventData + */ + MessageUpdatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MessageUpdatedEventData) + return object; + var message = new $root.google.chat.v1.MessageUpdatedEventData(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.chat.v1.MessageUpdatedEventData.message: object expected"); + message.message = $root.google.chat.v1.Message.fromObject(object.message); + } + return message; + }; + + /** + * Creates a plain object from a MessageUpdatedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MessageUpdatedEventData + * @static + * @param {google.chat.v1.MessageUpdatedEventData} message MessageUpdatedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageUpdatedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.message = null; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.chat.v1.Message.toObject(message.message, options); + return object; + }; + + /** + * Converts this MessageUpdatedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.MessageUpdatedEventData + * @instance + * @returns {Object.} JSON object + */ + MessageUpdatedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageUpdatedEventData + * @function getTypeUrl + * @memberof google.chat.v1.MessageUpdatedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MessageUpdatedEventData"; + }; + + return MessageUpdatedEventData; + })(); + + v1.MessageDeletedEventData = (function() { + + /** + * Properties of a MessageDeletedEventData. + * @memberof google.chat.v1 + * @interface IMessageDeletedEventData + * @property {google.chat.v1.IMessage|null} [message] MessageDeletedEventData message + */ + + /** + * Constructs a new MessageDeletedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a MessageDeletedEventData. + * @implements IMessageDeletedEventData + * @constructor + * @param {google.chat.v1.IMessageDeletedEventData=} [properties] Properties to set + */ + function MessageDeletedEventData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageDeletedEventData message. + * @member {google.chat.v1.IMessage|null|undefined} message + * @memberof google.chat.v1.MessageDeletedEventData + * @instance + */ + MessageDeletedEventData.prototype.message = null; + + /** + * Creates a new MessageDeletedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.MessageDeletedEventData + * @static + * @param {google.chat.v1.IMessageDeletedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MessageDeletedEventData} MessageDeletedEventData instance + */ + MessageDeletedEventData.create = function create(properties) { + return new MessageDeletedEventData(properties); + }; + + /** + * Encodes the specified MessageDeletedEventData message. Does not implicitly {@link google.chat.v1.MessageDeletedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MessageDeletedEventData + * @static + * @param {google.chat.v1.IMessageDeletedEventData} message MessageDeletedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageDeletedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.chat.v1.Message.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageDeletedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MessageDeletedEventData + * @static + * @param {google.chat.v1.IMessageDeletedEventData} message MessageDeletedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageDeletedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MessageDeletedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MessageDeletedEventData} MessageDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageDeletedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageDeletedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageDeletedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MessageDeletedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MessageDeletedEventData} MessageDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageDeletedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageDeletedEventData message. + * @function verify + * @memberof google.chat.v1.MessageDeletedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageDeletedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.chat.v1.Message.verify(message.message); + if (error) + return "message." + error; + } + return null; + }; + + /** + * Creates a MessageDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MessageDeletedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MessageDeletedEventData} MessageDeletedEventData + */ + MessageDeletedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MessageDeletedEventData) + return object; + var message = new $root.google.chat.v1.MessageDeletedEventData(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.chat.v1.MessageDeletedEventData.message: object expected"); + message.message = $root.google.chat.v1.Message.fromObject(object.message); + } + return message; + }; + + /** + * Creates a plain object from a MessageDeletedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MessageDeletedEventData + * @static + * @param {google.chat.v1.MessageDeletedEventData} message MessageDeletedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageDeletedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.message = null; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.chat.v1.Message.toObject(message.message, options); + return object; + }; + + /** + * Converts this MessageDeletedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.MessageDeletedEventData + * @instance + * @returns {Object.} JSON object + */ + MessageDeletedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageDeletedEventData + * @function getTypeUrl + * @memberof google.chat.v1.MessageDeletedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MessageDeletedEventData"; + }; + + return MessageDeletedEventData; + })(); + + v1.MessageBatchCreatedEventData = (function() { + + /** + * Properties of a MessageBatchCreatedEventData. + * @memberof google.chat.v1 + * @interface IMessageBatchCreatedEventData + * @property {Array.|null} [messages] MessageBatchCreatedEventData messages + */ + + /** + * Constructs a new MessageBatchCreatedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a MessageBatchCreatedEventData. + * @implements IMessageBatchCreatedEventData + * @constructor + * @param {google.chat.v1.IMessageBatchCreatedEventData=} [properties] Properties to set + */ + function MessageBatchCreatedEventData(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageBatchCreatedEventData messages. + * @member {Array.} messages + * @memberof google.chat.v1.MessageBatchCreatedEventData + * @instance + */ + MessageBatchCreatedEventData.prototype.messages = $util.emptyArray; + + /** + * Creates a new MessageBatchCreatedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.MessageBatchCreatedEventData + * @static + * @param {google.chat.v1.IMessageBatchCreatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MessageBatchCreatedEventData} MessageBatchCreatedEventData instance + */ + MessageBatchCreatedEventData.create = function create(properties) { + return new MessageBatchCreatedEventData(properties); + }; + + /** + * Encodes the specified MessageBatchCreatedEventData message. Does not implicitly {@link google.chat.v1.MessageBatchCreatedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MessageBatchCreatedEventData + * @static + * @param {google.chat.v1.IMessageBatchCreatedEventData} message MessageBatchCreatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageBatchCreatedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.chat.v1.MessageCreatedEventData.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageBatchCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageBatchCreatedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MessageBatchCreatedEventData + * @static + * @param {google.chat.v1.IMessageBatchCreatedEventData} message MessageBatchCreatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageBatchCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageBatchCreatedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MessageBatchCreatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MessageBatchCreatedEventData} MessageBatchCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageBatchCreatedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageBatchCreatedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.chat.v1.MessageCreatedEventData.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageBatchCreatedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MessageBatchCreatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MessageBatchCreatedEventData} MessageBatchCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageBatchCreatedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageBatchCreatedEventData message. + * @function verify + * @memberof google.chat.v1.MessageBatchCreatedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageBatchCreatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.chat.v1.MessageCreatedEventData.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + return null; + }; + + /** + * Creates a MessageBatchCreatedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MessageBatchCreatedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MessageBatchCreatedEventData} MessageBatchCreatedEventData + */ + MessageBatchCreatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MessageBatchCreatedEventData) + return object; + var message = new $root.google.chat.v1.MessageBatchCreatedEventData(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.chat.v1.MessageBatchCreatedEventData.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.chat.v1.MessageBatchCreatedEventData.messages: object expected"); + message.messages[i] = $root.google.chat.v1.MessageCreatedEventData.fromObject(object.messages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MessageBatchCreatedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MessageBatchCreatedEventData + * @static + * @param {google.chat.v1.MessageBatchCreatedEventData} message MessageBatchCreatedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageBatchCreatedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.chat.v1.MessageCreatedEventData.toObject(message.messages[j], options); + } + return object; + }; + + /** + * Converts this MessageBatchCreatedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.MessageBatchCreatedEventData + * @instance + * @returns {Object.} JSON object + */ + MessageBatchCreatedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageBatchCreatedEventData + * @function getTypeUrl + * @memberof google.chat.v1.MessageBatchCreatedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageBatchCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MessageBatchCreatedEventData"; + }; + + return MessageBatchCreatedEventData; + })(); + + v1.MessageBatchUpdatedEventData = (function() { + + /** + * Properties of a MessageBatchUpdatedEventData. + * @memberof google.chat.v1 + * @interface IMessageBatchUpdatedEventData + * @property {Array.|null} [messages] MessageBatchUpdatedEventData messages + */ + + /** + * Constructs a new MessageBatchUpdatedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a MessageBatchUpdatedEventData. + * @implements IMessageBatchUpdatedEventData + * @constructor + * @param {google.chat.v1.IMessageBatchUpdatedEventData=} [properties] Properties to set + */ + function MessageBatchUpdatedEventData(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageBatchUpdatedEventData messages. + * @member {Array.} messages + * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @instance + */ + MessageBatchUpdatedEventData.prototype.messages = $util.emptyArray; + + /** + * Creates a new MessageBatchUpdatedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @static + * @param {google.chat.v1.IMessageBatchUpdatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MessageBatchUpdatedEventData} MessageBatchUpdatedEventData instance + */ + MessageBatchUpdatedEventData.create = function create(properties) { + return new MessageBatchUpdatedEventData(properties); + }; + + /** + * Encodes the specified MessageBatchUpdatedEventData message. Does not implicitly {@link google.chat.v1.MessageBatchUpdatedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @static + * @param {google.chat.v1.IMessageBatchUpdatedEventData} message MessageBatchUpdatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageBatchUpdatedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.chat.v1.MessageUpdatedEventData.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageBatchUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageBatchUpdatedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @static + * @param {google.chat.v1.IMessageBatchUpdatedEventData} message MessageBatchUpdatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageBatchUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageBatchUpdatedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MessageBatchUpdatedEventData} MessageBatchUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageBatchUpdatedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageBatchUpdatedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.chat.v1.MessageUpdatedEventData.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageBatchUpdatedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MessageBatchUpdatedEventData} MessageBatchUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageBatchUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageBatchUpdatedEventData message. + * @function verify + * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageBatchUpdatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.chat.v1.MessageUpdatedEventData.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + return null; + }; + + /** + * Creates a MessageBatchUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MessageBatchUpdatedEventData} MessageBatchUpdatedEventData + */ + MessageBatchUpdatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MessageBatchUpdatedEventData) + return object; + var message = new $root.google.chat.v1.MessageBatchUpdatedEventData(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.chat.v1.MessageBatchUpdatedEventData.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.chat.v1.MessageBatchUpdatedEventData.messages: object expected"); + message.messages[i] = $root.google.chat.v1.MessageUpdatedEventData.fromObject(object.messages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MessageBatchUpdatedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @static + * @param {google.chat.v1.MessageBatchUpdatedEventData} message MessageBatchUpdatedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageBatchUpdatedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.chat.v1.MessageUpdatedEventData.toObject(message.messages[j], options); + } + return object; + }; + + /** + * Converts this MessageBatchUpdatedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @instance + * @returns {Object.} JSON object + */ + MessageBatchUpdatedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageBatchUpdatedEventData + * @function getTypeUrl + * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageBatchUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MessageBatchUpdatedEventData"; + }; + + return MessageBatchUpdatedEventData; + })(); + + v1.MessageBatchDeletedEventData = (function() { + + /** + * Properties of a MessageBatchDeletedEventData. + * @memberof google.chat.v1 + * @interface IMessageBatchDeletedEventData + * @property {Array.|null} [messages] MessageBatchDeletedEventData messages + */ + + /** + * Constructs a new MessageBatchDeletedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a MessageBatchDeletedEventData. + * @implements IMessageBatchDeletedEventData + * @constructor + * @param {google.chat.v1.IMessageBatchDeletedEventData=} [properties] Properties to set + */ + function MessageBatchDeletedEventData(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageBatchDeletedEventData messages. + * @member {Array.} messages + * @memberof google.chat.v1.MessageBatchDeletedEventData + * @instance + */ + MessageBatchDeletedEventData.prototype.messages = $util.emptyArray; + + /** + * Creates a new MessageBatchDeletedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.MessageBatchDeletedEventData + * @static + * @param {google.chat.v1.IMessageBatchDeletedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MessageBatchDeletedEventData} MessageBatchDeletedEventData instance + */ + MessageBatchDeletedEventData.create = function create(properties) { + return new MessageBatchDeletedEventData(properties); + }; + + /** + * Encodes the specified MessageBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.MessageBatchDeletedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.MessageBatchDeletedEventData + * @static + * @param {google.chat.v1.IMessageBatchDeletedEventData} message MessageBatchDeletedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageBatchDeletedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.chat.v1.MessageDeletedEventData.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageBatchDeletedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.MessageBatchDeletedEventData + * @static + * @param {google.chat.v1.IMessageBatchDeletedEventData} message MessageBatchDeletedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageBatchDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageBatchDeletedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.MessageBatchDeletedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.MessageBatchDeletedEventData} MessageBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageBatchDeletedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageBatchDeletedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.chat.v1.MessageDeletedEventData.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageBatchDeletedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.MessageBatchDeletedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.MessageBatchDeletedEventData} MessageBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageBatchDeletedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageBatchDeletedEventData message. + * @function verify + * @memberof google.chat.v1.MessageBatchDeletedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageBatchDeletedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.chat.v1.MessageDeletedEventData.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + return null; + }; + + /** + * Creates a MessageBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.MessageBatchDeletedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.MessageBatchDeletedEventData} MessageBatchDeletedEventData + */ + MessageBatchDeletedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MessageBatchDeletedEventData) + return object; + var message = new $root.google.chat.v1.MessageBatchDeletedEventData(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.chat.v1.MessageBatchDeletedEventData.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.chat.v1.MessageBatchDeletedEventData.messages: object expected"); + message.messages[i] = $root.google.chat.v1.MessageDeletedEventData.fromObject(object.messages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MessageBatchDeletedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.MessageBatchDeletedEventData + * @static + * @param {google.chat.v1.MessageBatchDeletedEventData} message MessageBatchDeletedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageBatchDeletedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.chat.v1.MessageDeletedEventData.toObject(message.messages[j], options); + } + return object; + }; + + /** + * Converts this MessageBatchDeletedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.MessageBatchDeletedEventData + * @instance + * @returns {Object.} JSON object + */ + MessageBatchDeletedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageBatchDeletedEventData + * @function getTypeUrl + * @memberof google.chat.v1.MessageBatchDeletedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageBatchDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.MessageBatchDeletedEventData"; + }; + + return MessageBatchDeletedEventData; + })(); + + v1.SpaceUpdatedEventData = (function() { + + /** + * Properties of a SpaceUpdatedEventData. + * @memberof google.chat.v1 + * @interface ISpaceUpdatedEventData + * @property {google.chat.v1.ISpace|null} [space] SpaceUpdatedEventData space + */ + + /** + * Constructs a new SpaceUpdatedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a SpaceUpdatedEventData. + * @implements ISpaceUpdatedEventData + * @constructor + * @param {google.chat.v1.ISpaceUpdatedEventData=} [properties] Properties to set + */ + function SpaceUpdatedEventData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpaceUpdatedEventData space. + * @member {google.chat.v1.ISpace|null|undefined} space + * @memberof google.chat.v1.SpaceUpdatedEventData + * @instance + */ + SpaceUpdatedEventData.prototype.space = null; + + /** + * Creates a new SpaceUpdatedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.SpaceUpdatedEventData + * @static + * @param {google.chat.v1.ISpaceUpdatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.SpaceUpdatedEventData} SpaceUpdatedEventData instance + */ + SpaceUpdatedEventData.create = function create(properties) { + return new SpaceUpdatedEventData(properties); + }; + + /** + * Encodes the specified SpaceUpdatedEventData message. Does not implicitly {@link google.chat.v1.SpaceUpdatedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.SpaceUpdatedEventData + * @static + * @param {google.chat.v1.ISpaceUpdatedEventData} message SpaceUpdatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpaceUpdatedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.space != null && Object.hasOwnProperty.call(message, "space")) + $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpaceUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.SpaceUpdatedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.SpaceUpdatedEventData + * @static + * @param {google.chat.v1.ISpaceUpdatedEventData} message SpaceUpdatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpaceUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpaceUpdatedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.SpaceUpdatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.SpaceUpdatedEventData} SpaceUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpaceUpdatedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SpaceUpdatedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpaceUpdatedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.SpaceUpdatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.SpaceUpdatedEventData} SpaceUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpaceUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpaceUpdatedEventData message. + * @function verify + * @memberof google.chat.v1.SpaceUpdatedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpaceUpdatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.space != null && message.hasOwnProperty("space")) { + var error = $root.google.chat.v1.Space.verify(message.space); + if (error) + return "space." + error; + } + return null; + }; + + /** + * Creates a SpaceUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.SpaceUpdatedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.SpaceUpdatedEventData} SpaceUpdatedEventData + */ + SpaceUpdatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SpaceUpdatedEventData) + return object; + var message = new $root.google.chat.v1.SpaceUpdatedEventData(); + if (object.space != null) { + if (typeof object.space !== "object") + throw TypeError(".google.chat.v1.SpaceUpdatedEventData.space: object expected"); + message.space = $root.google.chat.v1.Space.fromObject(object.space); + } + return message; + }; + + /** + * Creates a plain object from a SpaceUpdatedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.SpaceUpdatedEventData + * @static + * @param {google.chat.v1.SpaceUpdatedEventData} message SpaceUpdatedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpaceUpdatedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.space = null; + if (message.space != null && message.hasOwnProperty("space")) + object.space = $root.google.chat.v1.Space.toObject(message.space, options); + return object; + }; + + /** + * Converts this SpaceUpdatedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.SpaceUpdatedEventData + * @instance + * @returns {Object.} JSON object + */ + SpaceUpdatedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpaceUpdatedEventData + * @function getTypeUrl + * @memberof google.chat.v1.SpaceUpdatedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpaceUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.SpaceUpdatedEventData"; + }; + + return SpaceUpdatedEventData; + })(); + + v1.SpaceBatchUpdatedEventData = (function() { + + /** + * Properties of a SpaceBatchUpdatedEventData. + * @memberof google.chat.v1 + * @interface ISpaceBatchUpdatedEventData + * @property {Array.|null} [spaces] SpaceBatchUpdatedEventData spaces + */ + + /** + * Constructs a new SpaceBatchUpdatedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a SpaceBatchUpdatedEventData. + * @implements ISpaceBatchUpdatedEventData + * @constructor + * @param {google.chat.v1.ISpaceBatchUpdatedEventData=} [properties] Properties to set + */ + function SpaceBatchUpdatedEventData(properties) { + this.spaces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpaceBatchUpdatedEventData spaces. + * @member {Array.} spaces + * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @instance + */ + SpaceBatchUpdatedEventData.prototype.spaces = $util.emptyArray; + + /** + * Creates a new SpaceBatchUpdatedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @static + * @param {google.chat.v1.ISpaceBatchUpdatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.SpaceBatchUpdatedEventData} SpaceBatchUpdatedEventData instance + */ + SpaceBatchUpdatedEventData.create = function create(properties) { + return new SpaceBatchUpdatedEventData(properties); + }; + + /** + * Encodes the specified SpaceBatchUpdatedEventData message. Does not implicitly {@link google.chat.v1.SpaceBatchUpdatedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @static + * @param {google.chat.v1.ISpaceBatchUpdatedEventData} message SpaceBatchUpdatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpaceBatchUpdatedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spaces != null && message.spaces.length) + for (var i = 0; i < message.spaces.length; ++i) + $root.google.chat.v1.SpaceUpdatedEventData.encode(message.spaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpaceBatchUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.SpaceBatchUpdatedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @static + * @param {google.chat.v1.ISpaceBatchUpdatedEventData} message SpaceBatchUpdatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpaceBatchUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpaceBatchUpdatedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.SpaceBatchUpdatedEventData} SpaceBatchUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpaceBatchUpdatedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SpaceBatchUpdatedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.spaces && message.spaces.length)) + message.spaces = []; + message.spaces.push($root.google.chat.v1.SpaceUpdatedEventData.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpaceBatchUpdatedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.SpaceBatchUpdatedEventData} SpaceBatchUpdatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpaceBatchUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpaceBatchUpdatedEventData message. + * @function verify + * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpaceBatchUpdatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spaces != null && message.hasOwnProperty("spaces")) { + if (!Array.isArray(message.spaces)) + return "spaces: array expected"; + for (var i = 0; i < message.spaces.length; ++i) { + var error = $root.google.chat.v1.SpaceUpdatedEventData.verify(message.spaces[i]); + if (error) + return "spaces." + error; + } + } + return null; + }; + + /** + * Creates a SpaceBatchUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.SpaceBatchUpdatedEventData} SpaceBatchUpdatedEventData + */ + SpaceBatchUpdatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SpaceBatchUpdatedEventData) + return object; + var message = new $root.google.chat.v1.SpaceBatchUpdatedEventData(); + if (object.spaces) { + if (!Array.isArray(object.spaces)) + throw TypeError(".google.chat.v1.SpaceBatchUpdatedEventData.spaces: array expected"); + message.spaces = []; + for (var i = 0; i < object.spaces.length; ++i) { + if (typeof object.spaces[i] !== "object") + throw TypeError(".google.chat.v1.SpaceBatchUpdatedEventData.spaces: object expected"); + message.spaces[i] = $root.google.chat.v1.SpaceUpdatedEventData.fromObject(object.spaces[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpaceBatchUpdatedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @static + * @param {google.chat.v1.SpaceBatchUpdatedEventData} message SpaceBatchUpdatedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpaceBatchUpdatedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.spaces = []; + if (message.spaces && message.spaces.length) { + object.spaces = []; + for (var j = 0; j < message.spaces.length; ++j) + object.spaces[j] = $root.google.chat.v1.SpaceUpdatedEventData.toObject(message.spaces[j], options); + } + return object; + }; + + /** + * Converts this SpaceBatchUpdatedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @instance + * @returns {Object.} JSON object + */ + SpaceBatchUpdatedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpaceBatchUpdatedEventData + * @function getTypeUrl + * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpaceBatchUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.SpaceBatchUpdatedEventData"; + }; + + return SpaceBatchUpdatedEventData; + })(); + + v1.ReactionCreatedEventData = (function() { + + /** + * Properties of a ReactionCreatedEventData. + * @memberof google.chat.v1 + * @interface IReactionCreatedEventData + * @property {google.chat.v1.IReaction|null} [reaction] ReactionCreatedEventData reaction + */ + + /** + * Constructs a new ReactionCreatedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a ReactionCreatedEventData. + * @implements IReactionCreatedEventData + * @constructor + * @param {google.chat.v1.IReactionCreatedEventData=} [properties] Properties to set + */ + function ReactionCreatedEventData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReactionCreatedEventData reaction. + * @member {google.chat.v1.IReaction|null|undefined} reaction + * @memberof google.chat.v1.ReactionCreatedEventData + * @instance + */ + ReactionCreatedEventData.prototype.reaction = null; + + /** + * Creates a new ReactionCreatedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.ReactionCreatedEventData + * @static + * @param {google.chat.v1.IReactionCreatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.ReactionCreatedEventData} ReactionCreatedEventData instance + */ + ReactionCreatedEventData.create = function create(properties) { + return new ReactionCreatedEventData(properties); + }; + + /** + * Encodes the specified ReactionCreatedEventData message. Does not implicitly {@link google.chat.v1.ReactionCreatedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ReactionCreatedEventData + * @static + * @param {google.chat.v1.IReactionCreatedEventData} message ReactionCreatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReactionCreatedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reaction != null && Object.hasOwnProperty.call(message, "reaction")) + $root.google.chat.v1.Reaction.encode(message.reaction, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReactionCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionCreatedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ReactionCreatedEventData + * @static + * @param {google.chat.v1.IReactionCreatedEventData} message ReactionCreatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReactionCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReactionCreatedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ReactionCreatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ReactionCreatedEventData} ReactionCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReactionCreatedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ReactionCreatedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.reaction = $root.google.chat.v1.Reaction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReactionCreatedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ReactionCreatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ReactionCreatedEventData} ReactionCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReactionCreatedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReactionCreatedEventData message. + * @function verify + * @memberof google.chat.v1.ReactionCreatedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReactionCreatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reaction != null && message.hasOwnProperty("reaction")) { + var error = $root.google.chat.v1.Reaction.verify(message.reaction); + if (error) + return "reaction." + error; + } + return null; + }; + + /** + * Creates a ReactionCreatedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ReactionCreatedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ReactionCreatedEventData} ReactionCreatedEventData + */ + ReactionCreatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ReactionCreatedEventData) + return object; + var message = new $root.google.chat.v1.ReactionCreatedEventData(); + if (object.reaction != null) { + if (typeof object.reaction !== "object") + throw TypeError(".google.chat.v1.ReactionCreatedEventData.reaction: object expected"); + message.reaction = $root.google.chat.v1.Reaction.fromObject(object.reaction); + } + return message; + }; + + /** + * Creates a plain object from a ReactionCreatedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ReactionCreatedEventData + * @static + * @param {google.chat.v1.ReactionCreatedEventData} message ReactionCreatedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReactionCreatedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.reaction = null; + if (message.reaction != null && message.hasOwnProperty("reaction")) + object.reaction = $root.google.chat.v1.Reaction.toObject(message.reaction, options); + return object; + }; + + /** + * Converts this ReactionCreatedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.ReactionCreatedEventData + * @instance + * @returns {Object.} JSON object + */ + ReactionCreatedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReactionCreatedEventData + * @function getTypeUrl + * @memberof google.chat.v1.ReactionCreatedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReactionCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ReactionCreatedEventData"; + }; + + return ReactionCreatedEventData; + })(); + + v1.ReactionDeletedEventData = (function() { + + /** + * Properties of a ReactionDeletedEventData. + * @memberof google.chat.v1 + * @interface IReactionDeletedEventData + * @property {google.chat.v1.IReaction|null} [reaction] ReactionDeletedEventData reaction + */ + + /** + * Constructs a new ReactionDeletedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a ReactionDeletedEventData. + * @implements IReactionDeletedEventData + * @constructor + * @param {google.chat.v1.IReactionDeletedEventData=} [properties] Properties to set + */ + function ReactionDeletedEventData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReactionDeletedEventData reaction. + * @member {google.chat.v1.IReaction|null|undefined} reaction + * @memberof google.chat.v1.ReactionDeletedEventData + * @instance + */ + ReactionDeletedEventData.prototype.reaction = null; + + /** + * Creates a new ReactionDeletedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.ReactionDeletedEventData + * @static + * @param {google.chat.v1.IReactionDeletedEventData=} [properties] Properties to set + * @returns {google.chat.v1.ReactionDeletedEventData} ReactionDeletedEventData instance + */ + ReactionDeletedEventData.create = function create(properties) { + return new ReactionDeletedEventData(properties); + }; + + /** + * Encodes the specified ReactionDeletedEventData message. Does not implicitly {@link google.chat.v1.ReactionDeletedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ReactionDeletedEventData + * @static + * @param {google.chat.v1.IReactionDeletedEventData} message ReactionDeletedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReactionDeletedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reaction != null && Object.hasOwnProperty.call(message, "reaction")) + $root.google.chat.v1.Reaction.encode(message.reaction, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReactionDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionDeletedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ReactionDeletedEventData + * @static + * @param {google.chat.v1.IReactionDeletedEventData} message ReactionDeletedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReactionDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReactionDeletedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ReactionDeletedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ReactionDeletedEventData} ReactionDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReactionDeletedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ReactionDeletedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.reaction = $root.google.chat.v1.Reaction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReactionDeletedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ReactionDeletedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ReactionDeletedEventData} ReactionDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReactionDeletedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReactionDeletedEventData message. + * @function verify + * @memberof google.chat.v1.ReactionDeletedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReactionDeletedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reaction != null && message.hasOwnProperty("reaction")) { + var error = $root.google.chat.v1.Reaction.verify(message.reaction); + if (error) + return "reaction." + error; + } + return null; + }; + + /** + * Creates a ReactionDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ReactionDeletedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ReactionDeletedEventData} ReactionDeletedEventData + */ + ReactionDeletedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ReactionDeletedEventData) + return object; + var message = new $root.google.chat.v1.ReactionDeletedEventData(); + if (object.reaction != null) { + if (typeof object.reaction !== "object") + throw TypeError(".google.chat.v1.ReactionDeletedEventData.reaction: object expected"); + message.reaction = $root.google.chat.v1.Reaction.fromObject(object.reaction); + } + return message; + }; + + /** + * Creates a plain object from a ReactionDeletedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ReactionDeletedEventData + * @static + * @param {google.chat.v1.ReactionDeletedEventData} message ReactionDeletedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReactionDeletedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.reaction = null; + if (message.reaction != null && message.hasOwnProperty("reaction")) + object.reaction = $root.google.chat.v1.Reaction.toObject(message.reaction, options); + return object; + }; + + /** + * Converts this ReactionDeletedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.ReactionDeletedEventData + * @instance + * @returns {Object.} JSON object + */ + ReactionDeletedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReactionDeletedEventData + * @function getTypeUrl + * @memberof google.chat.v1.ReactionDeletedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReactionDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ReactionDeletedEventData"; + }; + + return ReactionDeletedEventData; + })(); + + v1.ReactionBatchCreatedEventData = (function() { + + /** + * Properties of a ReactionBatchCreatedEventData. + * @memberof google.chat.v1 + * @interface IReactionBatchCreatedEventData + * @property {Array.|null} [reactions] ReactionBatchCreatedEventData reactions + */ + + /** + * Constructs a new ReactionBatchCreatedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a ReactionBatchCreatedEventData. + * @implements IReactionBatchCreatedEventData + * @constructor + * @param {google.chat.v1.IReactionBatchCreatedEventData=} [properties] Properties to set + */ + function ReactionBatchCreatedEventData(properties) { + this.reactions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReactionBatchCreatedEventData reactions. + * @member {Array.} reactions + * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @instance + */ + ReactionBatchCreatedEventData.prototype.reactions = $util.emptyArray; + + /** + * Creates a new ReactionBatchCreatedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @static + * @param {google.chat.v1.IReactionBatchCreatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.ReactionBatchCreatedEventData} ReactionBatchCreatedEventData instance + */ + ReactionBatchCreatedEventData.create = function create(properties) { + return new ReactionBatchCreatedEventData(properties); + }; + + /** + * Encodes the specified ReactionBatchCreatedEventData message. Does not implicitly {@link google.chat.v1.ReactionBatchCreatedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @static + * @param {google.chat.v1.IReactionBatchCreatedEventData} message ReactionBatchCreatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReactionBatchCreatedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reactions != null && message.reactions.length) + for (var i = 0; i < message.reactions.length; ++i) + $root.google.chat.v1.ReactionCreatedEventData.encode(message.reactions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReactionBatchCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionBatchCreatedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @static + * @param {google.chat.v1.IReactionBatchCreatedEventData} message ReactionBatchCreatedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReactionBatchCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReactionBatchCreatedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ReactionBatchCreatedEventData} ReactionBatchCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReactionBatchCreatedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ReactionBatchCreatedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.reactions && message.reactions.length)) + message.reactions = []; + message.reactions.push($root.google.chat.v1.ReactionCreatedEventData.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReactionBatchCreatedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ReactionBatchCreatedEventData} ReactionBatchCreatedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReactionBatchCreatedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReactionBatchCreatedEventData message. + * @function verify + * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReactionBatchCreatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reactions != null && message.hasOwnProperty("reactions")) { + if (!Array.isArray(message.reactions)) + return "reactions: array expected"; + for (var i = 0; i < message.reactions.length; ++i) { + var error = $root.google.chat.v1.ReactionCreatedEventData.verify(message.reactions[i]); + if (error) + return "reactions." + error; + } + } + return null; + }; + + /** + * Creates a ReactionBatchCreatedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ReactionBatchCreatedEventData} ReactionBatchCreatedEventData + */ + ReactionBatchCreatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ReactionBatchCreatedEventData) + return object; + var message = new $root.google.chat.v1.ReactionBatchCreatedEventData(); + if (object.reactions) { + if (!Array.isArray(object.reactions)) + throw TypeError(".google.chat.v1.ReactionBatchCreatedEventData.reactions: array expected"); + message.reactions = []; + for (var i = 0; i < object.reactions.length; ++i) { + if (typeof object.reactions[i] !== "object") + throw TypeError(".google.chat.v1.ReactionBatchCreatedEventData.reactions: object expected"); + message.reactions[i] = $root.google.chat.v1.ReactionCreatedEventData.fromObject(object.reactions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ReactionBatchCreatedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @static + * @param {google.chat.v1.ReactionBatchCreatedEventData} message ReactionBatchCreatedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReactionBatchCreatedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reactions = []; + if (message.reactions && message.reactions.length) { + object.reactions = []; + for (var j = 0; j < message.reactions.length; ++j) + object.reactions[j] = $root.google.chat.v1.ReactionCreatedEventData.toObject(message.reactions[j], options); + } + return object; + }; + + /** + * Converts this ReactionBatchCreatedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @instance + * @returns {Object.} JSON object + */ + ReactionBatchCreatedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReactionBatchCreatedEventData + * @function getTypeUrl + * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReactionBatchCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ReactionBatchCreatedEventData"; + }; + + return ReactionBatchCreatedEventData; + })(); + + v1.ReactionBatchDeletedEventData = (function() { + + /** + * Properties of a ReactionBatchDeletedEventData. + * @memberof google.chat.v1 + * @interface IReactionBatchDeletedEventData + * @property {Array.|null} [reactions] ReactionBatchDeletedEventData reactions + */ + + /** + * Constructs a new ReactionBatchDeletedEventData. + * @memberof google.chat.v1 + * @classdesc Represents a ReactionBatchDeletedEventData. + * @implements IReactionBatchDeletedEventData + * @constructor + * @param {google.chat.v1.IReactionBatchDeletedEventData=} [properties] Properties to set + */ + function ReactionBatchDeletedEventData(properties) { + this.reactions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReactionBatchDeletedEventData reactions. + * @member {Array.} reactions + * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @instance + */ + ReactionBatchDeletedEventData.prototype.reactions = $util.emptyArray; + + /** + * Creates a new ReactionBatchDeletedEventData instance using the specified properties. + * @function create + * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @static + * @param {google.chat.v1.IReactionBatchDeletedEventData=} [properties] Properties to set + * @returns {google.chat.v1.ReactionBatchDeletedEventData} ReactionBatchDeletedEventData instance + */ + ReactionBatchDeletedEventData.create = function create(properties) { + return new ReactionBatchDeletedEventData(properties); + }; + + /** + * Encodes the specified ReactionBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.ReactionBatchDeletedEventData.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @static + * @param {google.chat.v1.IReactionBatchDeletedEventData} message ReactionBatchDeletedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReactionBatchDeletedEventData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reactions != null && message.reactions.length) + for (var i = 0; i < message.reactions.length; ++i) + $root.google.chat.v1.ReactionDeletedEventData.encode(message.reactions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReactionBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionBatchDeletedEventData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @static + * @param {google.chat.v1.IReactionBatchDeletedEventData} message ReactionBatchDeletedEventData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReactionBatchDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReactionBatchDeletedEventData message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ReactionBatchDeletedEventData} ReactionBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReactionBatchDeletedEventData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ReactionBatchDeletedEventData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.reactions && message.reactions.length)) + message.reactions = []; + message.reactions.push($root.google.chat.v1.ReactionDeletedEventData.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReactionBatchDeletedEventData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ReactionBatchDeletedEventData} ReactionBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReactionBatchDeletedEventData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReactionBatchDeletedEventData message. + * @function verify + * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReactionBatchDeletedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reactions != null && message.hasOwnProperty("reactions")) { + if (!Array.isArray(message.reactions)) + return "reactions: array expected"; + for (var i = 0; i < message.reactions.length; ++i) { + var error = $root.google.chat.v1.ReactionDeletedEventData.verify(message.reactions[i]); + if (error) + return "reactions." + error; + } + } + return null; + }; + + /** + * Creates a ReactionBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ReactionBatchDeletedEventData} ReactionBatchDeletedEventData + */ + ReactionBatchDeletedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ReactionBatchDeletedEventData) + return object; + var message = new $root.google.chat.v1.ReactionBatchDeletedEventData(); + if (object.reactions) { + if (!Array.isArray(object.reactions)) + throw TypeError(".google.chat.v1.ReactionBatchDeletedEventData.reactions: array expected"); + message.reactions = []; + for (var i = 0; i < object.reactions.length; ++i) { + if (typeof object.reactions[i] !== "object") + throw TypeError(".google.chat.v1.ReactionBatchDeletedEventData.reactions: object expected"); + message.reactions[i] = $root.google.chat.v1.ReactionDeletedEventData.fromObject(object.reactions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ReactionBatchDeletedEventData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @static + * @param {google.chat.v1.ReactionBatchDeletedEventData} message ReactionBatchDeletedEventData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReactionBatchDeletedEventData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reactions = []; + if (message.reactions && message.reactions.length) { + object.reactions = []; + for (var j = 0; j < message.reactions.length; ++j) + object.reactions[j] = $root.google.chat.v1.ReactionDeletedEventData.toObject(message.reactions[j], options); + } + return object; + }; + + /** + * Converts this ReactionBatchDeletedEventData to JSON. + * @function toJSON + * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @instance + * @returns {Object.} JSON object + */ + ReactionBatchDeletedEventData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReactionBatchDeletedEventData + * @function getTypeUrl + * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReactionBatchDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ReactionBatchDeletedEventData"; + }; + + return ReactionBatchDeletedEventData; + })(); + + v1.SpaceReadState = (function() { + + /** + * Properties of a SpaceReadState. + * @memberof google.chat.v1 + * @interface ISpaceReadState + * @property {string|null} [name] SpaceReadState name + * @property {google.protobuf.ITimestamp|null} [lastReadTime] SpaceReadState lastReadTime + */ + + /** + * Constructs a new SpaceReadState. + * @memberof google.chat.v1 + * @classdesc Represents a SpaceReadState. + * @implements ISpaceReadState + * @constructor + * @param {google.chat.v1.ISpaceReadState=} [properties] Properties to set + */ + function SpaceReadState(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpaceReadState name. + * @member {string} name + * @memberof google.chat.v1.SpaceReadState + * @instance + */ + SpaceReadState.prototype.name = ""; + + /** + * SpaceReadState lastReadTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastReadTime + * @memberof google.chat.v1.SpaceReadState + * @instance + */ + SpaceReadState.prototype.lastReadTime = null; + + /** + * Creates a new SpaceReadState instance using the specified properties. + * @function create + * @memberof google.chat.v1.SpaceReadState + * @static + * @param {google.chat.v1.ISpaceReadState=} [properties] Properties to set + * @returns {google.chat.v1.SpaceReadState} SpaceReadState instance + */ + SpaceReadState.create = function create(properties) { + return new SpaceReadState(properties); + }; + + /** + * Encodes the specified SpaceReadState message. Does not implicitly {@link google.chat.v1.SpaceReadState.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.SpaceReadState + * @static + * @param {google.chat.v1.ISpaceReadState} message SpaceReadState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpaceReadState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.lastReadTime != null && Object.hasOwnProperty.call(message, "lastReadTime")) + $root.google.protobuf.Timestamp.encode(message.lastReadTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpaceReadState message, length delimited. Does not implicitly {@link google.chat.v1.SpaceReadState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.SpaceReadState + * @static + * @param {google.chat.v1.ISpaceReadState} message SpaceReadState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpaceReadState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpaceReadState message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.SpaceReadState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.SpaceReadState} SpaceReadState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpaceReadState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SpaceReadState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.lastReadTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpaceReadState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.SpaceReadState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.SpaceReadState} SpaceReadState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpaceReadState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpaceReadState message. + * @function verify + * @memberof google.chat.v1.SpaceReadState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpaceReadState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.lastReadTime != null && message.hasOwnProperty("lastReadTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastReadTime); + if (error) + return "lastReadTime." + error; + } + return null; + }; + + /** + * Creates a SpaceReadState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.SpaceReadState + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.SpaceReadState} SpaceReadState + */ + SpaceReadState.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SpaceReadState) + return object; + var message = new $root.google.chat.v1.SpaceReadState(); + if (object.name != null) + message.name = String(object.name); + if (object.lastReadTime != null) { + if (typeof object.lastReadTime !== "object") + throw TypeError(".google.chat.v1.SpaceReadState.lastReadTime: object expected"); + message.lastReadTime = $root.google.protobuf.Timestamp.fromObject(object.lastReadTime); + } + return message; + }; + + /** + * Creates a plain object from a SpaceReadState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.SpaceReadState + * @static + * @param {google.chat.v1.SpaceReadState} message SpaceReadState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpaceReadState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.lastReadTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.lastReadTime != null && message.hasOwnProperty("lastReadTime")) + object.lastReadTime = $root.google.protobuf.Timestamp.toObject(message.lastReadTime, options); + return object; + }; + + /** + * Converts this SpaceReadState to JSON. + * @function toJSON + * @memberof google.chat.v1.SpaceReadState + * @instance + * @returns {Object.} JSON object + */ + SpaceReadState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpaceReadState + * @function getTypeUrl + * @memberof google.chat.v1.SpaceReadState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpaceReadState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.SpaceReadState"; + }; + + return SpaceReadState; + })(); + + v1.GetSpaceReadStateRequest = (function() { + + /** + * Properties of a GetSpaceReadStateRequest. + * @memberof google.chat.v1 + * @interface IGetSpaceReadStateRequest + * @property {string|null} [name] GetSpaceReadStateRequest name + */ + + /** + * Constructs a new GetSpaceReadStateRequest. + * @memberof google.chat.v1 + * @classdesc Represents a GetSpaceReadStateRequest. + * @implements IGetSpaceReadStateRequest + * @constructor + * @param {google.chat.v1.IGetSpaceReadStateRequest=} [properties] Properties to set + */ + function GetSpaceReadStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSpaceReadStateRequest name. + * @member {string} name + * @memberof google.chat.v1.GetSpaceReadStateRequest + * @instance + */ + GetSpaceReadStateRequest.prototype.name = ""; + + /** + * Creates a new GetSpaceReadStateRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.GetSpaceReadStateRequest + * @static + * @param {google.chat.v1.IGetSpaceReadStateRequest=} [properties] Properties to set + * @returns {google.chat.v1.GetSpaceReadStateRequest} GetSpaceReadStateRequest instance + */ + GetSpaceReadStateRequest.create = function create(properties) { + return new GetSpaceReadStateRequest(properties); + }; + + /** + * Encodes the specified GetSpaceReadStateRequest message. Does not implicitly {@link google.chat.v1.GetSpaceReadStateRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.GetSpaceReadStateRequest + * @static + * @param {google.chat.v1.IGetSpaceReadStateRequest} message GetSpaceReadStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpaceReadStateRequest.encode = function encode(message, writer) { + 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 GetSpaceReadStateRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetSpaceReadStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.GetSpaceReadStateRequest + * @static + * @param {google.chat.v1.IGetSpaceReadStateRequest} message GetSpaceReadStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpaceReadStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSpaceReadStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.GetSpaceReadStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.GetSpaceReadStateRequest} GetSpaceReadStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpaceReadStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetSpaceReadStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSpaceReadStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.GetSpaceReadStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.GetSpaceReadStateRequest} GetSpaceReadStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpaceReadStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSpaceReadStateRequest message. + * @function verify + * @memberof google.chat.v1.GetSpaceReadStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSpaceReadStateRequest.verify = function verify(message) { + if (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 GetSpaceReadStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.GetSpaceReadStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.GetSpaceReadStateRequest} GetSpaceReadStateRequest + */ + GetSpaceReadStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.GetSpaceReadStateRequest) + return object; + var message = new $root.google.chat.v1.GetSpaceReadStateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSpaceReadStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.GetSpaceReadStateRequest + * @static + * @param {google.chat.v1.GetSpaceReadStateRequest} message GetSpaceReadStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSpaceReadStateRequest.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 GetSpaceReadStateRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.GetSpaceReadStateRequest + * @instance + * @returns {Object.} JSON object + */ + GetSpaceReadStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSpaceReadStateRequest + * @function getTypeUrl + * @memberof google.chat.v1.GetSpaceReadStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSpaceReadStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.GetSpaceReadStateRequest"; + }; + + return GetSpaceReadStateRequest; + })(); + + v1.UpdateSpaceReadStateRequest = (function() { + + /** + * Properties of an UpdateSpaceReadStateRequest. + * @memberof google.chat.v1 + * @interface IUpdateSpaceReadStateRequest + * @property {google.chat.v1.ISpaceReadState|null} [spaceReadState] UpdateSpaceReadStateRequest spaceReadState + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpaceReadStateRequest updateMask + */ + + /** + * Constructs a new UpdateSpaceReadStateRequest. + * @memberof google.chat.v1 + * @classdesc Represents an UpdateSpaceReadStateRequest. + * @implements IUpdateSpaceReadStateRequest + * @constructor + * @param {google.chat.v1.IUpdateSpaceReadStateRequest=} [properties] Properties to set + */ + function UpdateSpaceReadStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSpaceReadStateRequest spaceReadState. + * @member {google.chat.v1.ISpaceReadState|null|undefined} spaceReadState + * @memberof google.chat.v1.UpdateSpaceReadStateRequest + * @instance + */ + UpdateSpaceReadStateRequest.prototype.spaceReadState = null; + + /** + * UpdateSpaceReadStateRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.chat.v1.UpdateSpaceReadStateRequest + * @instance + */ + UpdateSpaceReadStateRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSpaceReadStateRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.UpdateSpaceReadStateRequest + * @static + * @param {google.chat.v1.IUpdateSpaceReadStateRequest=} [properties] Properties to set + * @returns {google.chat.v1.UpdateSpaceReadStateRequest} UpdateSpaceReadStateRequest instance + */ + UpdateSpaceReadStateRequest.create = function create(properties) { + return new UpdateSpaceReadStateRequest(properties); + }; + + /** + * Encodes the specified UpdateSpaceReadStateRequest message. Does not implicitly {@link google.chat.v1.UpdateSpaceReadStateRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.UpdateSpaceReadStateRequest + * @static + * @param {google.chat.v1.IUpdateSpaceReadStateRequest} message UpdateSpaceReadStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpaceReadStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spaceReadState != null && Object.hasOwnProperty.call(message, "spaceReadState")) + $root.google.chat.v1.SpaceReadState.encode(message.spaceReadState, 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 UpdateSpaceReadStateRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateSpaceReadStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.UpdateSpaceReadStateRequest + * @static + * @param {google.chat.v1.IUpdateSpaceReadStateRequest} message UpdateSpaceReadStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpaceReadStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSpaceReadStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.UpdateSpaceReadStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.UpdateSpaceReadStateRequest} UpdateSpaceReadStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpaceReadStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UpdateSpaceReadStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.spaceReadState = $root.google.chat.v1.SpaceReadState.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 UpdateSpaceReadStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.UpdateSpaceReadStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.UpdateSpaceReadStateRequest} UpdateSpaceReadStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpaceReadStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSpaceReadStateRequest message. + * @function verify + * @memberof google.chat.v1.UpdateSpaceReadStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSpaceReadStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spaceReadState != null && message.hasOwnProperty("spaceReadState")) { + var error = $root.google.chat.v1.SpaceReadState.verify(message.spaceReadState); + if (error) + return "spaceReadState." + 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 UpdateSpaceReadStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.UpdateSpaceReadStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.UpdateSpaceReadStateRequest} UpdateSpaceReadStateRequest + */ + UpdateSpaceReadStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.UpdateSpaceReadStateRequest) + return object; + var message = new $root.google.chat.v1.UpdateSpaceReadStateRequest(); + if (object.spaceReadState != null) { + if (typeof object.spaceReadState !== "object") + throw TypeError(".google.chat.v1.UpdateSpaceReadStateRequest.spaceReadState: object expected"); + message.spaceReadState = $root.google.chat.v1.SpaceReadState.fromObject(object.spaceReadState); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.chat.v1.UpdateSpaceReadStateRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSpaceReadStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.UpdateSpaceReadStateRequest + * @static + * @param {google.chat.v1.UpdateSpaceReadStateRequest} message UpdateSpaceReadStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSpaceReadStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.spaceReadState = null; + object.updateMask = null; + } + if (message.spaceReadState != null && message.hasOwnProperty("spaceReadState")) + object.spaceReadState = $root.google.chat.v1.SpaceReadState.toObject(message.spaceReadState, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSpaceReadStateRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.UpdateSpaceReadStateRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSpaceReadStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSpaceReadStateRequest + * @function getTypeUrl + * @memberof google.chat.v1.UpdateSpaceReadStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSpaceReadStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.UpdateSpaceReadStateRequest"; + }; + + return UpdateSpaceReadStateRequest; + })(); + + v1.SetUpSpaceRequest = (function() { + + /** + * Properties of a SetUpSpaceRequest. + * @memberof google.chat.v1 + * @interface ISetUpSpaceRequest + * @property {google.chat.v1.ISpace|null} [space] SetUpSpaceRequest space + * @property {string|null} [requestId] SetUpSpaceRequest requestId + * @property {Array.|null} [memberships] SetUpSpaceRequest memberships + */ + + /** + * Constructs a new SetUpSpaceRequest. + * @memberof google.chat.v1 + * @classdesc Represents a SetUpSpaceRequest. + * @implements ISetUpSpaceRequest + * @constructor + * @param {google.chat.v1.ISetUpSpaceRequest=} [properties] Properties to set + */ + function SetUpSpaceRequest(properties) { + this.memberships = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetUpSpaceRequest space. + * @member {google.chat.v1.ISpace|null|undefined} space + * @memberof google.chat.v1.SetUpSpaceRequest + * @instance + */ + SetUpSpaceRequest.prototype.space = null; + + /** + * SetUpSpaceRequest requestId. + * @member {string} requestId + * @memberof google.chat.v1.SetUpSpaceRequest + * @instance + */ + SetUpSpaceRequest.prototype.requestId = ""; + + /** + * SetUpSpaceRequest memberships. + * @member {Array.} memberships + * @memberof google.chat.v1.SetUpSpaceRequest + * @instance + */ + SetUpSpaceRequest.prototype.memberships = $util.emptyArray; + + /** + * Creates a new SetUpSpaceRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.SetUpSpaceRequest + * @static + * @param {google.chat.v1.ISetUpSpaceRequest=} [properties] Properties to set + * @returns {google.chat.v1.SetUpSpaceRequest} SetUpSpaceRequest instance + */ + SetUpSpaceRequest.create = function create(properties) { + return new SetUpSpaceRequest(properties); + }; + + /** + * Encodes the specified SetUpSpaceRequest message. Does not implicitly {@link google.chat.v1.SetUpSpaceRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.SetUpSpaceRequest + * @static + * @param {google.chat.v1.ISetUpSpaceRequest} message SetUpSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetUpSpaceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.space != null && Object.hasOwnProperty.call(message, "space")) + $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.memberships != null && message.memberships.length) + for (var i = 0; i < message.memberships.length; ++i) + $root.google.chat.v1.Membership.encode(message.memberships[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetUpSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.SetUpSpaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.SetUpSpaceRequest + * @static + * @param {google.chat.v1.ISetUpSpaceRequest} message SetUpSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetUpSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetUpSpaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.SetUpSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.SetUpSpaceRequest} SetUpSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetUpSpaceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SetUpSpaceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 4: { + if (!(message.memberships && message.memberships.length)) + message.memberships = []; + message.memberships.push($root.google.chat.v1.Membership.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetUpSpaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.SetUpSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.SetUpSpaceRequest} SetUpSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetUpSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetUpSpaceRequest message. + * @function verify + * @memberof google.chat.v1.SetUpSpaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetUpSpaceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.space != null && message.hasOwnProperty("space")) { + var error = $root.google.chat.v1.Space.verify(message.space); + if (error) + return "space." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.memberships != null && message.hasOwnProperty("memberships")) { + if (!Array.isArray(message.memberships)) + return "memberships: array expected"; + for (var i = 0; i < message.memberships.length; ++i) { + var error = $root.google.chat.v1.Membership.verify(message.memberships[i]); + if (error) + return "memberships." + error; + } + } + return null; + }; + + /** + * Creates a SetUpSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.SetUpSpaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.SetUpSpaceRequest} SetUpSpaceRequest + */ + SetUpSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SetUpSpaceRequest) + return object; + var message = new $root.google.chat.v1.SetUpSpaceRequest(); + if (object.space != null) { + if (typeof object.space !== "object") + throw TypeError(".google.chat.v1.SetUpSpaceRequest.space: object expected"); + message.space = $root.google.chat.v1.Space.fromObject(object.space); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.memberships) { + if (!Array.isArray(object.memberships)) + throw TypeError(".google.chat.v1.SetUpSpaceRequest.memberships: array expected"); + message.memberships = []; + for (var i = 0; i < object.memberships.length; ++i) { + if (typeof object.memberships[i] !== "object") + throw TypeError(".google.chat.v1.SetUpSpaceRequest.memberships: object expected"); + message.memberships[i] = $root.google.chat.v1.Membership.fromObject(object.memberships[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SetUpSpaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.SetUpSpaceRequest + * @static + * @param {google.chat.v1.SetUpSpaceRequest} message SetUpSpaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetUpSpaceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.memberships = []; + if (options.defaults) { + object.space = null; + object.requestId = ""; + } + if (message.space != null && message.hasOwnProperty("space")) + object.space = $root.google.chat.v1.Space.toObject(message.space, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.memberships && message.memberships.length) { + object.memberships = []; + for (var j = 0; j < message.memberships.length; ++j) + object.memberships[j] = $root.google.chat.v1.Membership.toObject(message.memberships[j], options); + } + return object; + }; + + /** + * Converts this SetUpSpaceRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.SetUpSpaceRequest + * @instance + * @returns {Object.} JSON object + */ + SetUpSpaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetUpSpaceRequest + * @function getTypeUrl + * @memberof google.chat.v1.SetUpSpaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetUpSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.SetUpSpaceRequest"; + }; + + return SetUpSpaceRequest; + })(); + + v1.ThreadReadState = (function() { + + /** + * Properties of a ThreadReadState. + * @memberof google.chat.v1 + * @interface IThreadReadState + * @property {string|null} [name] ThreadReadState name + * @property {google.protobuf.ITimestamp|null} [lastReadTime] ThreadReadState lastReadTime + */ + + /** + * Constructs a new ThreadReadState. + * @memberof google.chat.v1 + * @classdesc Represents a ThreadReadState. + * @implements IThreadReadState + * @constructor + * @param {google.chat.v1.IThreadReadState=} [properties] Properties to set + */ + function ThreadReadState(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ThreadReadState name. + * @member {string} name + * @memberof google.chat.v1.ThreadReadState + * @instance + */ + ThreadReadState.prototype.name = ""; + + /** + * ThreadReadState lastReadTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastReadTime + * @memberof google.chat.v1.ThreadReadState + * @instance + */ + ThreadReadState.prototype.lastReadTime = null; + + /** + * Creates a new ThreadReadState instance using the specified properties. + * @function create + * @memberof google.chat.v1.ThreadReadState + * @static + * @param {google.chat.v1.IThreadReadState=} [properties] Properties to set + * @returns {google.chat.v1.ThreadReadState} ThreadReadState instance + */ + ThreadReadState.create = function create(properties) { + return new ThreadReadState(properties); + }; + + /** + * Encodes the specified ThreadReadState message. Does not implicitly {@link google.chat.v1.ThreadReadState.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ThreadReadState + * @static + * @param {google.chat.v1.IThreadReadState} message ThreadReadState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreadReadState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.lastReadTime != null && Object.hasOwnProperty.call(message, "lastReadTime")) + $root.google.protobuf.Timestamp.encode(message.lastReadTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ThreadReadState message, length delimited. Does not implicitly {@link google.chat.v1.ThreadReadState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ThreadReadState + * @static + * @param {google.chat.v1.IThreadReadState} message ThreadReadState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreadReadState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ThreadReadState message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ThreadReadState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ThreadReadState} ThreadReadState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreadReadState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ThreadReadState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.lastReadTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ThreadReadState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ThreadReadState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ThreadReadState} ThreadReadState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreadReadState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ThreadReadState message. + * @function verify + * @memberof google.chat.v1.ThreadReadState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ThreadReadState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.lastReadTime != null && message.hasOwnProperty("lastReadTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastReadTime); + if (error) + return "lastReadTime." + error; + } + return null; + }; + + /** + * Creates a ThreadReadState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ThreadReadState + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ThreadReadState} ThreadReadState + */ + ThreadReadState.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ThreadReadState) + return object; + var message = new $root.google.chat.v1.ThreadReadState(); + if (object.name != null) + message.name = String(object.name); + if (object.lastReadTime != null) { + if (typeof object.lastReadTime !== "object") + throw TypeError(".google.chat.v1.ThreadReadState.lastReadTime: object expected"); + message.lastReadTime = $root.google.protobuf.Timestamp.fromObject(object.lastReadTime); + } + return message; + }; + + /** + * Creates a plain object from a ThreadReadState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ThreadReadState + * @static + * @param {google.chat.v1.ThreadReadState} message ThreadReadState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ThreadReadState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.lastReadTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.lastReadTime != null && message.hasOwnProperty("lastReadTime")) + object.lastReadTime = $root.google.protobuf.Timestamp.toObject(message.lastReadTime, options); + return object; + }; + + /** + * Converts this ThreadReadState to JSON. + * @function toJSON + * @memberof google.chat.v1.ThreadReadState + * @instance + * @returns {Object.} JSON object + */ + ThreadReadState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ThreadReadState + * @function getTypeUrl + * @memberof google.chat.v1.ThreadReadState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThreadReadState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ThreadReadState"; + }; + + return ThreadReadState; + })(); + + v1.GetThreadReadStateRequest = (function() { + + /** + * Properties of a GetThreadReadStateRequest. + * @memberof google.chat.v1 + * @interface IGetThreadReadStateRequest + * @property {string|null} [name] GetThreadReadStateRequest name + */ + + /** + * Constructs a new GetThreadReadStateRequest. + * @memberof google.chat.v1 + * @classdesc Represents a GetThreadReadStateRequest. + * @implements IGetThreadReadStateRequest + * @constructor + * @param {google.chat.v1.IGetThreadReadStateRequest=} [properties] Properties to set + */ + function GetThreadReadStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetThreadReadStateRequest name. + * @member {string} name + * @memberof google.chat.v1.GetThreadReadStateRequest + * @instance + */ + GetThreadReadStateRequest.prototype.name = ""; + + /** + * Creates a new GetThreadReadStateRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.GetThreadReadStateRequest + * @static + * @param {google.chat.v1.IGetThreadReadStateRequest=} [properties] Properties to set + * @returns {google.chat.v1.GetThreadReadStateRequest} GetThreadReadStateRequest instance + */ + GetThreadReadStateRequest.create = function create(properties) { + return new GetThreadReadStateRequest(properties); + }; + + /** + * Encodes the specified GetThreadReadStateRequest message. Does not implicitly {@link google.chat.v1.GetThreadReadStateRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.GetThreadReadStateRequest + * @static + * @param {google.chat.v1.IGetThreadReadStateRequest} message GetThreadReadStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetThreadReadStateRequest.encode = function encode(message, writer) { + 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 GetThreadReadStateRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetThreadReadStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.GetThreadReadStateRequest + * @static + * @param {google.chat.v1.IGetThreadReadStateRequest} message GetThreadReadStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetThreadReadStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetThreadReadStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.GetThreadReadStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.GetThreadReadStateRequest} GetThreadReadStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetThreadReadStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetThreadReadStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetThreadReadStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.GetThreadReadStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.GetThreadReadStateRequest} GetThreadReadStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetThreadReadStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetThreadReadStateRequest message. + * @function verify + * @memberof google.chat.v1.GetThreadReadStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetThreadReadStateRequest.verify = function verify(message) { + if (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 GetThreadReadStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.GetThreadReadStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.GetThreadReadStateRequest} GetThreadReadStateRequest + */ + GetThreadReadStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.GetThreadReadStateRequest) + return object; + var message = new $root.google.chat.v1.GetThreadReadStateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetThreadReadStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.GetThreadReadStateRequest + * @static + * @param {google.chat.v1.GetThreadReadStateRequest} message GetThreadReadStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetThreadReadStateRequest.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 GetThreadReadStateRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.GetThreadReadStateRequest + * @instance + * @returns {Object.} JSON object + */ + GetThreadReadStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetThreadReadStateRequest + * @function getTypeUrl + * @memberof google.chat.v1.GetThreadReadStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetThreadReadStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.GetThreadReadStateRequest"; + }; + + return GetThreadReadStateRequest; + })(); + + return v1; + })(); + + return chat; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + /** + * Code enum. + * @name google.rpc.Code + * @enum {number} + * @property {number} OK=0 OK value + * @property {number} CANCELLED=1 CANCELLED value + * @property {number} UNKNOWN=2 UNKNOWN value + * @property {number} INVALID_ARGUMENT=3 INVALID_ARGUMENT value + * @property {number} DEADLINE_EXCEEDED=4 DEADLINE_EXCEEDED value + * @property {number} NOT_FOUND=5 NOT_FOUND value + * @property {number} ALREADY_EXISTS=6 ALREADY_EXISTS value + * @property {number} PERMISSION_DENIED=7 PERMISSION_DENIED value + * @property {number} UNAUTHENTICATED=16 UNAUTHENTICATED value + * @property {number} RESOURCE_EXHAUSTED=8 RESOURCE_EXHAUSTED value + * @property {number} FAILED_PRECONDITION=9 FAILED_PRECONDITION value + * @property {number} ABORTED=10 ABORTED value + * @property {number} OUT_OF_RANGE=11 OUT_OF_RANGE value + * @property {number} UNIMPLEMENTED=12 UNIMPLEMENTED value + * @property {number} INTERNAL=13 INTERNAL value + * @property {number} UNAVAILABLE=14 UNAVAILABLE value + * @property {number} DATA_LOSS=15 DATA_LOSS value + */ + rpc.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OK"] = 0; + values[valuesById[1] = "CANCELLED"] = 1; + values[valuesById[2] = "UNKNOWN"] = 2; + values[valuesById[3] = "INVALID_ARGUMENT"] = 3; + values[valuesById[4] = "DEADLINE_EXCEEDED"] = 4; + values[valuesById[5] = "NOT_FOUND"] = 5; + values[valuesById[6] = "ALREADY_EXISTS"] = 6; + values[valuesById[7] = "PERMISSION_DENIED"] = 7; + values[valuesById[16] = "UNAUTHENTICATED"] = 16; + values[valuesById[8] = "RESOURCE_EXHAUSTED"] = 8; + values[valuesById[9] = "FAILED_PRECONDITION"] = 9; + values[valuesById[10] = "ABORTED"] = 10; + values[valuesById[11] = "OUT_OF_RANGE"] = 11; + values[valuesById[12] = "UNIMPLEMENTED"] = 12; + values[valuesById[13] = "INTERNAL"] = 13; + values[valuesById[14] = "UNAVAILABLE"] = 14; + values[valuesById[15] = "DATA_LOSS"] = 15; + return values; + })(); + + return rpc; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + return api; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-chat/v1/protos/protos.json b/owl-bot-staging/google-chat/v1/protos/protos.json new file mode 100644 index 00000000000..0bb7a3eb25a --- /dev/null +++ b/owl-bot-staging/google-chat/v1/protos/protos.json @@ -0,0 +1,5961 @@ +{ + "nested": { + "google": { + "nested": { + "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": { + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + } + } + }, + "apps": { + "nested": { + "card": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Apps.Card.V1", + "go_package": "google.golang.org/genproto/googleapis/apps/card/v1;card", + "java_multiple_files": true, + "java_outer_classname": "CardProto", + "java_package": "com.google.apps.card.v1", + "php_namespace": "Google\\Apps\\Card\\V1", + "ruby_package": "Google::Apps::Card::V1" + }, + "nested": { + "Card": { + "fields": { + "header": { + "type": "CardHeader", + "id": 1 + }, + "sections": { + "rule": "repeated", + "type": "Section", + "id": 2 + }, + "sectionDividerStyle": { + "type": "DividerStyle", + "id": 9 + }, + "cardActions": { + "rule": "repeated", + "type": "CardAction", + "id": 3 + }, + "name": { + "type": "string", + "id": 4 + }, + "fixedFooter": { + "type": "CardFixedFooter", + "id": 5 + }, + "displayStyle": { + "type": "DisplayStyle", + "id": 6 + }, + "peekCardHeader": { + "type": "CardHeader", + "id": 7 + } + }, + "nested": { + "CardHeader": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "subtitle": { + "type": "string", + "id": 2 + }, + "imageType": { + "type": "Widget.ImageType", + "id": 3 + }, + "imageUrl": { + "type": "string", + "id": 4 + }, + "imageAltText": { + "type": "string", + "id": 5 + } + } + }, + "Section": { + "fields": { + "header": { + "type": "string", + "id": 1 + }, + "widgets": { + "rule": "repeated", + "type": "Widget", + "id": 2 + }, + "collapsible": { + "type": "bool", + "id": 5 + }, + "uncollapsibleWidgetsCount": { + "type": "int32", + "id": 6 + } + } + }, + "DividerStyle": { + "values": { + "DIVIDER_STYLE_UNSPECIFIED": 0, + "SOLID_DIVIDER": 1, + "NO_DIVIDER": 2 + } + }, + "CardAction": { + "fields": { + "actionLabel": { + "type": "string", + "id": 1 + }, + "onClick": { + "type": "OnClick", + "id": 2 + } + } + }, + "CardFixedFooter": { + "fields": { + "primaryButton": { + "type": "Button", + "id": 1 + }, + "secondaryButton": { + "type": "Button", + "id": 2 + } + } + }, + "DisplayStyle": { + "values": { + "DISPLAY_STYLE_UNSPECIFIED": 0, + "PEEK": 1, + "REPLACE": 2 + } + } + } + }, + "Widget": { + "oneofs": { + "data": { + "oneof": [ + "textParagraph", + "image", + "decoratedText", + "buttonList", + "textInput", + "selectionInput", + "dateTimePicker", + "divider", + "grid", + "columns" + ] + } + }, + "fields": { + "textParagraph": { + "type": "TextParagraph", + "id": 1 + }, + "image": { + "type": "Image", + "id": 2 + }, + "decoratedText": { + "type": "DecoratedText", + "id": 3 + }, + "buttonList": { + "type": "ButtonList", + "id": 4 + }, + "textInput": { + "type": "TextInput", + "id": 5 + }, + "selectionInput": { + "type": "SelectionInput", + "id": 6 + }, + "dateTimePicker": { + "type": "DateTimePicker", + "id": 7 + }, + "divider": { + "type": "Divider", + "id": 9 + }, + "grid": { + "type": "Grid", + "id": 10 + }, + "columns": { + "type": "Columns", + "id": 11 + }, + "horizontalAlignment": { + "type": "HorizontalAlignment", + "id": 8 + } + }, + "nested": { + "ImageType": { + "values": { + "SQUARE": 0, + "CIRCLE": 1 + } + }, + "HorizontalAlignment": { + "values": { + "HORIZONTAL_ALIGNMENT_UNSPECIFIED": 0, + "START": 1, + "CENTER": 2, + "END": 3 + } + } + } + }, + "TextParagraph": { + "fields": { + "text": { + "type": "string", + "id": 1 + } + } + }, + "Image": { + "fields": { + "imageUrl": { + "type": "string", + "id": 1 + }, + "onClick": { + "type": "OnClick", + "id": 2 + }, + "altText": { + "type": "string", + "id": 3 + } + } + }, + "Divider": { + "fields": {} + }, + "DecoratedText": { + "oneofs": { + "control": { + "oneof": [ + "button", + "switchControl", + "endIcon" + ] + } + }, + "fields": { + "icon": { + "type": "Icon", + "id": 1, + "options": { + "deprecated": true + } + }, + "startIcon": { + "type": "Icon", + "id": 12 + }, + "topLabel": { + "type": "string", + "id": 3 + }, + "text": { + "type": "string", + "id": 4 + }, + "wrapText": { + "type": "bool", + "id": 5 + }, + "bottomLabel": { + "type": "string", + "id": 6 + }, + "onClick": { + "type": "OnClick", + "id": 7 + }, + "button": { + "type": "Button", + "id": 8 + }, + "switchControl": { + "type": "SwitchControl", + "id": 9 + }, + "endIcon": { + "type": "Icon", + "id": 11 + } + }, + "nested": { + "SwitchControl": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + }, + "selected": { + "type": "bool", + "id": 3 + }, + "onChangeAction": { + "type": "Action", + "id": 4 + }, + "controlType": { + "type": "ControlType", + "id": 5 + } + }, + "nested": { + "ControlType": { + "values": { + "SWITCH": 0, + "CHECKBOX": 1, + "CHECK_BOX": 2 + } + } + } + } + } + }, + "TextInput": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "label": { + "type": "string", + "id": 2 + }, + "hintText": { + "type": "string", + "id": 3 + }, + "value": { + "type": "string", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "onChangeAction": { + "type": "Action", + "id": 6 + }, + "initialSuggestions": { + "type": "Suggestions", + "id": 7 + }, + "autoCompleteAction": { + "type": "Action", + "id": 8 + }, + "placeholderText": { + "type": "string", + "id": 12 + } + }, + "nested": { + "Type": { + "values": { + "SINGLE_LINE": 0, + "MULTIPLE_LINE": 1 + } + } + } + }, + "Suggestions": { + "fields": { + "items": { + "rule": "repeated", + "type": "SuggestionItem", + "id": 1 + } + }, + "nested": { + "SuggestionItem": { + "oneofs": { + "content": { + "oneof": [ + "text" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ButtonList": { + "fields": { + "buttons": { + "rule": "repeated", + "type": "Button", + "id": 1 + } + } + }, + "SelectionInput": { + "oneofs": { + "multiSelectDataSource": { + "oneof": [ + "externalDataSource", + "platformDataSource" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "label": { + "type": "string", + "id": 2 + }, + "type": { + "type": "SelectionType", + "id": 3 + }, + "items": { + "rule": "repeated", + "type": "SelectionItem", + "id": 4 + }, + "onChangeAction": { + "type": "Action", + "id": 5 + }, + "multiSelectMaxSelectedItems": { + "type": "int32", + "id": 6 + }, + "multiSelectMinQueryLength": { + "type": "int32", + "id": 7 + }, + "externalDataSource": { + "type": "Action", + "id": 8 + }, + "platformDataSource": { + "type": "PlatformDataSource", + "id": 9 + } + }, + "nested": { + "SelectionType": { + "values": { + "CHECK_BOX": 0, + "RADIO_BUTTON": 1, + "SWITCH": 2, + "DROPDOWN": 3, + "MULTI_SELECT": 4 + } + }, + "SelectionItem": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + }, + "selected": { + "type": "bool", + "id": 3 + }, + "startIconUri": { + "type": "string", + "id": 4 + }, + "bottomText": { + "type": "string", + "id": 5 + } + } + }, + "PlatformDataSource": { + "oneofs": { + "dataSource": { + "oneof": [ + "commonDataSource" + ] + } + }, + "fields": { + "commonDataSource": { + "type": "CommonDataSource", + "id": 1 + } + }, + "nested": { + "CommonDataSource": { + "values": { + "UNKNOWN": 0, + "USER": 1 + } + } + } + } + } + }, + "DateTimePicker": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "label": { + "type": "string", + "id": 2 + }, + "type": { + "type": "DateTimePickerType", + "id": 3 + }, + "valueMsEpoch": { + "type": "int64", + "id": 4 + }, + "timezoneOffsetDate": { + "type": "int32", + "id": 5 + }, + "onChangeAction": { + "type": "Action", + "id": 6 + } + }, + "nested": { + "DateTimePickerType": { + "values": { + "DATE_AND_TIME": 0, + "DATE_ONLY": 1, + "TIME_ONLY": 2 + } + } + } + }, + "Button": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "icon": { + "type": "Icon", + "id": 2 + }, + "color": { + "type": "google.type.Color", + "id": 3 + }, + "onClick": { + "type": "OnClick", + "id": 4 + }, + "disabled": { + "type": "bool", + "id": 5 + }, + "altText": { + "type": "string", + "id": 6 + } + } + }, + "Icon": { + "oneofs": { + "icons": { + "oneof": [ + "knownIcon", + "iconUrl", + "materialIcon" + ] + } + }, + "fields": { + "knownIcon": { + "type": "string", + "id": 1 + }, + "iconUrl": { + "type": "string", + "id": 2 + }, + "materialIcon": { + "type": "MaterialIcon", + "id": 5 + }, + "altText": { + "type": "string", + "id": 3 + }, + "imageType": { + "type": "Widget.ImageType", + "id": 4 + } + } + }, + "MaterialIcon": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "fill": { + "type": "bool", + "id": 2 + }, + "weight": { + "type": "int32", + "id": 3 + }, + "grade": { + "type": "int32", + "id": 4 + } + } + }, + "ImageCropStyle": { + "fields": { + "type": { + "type": "ImageCropType", + "id": 1 + }, + "aspectRatio": { + "type": "double", + "id": 2 + } + }, + "nested": { + "ImageCropType": { + "values": { + "IMAGE_CROP_TYPE_UNSPECIFIED": 0, + "SQUARE": 1, + "CIRCLE": 2, + "RECTANGLE_CUSTOM": 3, + "RECTANGLE_4_3": 4 + } + } + } + }, + "BorderStyle": { + "fields": { + "type": { + "type": "BorderType", + "id": 1 + }, + "strokeColor": { + "type": "google.type.Color", + "id": 2 + }, + "cornerRadius": { + "type": "int32", + "id": 3 + } + }, + "nested": { + "BorderType": { + "values": { + "BORDER_TYPE_UNSPECIFIED": 0, + "NO_BORDER": 1, + "STROKE": 2 + } + } + } + }, + "ImageComponent": { + "fields": { + "imageUri": { + "type": "string", + "id": 1 + }, + "altText": { + "type": "string", + "id": 2 + }, + "cropStyle": { + "type": "ImageCropStyle", + "id": 3 + }, + "borderStyle": { + "type": "BorderStyle", + "id": 4 + } + } + }, + "Grid": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "items": { + "rule": "repeated", + "type": "GridItem", + "id": 2 + }, + "borderStyle": { + "type": "BorderStyle", + "id": 3 + }, + "columnCount": { + "type": "int32", + "id": 4 + }, + "onClick": { + "type": "OnClick", + "id": 5 + } + }, + "nested": { + "GridItem": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "image": { + "type": "ImageComponent", + "id": 2 + }, + "title": { + "type": "string", + "id": 3 + }, + "subtitle": { + "type": "string", + "id": 4 + }, + "layout": { + "type": "GridItemLayout", + "id": 9 + } + }, + "nested": { + "GridItemLayout": { + "values": { + "GRID_ITEM_LAYOUT_UNSPECIFIED": 0, + "TEXT_BELOW": 1, + "TEXT_ABOVE": 2 + } + } + } + } + } + }, + "Columns": { + "fields": { + "columnItems": { + "rule": "repeated", + "type": "Column", + "id": 2 + } + }, + "nested": { + "Column": { + "fields": { + "horizontalSizeStyle": { + "type": "HorizontalSizeStyle", + "id": 1 + }, + "horizontalAlignment": { + "type": "Widget.HorizontalAlignment", + "id": 2 + }, + "verticalAlignment": { + "type": "VerticalAlignment", + "id": 3 + }, + "widgets": { + "rule": "repeated", + "type": "Widgets", + "id": 4 + } + }, + "nested": { + "HorizontalSizeStyle": { + "values": { + "HORIZONTAL_SIZE_STYLE_UNSPECIFIED": 0, + "FILL_AVAILABLE_SPACE": 1, + "FILL_MINIMUM_SPACE": 2 + } + }, + "VerticalAlignment": { + "values": { + "VERTICAL_ALIGNMENT_UNSPECIFIED": 0, + "CENTER": 1, + "TOP": 2, + "BOTTOM": 3 + } + }, + "Widgets": { + "oneofs": { + "data": { + "oneof": [ + "textParagraph", + "image", + "decoratedText", + "buttonList", + "textInput", + "selectionInput", + "dateTimePicker" + ] + } + }, + "fields": { + "textParagraph": { + "type": "TextParagraph", + "id": 1 + }, + "image": { + "type": "Image", + "id": 2 + }, + "decoratedText": { + "type": "DecoratedText", + "id": 3 + }, + "buttonList": { + "type": "ButtonList", + "id": 4 + }, + "textInput": { + "type": "TextInput", + "id": 5 + }, + "selectionInput": { + "type": "SelectionInput", + "id": 6 + }, + "dateTimePicker": { + "type": "DateTimePicker", + "id": 7 + } + } + } + } + } + } + }, + "OnClick": { + "oneofs": { + "data": { + "oneof": [ + "action", + "openLink", + "openDynamicLinkAction", + "card" + ] + } + }, + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "openLink": { + "type": "OpenLink", + "id": 2 + }, + "openDynamicLinkAction": { + "type": "Action", + "id": 3 + }, + "card": { + "type": "Card", + "id": 4 + } + } + }, + "OpenLink": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "openAs": { + "type": "OpenAs", + "id": 2 + }, + "onClose": { + "type": "OnClose", + "id": 3 + } + }, + "nested": { + "OpenAs": { + "values": { + "FULL_SIZE": 0, + "OVERLAY": 1 + } + }, + "OnClose": { + "values": { + "NOTHING": 0, + "RELOAD": 1 + } + } + } + }, + "Action": { + "fields": { + "function": { + "type": "string", + "id": 1 + }, + "parameters": { + "rule": "repeated", + "type": "ActionParameter", + "id": 2 + }, + "loadIndicator": { + "type": "LoadIndicator", + "id": 3 + }, + "persistValues": { + "type": "bool", + "id": 4 + }, + "interaction": { + "type": "Interaction", + "id": 5 + } + }, + "nested": { + "ActionParameter": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, + "LoadIndicator": { + "values": { + "SPINNER": 0, + "NONE": 1 + } + }, + "Interaction": { + "values": { + "INTERACTION_UNSPECIFIED": 0, + "OPEN_DIALOG": 1 + } + } + } + } + } + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/color;color", + "java_multiple_files": true, + "java_outer_classname": "ColorProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Color": { + "fields": { + "red": { + "type": "float", + "id": 1 + }, + "green": { + "type": "float", + "id": 2 + }, + "blue": { + "type": "float", + "id": 3 + }, + "alpha": { + "type": "google.protobuf.FloatValue", + "id": 4 + } + } + } + } + }, + "chat": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Apps.Chat.V1", + "go_package": "cloud.google.com/go/chat/apiv1/chatpb;chatpb", + "java_multiple_files": true, + "java_outer_classname": "ThreadReadStateProto", + "java_package": "com.google.chat.v1", + "objc_class_prefix": "DYNAPIProto", + "php_namespace": "Google\\Apps\\Chat\\V1", + "ruby_package": "Google::Apps::Chat::V1" + }, + "nested": { + "ActionStatus": { + "fields": { + "statusCode": { + "type": "google.rpc.Code", + "id": 1 + }, + "userFacingMessage": { + "type": "string", + "id": 2 + } + } + }, + "Annotation": { + "oneofs": { + "_startIndex": { + "oneof": [ + "startIndex" + ] + }, + "metadata": { + "oneof": [ + "userMention", + "slashCommand", + "richLinkMetadata" + ] + } + }, + "fields": { + "type": { + "type": "AnnotationType", + "id": 1 + }, + "startIndex": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "length": { + "type": "int32", + "id": 3 + }, + "userMention": { + "type": "UserMentionMetadata", + "id": 4 + }, + "slashCommand": { + "type": "SlashCommandMetadata", + "id": 5 + }, + "richLinkMetadata": { + "type": "RichLinkMetadata", + "id": 6 + } + } + }, + "UserMentionMetadata": { + "fields": { + "user": { + "type": "User", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ADD": 1, + "MENTION": 2 + } + } + } + }, + "SlashCommandMetadata": { + "fields": { + "bot": { + "type": "User", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + }, + "commandName": { + "type": "string", + "id": 3 + }, + "commandId": { + "type": "int64", + "id": 4 + }, + "triggersDialog": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ADD": 1, + "INVOKE": 2 + } + } + } + }, + "RichLinkMetadata": { + "oneofs": { + "data": { + "oneof": [ + "driveLinkData", + "chatSpaceLinkData" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "richLinkType": { + "type": "RichLinkType", + "id": 2 + }, + "driveLinkData": { + "type": "DriveLinkData", + "id": 3 + }, + "chatSpaceLinkData": { + "type": "ChatSpaceLinkData", + "id": 4 + } + }, + "nested": { + "RichLinkType": { + "values": { + "RICH_LINK_TYPE_UNSPECIFIED": 0, + "DRIVE_FILE": 1, + "CHAT_SPACE": 2 + } + } + } + }, + "DriveLinkData": { + "fields": { + "driveDataRef": { + "type": "DriveDataRef", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + } + } + }, + "ChatSpaceLinkData": { + "fields": { + "space": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "chat.googleapis.com/Space" + } + }, + "thread": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "chat.googleapis.com/Thread" + } + }, + "message": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "chat.googleapis.com/Message" + } + } + } + }, + "AnnotationType": { + "values": { + "ANNOTATION_TYPE_UNSPECIFIED": 0, + "USER_MENTION": 1, + "SLASH_COMMAND": 2, + "RICH_LINK": 3 + } + }, + "Attachment": { + "options": { + "(google.api.resource).type": "chat.googleapis.com/Attachment", + "(google.api.resource).pattern": "spaces/{space}/messages/{message}/attachments/{attachment}" + }, + "oneofs": { + "dataRef": { + "oneof": [ + "attachmentDataRef", + "driveDataRef" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "contentName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "contentType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attachmentDataRef": { + "type": "AttachmentDataRef", + "id": 4 + }, + "driveDataRef": { + "type": "DriveDataRef", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "thumbnailUri": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "downloadUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "source": { + "type": "Source", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Source": { + "values": { + "SOURCE_UNSPECIFIED": 0, + "DRIVE_FILE": 1, + "UPLOADED_CONTENT": 2 + } + } + } + }, + "DriveDataRef": { + "fields": { + "driveFileId": { + "type": "string", + "id": 2 + } + } + }, + "AttachmentDataRef": { + "fields": { + "resourceName": { + "type": "string", + "id": 1 + }, + "attachmentUploadToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAttachmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/Attachment" + } + } + } + }, + "UploadAttachmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "chat.googleapis.com/Message" + } + }, + "filename": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UploadAttachmentResponse": { + "fields": { + "attachmentDataRef": { + "type": "AttachmentDataRef", + "id": 1 + } + } + }, + "User": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "domainId": { + "type": "string", + "id": 6 + }, + "type": { + "type": "Type", + "id": 5 + }, + "isAnonymous": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "HUMAN": 1, + "BOT": 2 + } + } + } + }, + "ChatService": { + "options": { + "(google.api.default_host)": "chat.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/chat.admin.delete,https://www.googleapis.com/auth/chat.admin.memberships,https://www.googleapis.com/auth/chat.admin.memberships.readonly,https://www.googleapis.com/auth/chat.admin.spaces,https://www.googleapis.com/auth/chat.admin.spaces.readonly,https://www.googleapis.com/auth/chat.bot,https://www.googleapis.com/auth/chat.delete,https://www.googleapis.com/auth/chat.import,https://www.googleapis.com/auth/chat.memberships,https://www.googleapis.com/auth/chat.memberships.app,https://www.googleapis.com/auth/chat.memberships.readonly,https://www.googleapis.com/auth/chat.messages,https://www.googleapis.com/auth/chat.messages.create,https://www.googleapis.com/auth/chat.messages.reactions,https://www.googleapis.com/auth/chat.messages.reactions.create,https://www.googleapis.com/auth/chat.messages.reactions.readonly,https://www.googleapis.com/auth/chat.messages.readonly,https://www.googleapis.com/auth/chat.spaces,https://www.googleapis.com/auth/chat.spaces.create,https://www.googleapis.com/auth/chat.spaces.readonly,https://www.googleapis.com/auth/chat.users.readstate,https://www.googleapis.com/auth/chat.users.readstate.readonly" + }, + "methods": { + "CreateMessage": { + "requestType": "CreateMessageRequest", + "responseType": "Message", + "options": { + "(google.api.http).post": "/v1/{parent=spaces/*}/messages", + "(google.api.http).body": "message", + "(google.api.method_signature)": "parent,message,message_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=spaces/*}/messages", + "body": "message" + } + }, + { + "(google.api.method_signature)": "parent,message,message_id" + } + ] + }, + "ListMessages": { + "requestType": "ListMessagesRequest", + "responseType": "ListMessagesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=spaces/*}/messages", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=spaces/*}/messages" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListMemberships": { + "requestType": "ListMembershipsRequest", + "responseType": "ListMembershipsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=spaces/*}/members", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=spaces/*}/members" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetMembership": { + "requestType": "GetMembershipRequest", + "responseType": "Membership", + "options": { + "(google.api.http).get": "/v1/{name=spaces/*/members/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=spaces/*/members/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetMessage": { + "requestType": "GetMessageRequest", + "responseType": "Message", + "options": { + "(google.api.http).get": "/v1/{name=spaces/*/messages/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=spaces/*/messages/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateMessage": { + "requestType": "UpdateMessageRequest", + "responseType": "Message", + "options": { + "(google.api.http).put": "/v1/{message.name=spaces/*/messages/*}", + "(google.api.http).body": "message", + "(google.api.http).additional_bindings.patch": "/v1/{message.name=spaces/*/messages/*}", + "(google.api.http).additional_bindings.body": "message", + "(google.api.method_signature)": "message,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1/{message.name=spaces/*/messages/*}", + "body": "message", + "additional_bindings": { + "patch": "/v1/{message.name=spaces/*/messages/*}", + "body": "message" + } + } + }, + { + "(google.api.method_signature)": "message,update_mask" + } + ] + }, + "DeleteMessage": { + "requestType": "DeleteMessageRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=spaces/*/messages/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=spaces/*/messages/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetAttachment": { + "requestType": "GetAttachmentRequest", + "responseType": "Attachment", + "options": { + "(google.api.http).get": "/v1/{name=spaces/*/messages/*/attachments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=spaces/*/messages/*/attachments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UploadAttachment": { + "requestType": "UploadAttachmentRequest", + "responseType": "UploadAttachmentResponse", + "options": { + "(google.api.http).post": "/v1/{parent=spaces/*}/attachments:upload", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=spaces/*}/attachments:upload", + "body": "*" + } + } + ] + }, + "ListSpaces": { + "requestType": "ListSpacesRequest", + "responseType": "ListSpacesResponse", + "options": { + "(google.api.http).get": "/v1/spaces", + "(google.api.method_signature)": "" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/spaces" + } + }, + { + "(google.api.method_signature)": "" + } + ] + }, + "SearchSpaces": { + "requestType": "SearchSpacesRequest", + "responseType": "SearchSpacesResponse", + "options": { + "(google.api.http).get": "/v1/spaces:search", + "(google.api.method_signature)": "" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/spaces:search" + } + }, + { + "(google.api.method_signature)": "" + } + ] + }, + "GetSpace": { + "requestType": "GetSpaceRequest", + "responseType": "Space", + "options": { + "(google.api.http).get": "/v1/{name=spaces/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=spaces/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateSpace": { + "requestType": "CreateSpaceRequest", + "responseType": "Space", + "options": { + "(google.api.http).post": "/v1/spaces", + "(google.api.http).body": "space", + "(google.api.method_signature)": "space" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/spaces", + "body": "space" + } + }, + { + "(google.api.method_signature)": "space" + } + ] + }, + "SetUpSpace": { + "requestType": "SetUpSpaceRequest", + "responseType": "Space", + "options": { + "(google.api.http).post": "/v1/spaces:setup", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/spaces:setup", + "body": "*" + } + } + ] + }, + "UpdateSpace": { + "requestType": "UpdateSpaceRequest", + "responseType": "Space", + "options": { + "(google.api.http).patch": "/v1/{space.name=spaces/*}", + "(google.api.http).body": "space", + "(google.api.method_signature)": "space,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{space.name=spaces/*}", + "body": "space" + } + }, + { + "(google.api.method_signature)": "space,update_mask" + } + ] + }, + "DeleteSpace": { + "requestType": "DeleteSpaceRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=spaces/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=spaces/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CompleteImportSpace": { + "requestType": "CompleteImportSpaceRequest", + "responseType": "CompleteImportSpaceResponse", + "options": { + "(google.api.http).post": "/v1/{name=spaces/*}:completeImport", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=spaces/*}:completeImport", + "body": "*" + } + } + ] + }, + "FindDirectMessage": { + "requestType": "FindDirectMessageRequest", + "responseType": "Space", + "options": { + "(google.api.http).get": "/v1/spaces:findDirectMessage" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/spaces:findDirectMessage" + } + } + ] + }, + "CreateMembership": { + "requestType": "CreateMembershipRequest", + "responseType": "Membership", + "options": { + "(google.api.http).post": "/v1/{parent=spaces/*}/members", + "(google.api.http).body": "membership", + "(google.api.method_signature)": "parent,membership" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=spaces/*}/members", + "body": "membership" + } + }, + { + "(google.api.method_signature)": "parent,membership" + } + ] + }, + "UpdateMembership": { + "requestType": "UpdateMembershipRequest", + "responseType": "Membership", + "options": { + "(google.api.http).patch": "/v1/{membership.name=spaces/*/members/*}", + "(google.api.http).body": "membership", + "(google.api.method_signature)": "membership,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{membership.name=spaces/*/members/*}", + "body": "membership" + } + }, + { + "(google.api.method_signature)": "membership,update_mask" + } + ] + }, + "DeleteMembership": { + "requestType": "DeleteMembershipRequest", + "responseType": "Membership", + "options": { + "(google.api.http).delete": "/v1/{name=spaces/*/members/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=spaces/*/members/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateReaction": { + "requestType": "CreateReactionRequest", + "responseType": "Reaction", + "options": { + "(google.api.http).post": "/v1/{parent=spaces/*/messages/*}/reactions", + "(google.api.http).body": "reaction", + "(google.api.method_signature)": "parent,reaction" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=spaces/*/messages/*}/reactions", + "body": "reaction" + } + }, + { + "(google.api.method_signature)": "parent,reaction" + } + ] + }, + "ListReactions": { + "requestType": "ListReactionsRequest", + "responseType": "ListReactionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=spaces/*/messages/*}/reactions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=spaces/*/messages/*}/reactions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteReaction": { + "requestType": "DeleteReactionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=spaces/*/messages/*/reactions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=spaces/*/messages/*/reactions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSpaceReadState": { + "requestType": "GetSpaceReadStateRequest", + "responseType": "SpaceReadState", + "options": { + "(google.api.http).get": "/v1/{name=users/*/spaces/*/spaceReadState}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=users/*/spaces/*/spaceReadState}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateSpaceReadState": { + "requestType": "UpdateSpaceReadStateRequest", + "responseType": "SpaceReadState", + "options": { + "(google.api.http).patch": "/v1/{space_read_state.name=users/*/spaces/*/spaceReadState}", + "(google.api.http).body": "space_read_state", + "(google.api.method_signature)": "space_read_state,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{space_read_state.name=users/*/spaces/*/spaceReadState}", + "body": "space_read_state" + } + }, + { + "(google.api.method_signature)": "space_read_state,update_mask" + } + ] + }, + "GetThreadReadState": { + "requestType": "GetThreadReadStateRequest", + "responseType": "ThreadReadState", + "options": { + "(google.api.http).get": "/v1/{name=users/*/spaces/*/threads/*/threadReadState}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=users/*/spaces/*/threads/*/threadReadState}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSpaceEvent": { + "requestType": "GetSpaceEventRequest", + "responseType": "SpaceEvent", + "options": { + "(google.api.http).get": "/v1/{name=spaces/*/spaceEvents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=spaces/*/spaceEvents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSpaceEvents": { + "requestType": "ListSpaceEventsRequest", + "responseType": "ListSpaceEventsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=spaces/*}/spaceEvents", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=spaces/*}/spaceEvents" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + } + } + }, + "Membership": { + "options": { + "(google.api.resource).type": "chat.googleapis.com/Membership", + "(google.api.resource).pattern": "spaces/{space}/members/{member}" + }, + "oneofs": { + "memberType": { + "oneof": [ + "member", + "groupMember" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "chat.googleapis.com/Membership" + } + }, + "state": { + "type": "MembershipState", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "role": { + "type": "MembershipRole", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "member": { + "type": "User", + "id": 3 + }, + "groupMember": { + "type": "Group", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MembershipState": { + "values": { + "MEMBERSHIP_STATE_UNSPECIFIED": 0, + "JOINED": 1, + "INVITED": 2, + "NOT_A_MEMBER": 3 + } + }, + "MembershipRole": { + "values": { + "MEMBERSHIP_ROLE_UNSPECIFIED": 0, + "ROLE_MEMBER": 1, + "ROLE_MANAGER": 2 + } + } + } + }, + "CreateMembershipRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "chat.googleapis.com/Membership" + } + }, + "membership": { + "type": "Membership", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "useAdminAccess": { + "type": "bool", + "id": 5 + } + } + }, + "UpdateMembershipRequest": { + "fields": { + "membership": { + "type": "Membership", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "useAdminAccess": { + "type": "bool", + "id": 3 + } + } + }, + "ListMembershipsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "chat.googleapis.com/Membership" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "showGroups": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "showInvited": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "useAdminAccess": { + "type": "bool", + "id": 8 + } + } + }, + "ListMembershipsResponse": { + "fields": { + "memberships": { + "rule": "repeated", + "type": "Membership", + "id": 1, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetMembershipRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/Membership" + } + }, + "useAdminAccess": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteMembershipRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/Membership" + } + }, + "useAdminAccess": { + "type": "bool", + "id": 2 + } + } + }, + "Group": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "Message": { + "options": { + "(google.api.resource).type": "chat.googleapis.com/Message", + "(google.api.resource).pattern": "spaces/{space}/messages/{message}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "sender": { + "type": "User", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "text": { + "type": "string", + "id": 4 + }, + "formattedText": { + "type": "string", + "id": 43, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cards": { + "rule": "repeated", + "type": "ContextualAddOnMarkup.Card", + "id": 5, + "options": { + "deprecated": true + } + }, + "cardsV2": { + "rule": "repeated", + "type": "CardWithId", + "id": 22 + }, + "annotations": { + "rule": "repeated", + "type": "Annotation", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "thread": { + "type": "Thread", + "id": 11 + }, + "space": { + "type": "Space", + "id": 12 + }, + "fallbackText": { + "type": "string", + "id": 13 + }, + "actionResponse": { + "type": "ActionResponse", + "id": 14, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "argumentText": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "slashCommand": { + "type": "SlashCommand", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attachment": { + "rule": "repeated", + "type": "Attachment", + "id": 18 + }, + "matchedUrl": { + "type": "MatchedUrl", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "threadReply": { + "type": "bool", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clientAssignedMessageId": { + "type": "string", + "id": 32 + }, + "emojiReactionSummaries": { + "rule": "repeated", + "type": "EmojiReactionSummary", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "privateMessageViewer": { + "type": "User", + "id": 36, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "deletionMetadata": { + "type": "DeletionMetadata", + "id": 38, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "quotedMessageMetadata": { + "type": "QuotedMessageMetadata", + "id": 39, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attachedGifs": { + "rule": "repeated", + "type": "AttachedGif", + "id": 42, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "accessoryWidgets": { + "rule": "repeated", + "type": "AccessoryWidget", + "id": 44 + } + } + }, + "AttachedGif": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "QuotedMessageMetadata": { + "options": { + "(google.api.resource).type": "chat.googleapis.com/QuotedMessageMetadata", + "(google.api.resource).pattern": "spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "chat.googleapis.com/Message" + } + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Thread": { + "options": { + "(google.api.resource).type": "chat.googleapis.com/Thread", + "(google.api.resource).pattern": "spaces/{space}/threads/{thread}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "threadKey": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ActionResponse": { + "fields": { + "type": { + "type": "ResponseType", + "id": 1, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "url": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "dialogAction": { + "type": "DialogAction", + "id": 3, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "updatedWidget": { + "type": "UpdatedWidget", + "id": 4, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + }, + "nested": { + "ResponseType": { + "values": { + "TYPE_UNSPECIFIED": 0, + "NEW_MESSAGE": 1, + "UPDATE_MESSAGE": 2, + "UPDATE_USER_MESSAGE_CARDS": 6, + "REQUEST_CONFIG": 3, + "DIALOG": 4, + "UPDATE_WIDGET": 7 + } + }, + "SelectionItems": { + "fields": { + "items": { + "rule": "repeated", + "type": "google.apps.card.v1.SelectionInput.SelectionItem", + "id": 1 + } + } + }, + "UpdatedWidget": { + "oneofs": { + "updatedWidget": { + "oneof": [ + "suggestions" + ] + } + }, + "fields": { + "suggestions": { + "type": "SelectionItems", + "id": 1 + }, + "widget": { + "type": "string", + "id": 2 + } + } + } + } + }, + "AccessoryWidget": { + "oneofs": { + "action": { + "oneof": [ + "buttonList" + ] + } + }, + "fields": { + "buttonList": { + "type": "google.apps.card.v1.ButtonList", + "id": 1 + } + } + }, + "GetMessageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/Message" + } + } + } + }, + "DeleteMessageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/Message" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "UpdateMessageRequest": { + "fields": { + "message": { + "type": "Message", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateMessageRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "chat.googleapis.com/Message" + } + }, + "message": { + "type": "Message", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "threadKey": { + "type": "string", + "id": 6, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageReplyOption": { + "type": "MessageReplyOption", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageId": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MessageReplyOption": { + "values": { + "MESSAGE_REPLY_OPTION_UNSPECIFIED": 0, + "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD": 1, + "REPLY_MESSAGE_OR_FAIL": 2 + } + } + } + }, + "ListMessagesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "chat.googleapis.com/Message" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + }, + "showDeleted": { + "type": "bool", + "id": 6 + } + } + }, + "ListMessagesResponse": { + "fields": { + "messages": { + "rule": "repeated", + "type": "Message", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DialogAction": { + "oneofs": { + "action": { + "oneof": [ + "dialog" + ] + } + }, + "fields": { + "dialog": { + "type": "Dialog", + "id": 1, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "actionStatus": { + "type": "ActionStatus", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "Dialog": { + "fields": { + "body": { + "type": "google.apps.card.v1.Card", + "id": 1, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "CardWithId": { + "fields": { + "cardId": { + "type": "string", + "id": 1 + }, + "card": { + "type": "google.apps.card.v1.Card", + "id": 2 + } + } + }, + "ContextualAddOnMarkup": { + "fields": {}, + "nested": { + "Card": { + "fields": { + "header": { + "type": "CardHeader", + "id": 1 + }, + "sections": { + "rule": "repeated", + "type": "Section", + "id": 2 + }, + "cardActions": { + "rule": "repeated", + "type": "CardAction", + "id": 3 + }, + "name": { + "type": "string", + "id": 4 + } + }, + "nested": { + "CardHeader": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "subtitle": { + "type": "string", + "id": 2 + }, + "imageStyle": { + "type": "ImageStyle", + "id": 3 + }, + "imageUrl": { + "type": "string", + "id": 4 + } + }, + "nested": { + "ImageStyle": { + "values": { + "IMAGE_STYLE_UNSPECIFIED": 0, + "IMAGE": 1, + "AVATAR": 2 + } + } + } + }, + "Section": { + "fields": { + "header": { + "type": "string", + "id": 1 + }, + "widgets": { + "rule": "repeated", + "type": "WidgetMarkup", + "id": 2 + } + } + }, + "CardAction": { + "fields": { + "actionLabel": { + "type": "string", + "id": 1 + }, + "onClick": { + "type": "WidgetMarkup.OnClick", + "id": 2 + } + } + } + } + } + } + }, + "WidgetMarkup": { + "oneofs": { + "data": { + "oneof": [ + "textParagraph", + "image", + "keyValue" + ] + } + }, + "fields": { + "textParagraph": { + "type": "TextParagraph", + "id": 1 + }, + "image": { + "type": "Image", + "id": 2 + }, + "keyValue": { + "type": "KeyValue", + "id": 3 + }, + "buttons": { + "rule": "repeated", + "type": "Button", + "id": 6 + } + }, + "nested": { + "TextParagraph": { + "fields": { + "text": { + "type": "string", + "id": 1 + } + } + }, + "Icon": { + "values": { + "ICON_UNSPECIFIED": 0, + "AIRPLANE": 1, + "BOOKMARK": 26, + "BUS": 25, + "CAR": 9, + "CLOCK": 2, + "CONFIRMATION_NUMBER_ICON": 12, + "DOLLAR": 14, + "DESCRIPTION": 27, + "EMAIL": 10, + "EVENT_PERFORMER": 20, + "EVENT_SEAT": 21, + "FLIGHT_ARRIVAL": 16, + "FLIGHT_DEPARTURE": 15, + "HOTEL": 6, + "HOTEL_ROOM_TYPE": 17, + "INVITE": 19, + "MAP_PIN": 3, + "MEMBERSHIP": 24, + "MULTIPLE_PEOPLE": 18, + "OFFER": 30, + "PERSON": 11, + "PHONE": 13, + "RESTAURANT_ICON": 7, + "SHOPPING_CART": 8, + "STAR": 5, + "STORE": 22, + "TICKET": 4, + "TRAIN": 23, + "VIDEO_CAMERA": 28, + "VIDEO_PLAY": 29 + } + }, + "Button": { + "oneofs": { + "type": { + "oneof": [ + "textButton", + "imageButton" + ] + } + }, + "fields": { + "textButton": { + "type": "TextButton", + "id": 1 + }, + "imageButton": { + "type": "ImageButton", + "id": 2 + } + } + }, + "TextButton": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "onClick": { + "type": "OnClick", + "id": 2 + } + } + }, + "KeyValue": { + "oneofs": { + "icons": { + "oneof": [ + "icon", + "iconUrl" + ] + }, + "control": { + "oneof": [ + "button" + ] + } + }, + "fields": { + "icon": { + "type": "Icon", + "id": 1 + }, + "iconUrl": { + "type": "string", + "id": 2 + }, + "topLabel": { + "type": "string", + "id": 3 + }, + "content": { + "type": "string", + "id": 4 + }, + "contentMultiline": { + "type": "bool", + "id": 9 + }, + "bottomLabel": { + "type": "string", + "id": 5 + }, + "onClick": { + "type": "OnClick", + "id": 6 + }, + "button": { + "type": "Button", + "id": 7 + } + } + }, + "Image": { + "fields": { + "imageUrl": { + "type": "string", + "id": 1 + }, + "onClick": { + "type": "OnClick", + "id": 2 + }, + "aspectRatio": { + "type": "double", + "id": 3 + } + } + }, + "ImageButton": { + "oneofs": { + "icons": { + "oneof": [ + "icon", + "iconUrl" + ] + } + }, + "fields": { + "icon": { + "type": "Icon", + "id": 1 + }, + "iconUrl": { + "type": "string", + "id": 3 + }, + "onClick": { + "type": "OnClick", + "id": 2 + }, + "name": { + "type": "string", + "id": 4 + } + } + }, + "OnClick": { + "oneofs": { + "data": { + "oneof": [ + "action", + "openLink" + ] + } + }, + "fields": { + "action": { + "type": "FormAction", + "id": 1 + }, + "openLink": { + "type": "OpenLink", + "id": 2 + } + } + }, + "OpenLink": { + "fields": { + "url": { + "type": "string", + "id": 1 + } + } + }, + "FormAction": { + "fields": { + "actionMethodName": { + "type": "string", + "id": 1 + }, + "parameters": { + "rule": "repeated", + "type": "ActionParameter", + "id": 2 + } + }, + "nested": { + "ActionParameter": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + } + } + }, + "DeletionMetadata": { + "fields": { + "deletionType": { + "type": "DeletionType", + "id": 1 + } + }, + "nested": { + "DeletionType": { + "values": { + "DELETION_TYPE_UNSPECIFIED": 0, + "CREATOR": 1, + "SPACE_OWNER": 2, + "ADMIN": 3, + "APP_MESSAGE_EXPIRY": 4, + "CREATOR_VIA_APP": 5, + "SPACE_OWNER_VIA_APP": 6 + } + } + } + }, + "MatchedUrl": { + "fields": { + "url": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Reaction": { + "options": { + "(google.api.resource).type": "chat.googleapis.com/Reaction", + "(google.api.resource).pattern": "spaces/{space}/messages/{message}/reactions/{reaction}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "user": { + "type": "User", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "emoji": { + "type": "Emoji", + "id": 3 + } + } + }, + "Emoji": { + "oneofs": { + "content": { + "oneof": [ + "unicode", + "customEmoji" + ] + } + }, + "fields": { + "unicode": { + "type": "string", + "id": 1 + }, + "customEmoji": { + "type": "CustomEmoji", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CustomEmoji": { + "fields": { + "uid": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "EmojiReactionSummary": { + "oneofs": { + "_reactionCount": { + "oneof": [ + "reactionCount" + ] + } + }, + "fields": { + "emoji": { + "type": "Emoji", + "id": 1 + }, + "reactionCount": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "CreateReactionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "chat.googleapis.com/Reaction" + } + }, + "reaction": { + "type": "Reaction", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListReactionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "chat.googleapis.com/Reaction" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListReactionsResponse": { + "fields": { + "reactions": { + "rule": "repeated", + "type": "Reaction", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteReactionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/Reaction" + } + } + } + }, + "SlashCommand": { + "fields": { + "commandId": { + "type": "int64", + "id": 1 + } + } + }, + "Space": { + "options": { + "(google.api.resource).type": "chat.googleapis.com/Space", + "(google.api.resource).pattern": "spaces/{space}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "spaceType": { + "type": "SpaceType", + "id": 10 + }, + "singleUserBotDm": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "threaded": { + "type": "bool", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 3 + }, + "externalUserAllowed": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "spaceThreadingState": { + "type": "SpaceThreadingState", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "spaceDetails": { + "type": "SpaceDetails", + "id": 11 + }, + "spaceHistoryState": { + "type": "HistoryState", + "id": 13 + }, + "importMode": { + "type": "bool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lastActiveTime": { + "type": "google.protobuf.Timestamp", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "adminInstalled": { + "type": "bool", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "membershipCount": { + "type": "MembershipCount", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "accessSettings": { + "type": "AccessSettings", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "spaceUri": { + "type": "string", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ROOM": 1, + "DM": 2 + } + }, + "SpaceType": { + "values": { + "SPACE_TYPE_UNSPECIFIED": 0, + "SPACE": 1, + "GROUP_CHAT": 2, + "DIRECT_MESSAGE": 3 + } + }, + "SpaceThreadingState": { + "values": { + "SPACE_THREADING_STATE_UNSPECIFIED": 0, + "THREADED_MESSAGES": 2, + "GROUPED_MESSAGES": 3, + "UNTHREADED_MESSAGES": 4 + } + }, + "SpaceDetails": { + "fields": { + "description": { + "type": "string", + "id": 1 + }, + "guidelines": { + "type": "string", + "id": 2 + } + } + }, + "MembershipCount": { + "fields": { + "joinedDirectHumanUserCount": { + "type": "int32", + "id": 4 + }, + "joinedGroupCount": { + "type": "int32", + "id": 5 + } + } + }, + "AccessSettings": { + "fields": { + "accessState": { + "type": "AccessState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "audience": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AccessState": { + "values": { + "ACCESS_STATE_UNSPECIFIED": 0, + "PRIVATE": 1, + "DISCOVERABLE": 2 + } + } + } + } + } + }, + "CreateSpaceRequest": { + "fields": { + "space": { + "type": "Space", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSpacesRequest": { + "fields": { + "pageSize": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSpacesResponse": { + "fields": { + "spaces": { + "rule": "repeated", + "type": "Space", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetSpaceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/Space" + } + }, + "useAdminAccess": { + "type": "bool", + "id": 2 + } + } + }, + "FindDirectMessageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateSpaceRequest": { + "fields": { + "space": { + "type": "Space", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "useAdminAccess": { + "type": "bool", + "id": 3 + } + } + }, + "SearchSpacesRequest": { + "fields": { + "useAdminAccess": { + "type": "bool", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "query": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchSpacesResponse": { + "fields": { + "spaces": { + "rule": "repeated", + "type": "Space", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + } + } + }, + "DeleteSpaceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/Space" + } + }, + "useAdminAccess": { + "type": "bool", + "id": 2 + } + } + }, + "CompleteImportSpaceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/Space" + } + } + } + }, + "CompleteImportSpaceResponse": { + "fields": { + "space": { + "type": "Space", + "id": 1 + } + } + }, + "HistoryState": { + "values": { + "HISTORY_STATE_UNSPECIFIED": 0, + "HISTORY_OFF": 1, + "HISTORY_ON": 2 + } + }, + "SpaceEvent": { + "options": { + "(google.api.resource).type": "chat.googleapis.com/SpaceEvent", + "(google.api.resource).pattern": "spaces/{space}/spaceEvents/{space_event}" + }, + "oneofs": { + "payload": { + "oneof": [ + "messageCreatedEventData", + "messageUpdatedEventData", + "messageDeletedEventData", + "messageBatchCreatedEventData", + "messageBatchUpdatedEventData", + "messageBatchDeletedEventData", + "spaceUpdatedEventData", + "spaceBatchUpdatedEventData", + "membershipCreatedEventData", + "membershipUpdatedEventData", + "membershipDeletedEventData", + "membershipBatchCreatedEventData", + "membershipBatchUpdatedEventData", + "membershipBatchDeletedEventData", + "reactionCreatedEventData", + "reactionDeletedEventData", + "reactionBatchCreatedEventData", + "reactionBatchDeletedEventData" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "eventType": { + "type": "string", + "id": 6 + }, + "messageCreatedEventData": { + "type": "MessageCreatedEventData", + "id": 12 + }, + "messageUpdatedEventData": { + "type": "MessageUpdatedEventData", + "id": 13 + }, + "messageDeletedEventData": { + "type": "MessageDeletedEventData", + "id": 14 + }, + "messageBatchCreatedEventData": { + "type": "MessageBatchCreatedEventData", + "id": 26 + }, + "messageBatchUpdatedEventData": { + "type": "MessageBatchUpdatedEventData", + "id": 27 + }, + "messageBatchDeletedEventData": { + "type": "MessageBatchDeletedEventData", + "id": 28 + }, + "spaceUpdatedEventData": { + "type": "SpaceUpdatedEventData", + "id": 15 + }, + "spaceBatchUpdatedEventData": { + "type": "SpaceBatchUpdatedEventData", + "id": 29 + }, + "membershipCreatedEventData": { + "type": "MembershipCreatedEventData", + "id": 17 + }, + "membershipUpdatedEventData": { + "type": "MembershipUpdatedEventData", + "id": 18 + }, + "membershipDeletedEventData": { + "type": "MembershipDeletedEventData", + "id": 219 + }, + "membershipBatchCreatedEventData": { + "type": "MembershipBatchCreatedEventData", + "id": 31 + }, + "membershipBatchUpdatedEventData": { + "type": "MembershipBatchUpdatedEventData", + "id": 32 + }, + "membershipBatchDeletedEventData": { + "type": "MembershipBatchDeletedEventData", + "id": 33 + }, + "reactionCreatedEventData": { + "type": "ReactionCreatedEventData", + "id": 21 + }, + "reactionDeletedEventData": { + "type": "ReactionDeletedEventData", + "id": 22 + }, + "reactionBatchCreatedEventData": { + "type": "ReactionBatchCreatedEventData", + "id": 34 + }, + "reactionBatchDeletedEventData": { + "type": "ReactionBatchDeletedEventData", + "id": 35 + } + } + }, + "GetSpaceEventRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/SpaceEvent" + } + } + } + }, + "ListSpaceEventsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "chat.googleapis.com/SpaceEvent" + } + }, + "pageSize": { + "type": "int32", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 6 + }, + "filter": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListSpaceEventsResponse": { + "fields": { + "spaceEvents": { + "rule": "repeated", + "type": "SpaceEvent", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "MembershipCreatedEventData": { + "fields": { + "membership": { + "type": "Membership", + "id": 1 + } + } + }, + "MembershipDeletedEventData": { + "fields": { + "membership": { + "type": "Membership", + "id": 1 + } + } + }, + "MembershipUpdatedEventData": { + "fields": { + "membership": { + "type": "Membership", + "id": 1 + } + } + }, + "MembershipBatchCreatedEventData": { + "fields": { + "memberships": { + "rule": "repeated", + "type": "MembershipCreatedEventData", + "id": 1 + } + } + }, + "MembershipBatchUpdatedEventData": { + "fields": { + "memberships": { + "rule": "repeated", + "type": "MembershipUpdatedEventData", + "id": 1 + } + } + }, + "MembershipBatchDeletedEventData": { + "fields": { + "memberships": { + "rule": "repeated", + "type": "MembershipDeletedEventData", + "id": 1 + } + } + }, + "MessageCreatedEventData": { + "fields": { + "message": { + "type": "Message", + "id": 1 + } + } + }, + "MessageUpdatedEventData": { + "fields": { + "message": { + "type": "Message", + "id": 1 + } + } + }, + "MessageDeletedEventData": { + "fields": { + "message": { + "type": "Message", + "id": 1 + } + } + }, + "MessageBatchCreatedEventData": { + "fields": { + "messages": { + "rule": "repeated", + "type": "MessageCreatedEventData", + "id": 1 + } + } + }, + "MessageBatchUpdatedEventData": { + "fields": { + "messages": { + "rule": "repeated", + "type": "MessageUpdatedEventData", + "id": 1 + } + } + }, + "MessageBatchDeletedEventData": { + "fields": { + "messages": { + "rule": "repeated", + "type": "MessageDeletedEventData", + "id": 1 + } + } + }, + "SpaceUpdatedEventData": { + "fields": { + "space": { + "type": "Space", + "id": 1 + } + } + }, + "SpaceBatchUpdatedEventData": { + "fields": { + "spaces": { + "rule": "repeated", + "type": "SpaceUpdatedEventData", + "id": 1 + } + } + }, + "ReactionCreatedEventData": { + "fields": { + "reaction": { + "type": "Reaction", + "id": 1 + } + } + }, + "ReactionDeletedEventData": { + "fields": { + "reaction": { + "type": "Reaction", + "id": 1 + } + } + }, + "ReactionBatchCreatedEventData": { + "fields": { + "reactions": { + "rule": "repeated", + "type": "ReactionCreatedEventData", + "id": 1 + } + } + }, + "ReactionBatchDeletedEventData": { + "fields": { + "reactions": { + "rule": "repeated", + "type": "ReactionDeletedEventData", + "id": 1 + } + } + }, + "SpaceReadState": { + "options": { + "(google.api.resource).type": "chat.googleapis.com/SpaceReadState", + "(google.api.resource).pattern": "users/{user}/spaces/{space}/spaceReadState", + "(google.api.resource).singular": "spaceReadState" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "lastReadTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetSpaceReadStateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/SpaceReadState" + } + } + } + }, + "UpdateSpaceReadStateRequest": { + "fields": { + "spaceReadState": { + "type": "SpaceReadState", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetUpSpaceRequest": { + "fields": { + "space": { + "type": "Space", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "memberships": { + "rule": "repeated", + "type": "Membership", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ThreadReadState": { + "options": { + "(google.api.resource).type": "chat.googleapis.com/ThreadReadState", + "(google.api.resource).pattern": "users/{user}/spaces/{space}/threads/{thread}/threadReadState", + "(google.api.resource).singular": "threadReadState" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "lastReadTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "GetThreadReadStateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/ThreadReadState" + } + } + } + } + } + } + } + }, + "rpc": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/rpc/code;code", + "java_multiple_files": true, + "java_outer_classname": "CodeProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Code": { + "values": { + "OK": 0, + "CANCELLED": 1, + "UNKNOWN": 2, + "INVALID_ARGUMENT": 3, + "DEADLINE_EXCEEDED": 4, + "NOT_FOUND": 5, + "ALREADY_EXISTS": 6, + "PERMISSION_DENIED": 7, + "UNAUTHENTICATED": 16, + "RESOURCE_EXHAUSTED": 8, + "FAILED_PRECONDITION": 9, + "ABORTED": 10, + "OUT_OF_RANGE": 11, + "UNIMPLEMENTED": 12, + "INTERNAL": 13, + "UNAVAILABLE": 14, + "DATA_LOSS": 15 + } + } + } + }, + "api": { + "options": { + "cc_enable_arenas": true, + "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" + }, + "nested": { + "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 + } + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.complete_import_space.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.complete_import_space.js new file mode 100644 index 00000000000..bdc8930e688 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.complete_import_space.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START chat_v1_generated_ChatService_CompleteImportSpace_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the import mode space. + * Format: `spaces/{space}` + */ + // const name = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callCompleteImportSpace() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.completeImportSpace(request); + console.log(response); + } + + callCompleteImportSpace(); + // [END chat_v1_generated_ChatService_CompleteImportSpace_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_membership.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_membership.js new file mode 100644 index 00000000000..3931cf503f9 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_membership.js @@ -0,0 +1,96 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, membership) { + // [START chat_v1_generated_ChatService_CreateMembership_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 space for which to create the + * membership. + * Format: spaces/{space} + */ + // const parent = 'abc123' + /** + * Required. The membership relation to create. + * The `memberType` field must contain a user with the `user.name` and + * `user.type` fields populated. The server will assign a resource name + * and overwrite anything specified. + * When a Chat app creates a membership relation for a human user, it must use + * the `chat.memberships` scope, set `user.type` to `HUMAN`, and set + * `user.name` with format `users/{user}`, where `{user}` can be the email + * address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` of the + * person (https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the user in the Directory API. For example, if + * the People API Person profile ID for `user@example.com` is `123456789`, you + * can add the user to the space by setting the `membership.member.name` to + * `users/user@example.com` or `users/123456789`. When a Chat app creates a + * membership relation for itself, it must use the `chat.memberships.app` + * scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + */ + // const membership = {} + /** + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * The calling user must be a Google Workspace administrator with the + * manage chat and spaces conversations + * privilege (https://support.google.com/a/answer/13369245). + * Requires the `chat.admin.memberships` OAuth 2.0 + * scope (https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * Creating app memberships or creating memberships for users outside the + * administrator's Google Workspace organization isn't supported using admin + * access. + */ + // const useAdminAccess = true + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callCreateMembership() { + // Construct request + const request = { + parent, + membership, + }; + + // Run request + const response = await chatClient.createMembership(request); + console.log(response); + } + + callCreateMembership(); + // [END chat_v1_generated_ChatService_CreateMembership_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_message.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_message.js new file mode 100644 index 00000000000..e5c328bc56b --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_message.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, message) { + // [START chat_v1_generated_ChatService_CreateMessage_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 space in which to create a message. + * Format: `spaces/{space}` + */ + // const parent = 'abc123' + /** + * Required. Message body. + */ + // const message = {} + /** + * Optional. A unique request ID for this message. Specifying an existing + * request ID returns the message created with that ID instead of creating a + * new message. + */ + // const requestId = 'abc123' + /** + * Optional. Specifies whether a message starts a thread or replies to one. + * Only supported in named spaces. + */ + // const messageReplyOption = {} + /** + * Optional. A custom ID for a message. Lets Chat apps get, update, or delete + * a message without needing to store the system-assigned ID in the message's + * resource name (represented in the message `name` field). + * The value for this field must meet the following requirements: + * * Begins with `client-`. For example, `client-custom-name` is a valid + * custom ID, but `custom-name` is not. + * * Contains up to 63 characters and only lowercase letters, numbers, and + * hyphens. + * * Is unique within a space. A Chat app can't use the same custom ID for + * different messages. + * For details, see Name a + * message (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). + */ + // const messageId = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callCreateMessage() { + // Construct request + const request = { + parent, + message, + }; + + // Run request + const response = await chatClient.createMessage(request); + console.log(response); + } + + callCreateMessage(); + // [END chat_v1_generated_ChatService_CreateMessage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_reaction.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_reaction.js new file mode 100644 index 00000000000..1550a816c99 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_reaction.js @@ -0,0 +1,67 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, reaction) { + // [START chat_v1_generated_ChatService_CreateReaction_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The message where the reaction is created. + * Format: `spaces/{space}/messages/{message}` + */ + // const parent = 'abc123' + /** + * Required. The reaction to create. + */ + // const reaction = {} + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callCreateReaction() { + // Construct request + const request = { + parent, + reaction, + }; + + // Run request + const response = await chatClient.createReaction(request); + console.log(response); + } + + callCreateReaction(); + // [END chat_v1_generated_ChatService_CreateReaction_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_space.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_space.js new file mode 100644 index 00000000000..b079785d5f2 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.create_space.js @@ -0,0 +1,76 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(space) { + // [START chat_v1_generated_ChatService_CreateSpace_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `displayName` and `spaceType` fields must be populated. Only + * `SpaceType.SPACE` is supported. + * If you receive the error message `ALREADY_EXISTS` when creating a space, + * try a different `displayName`. An existing space within the Google + * Workspace organization might already use this display name. + * The space `name` is assigned on the server so anything specified in this + * field will be ignored. + */ + // const space = {} + /** + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + */ + // const requestId = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callCreateSpace() { + // Construct request + const request = { + space, + }; + + // Run request + const response = await chatClient.createSpace(request); + console.log(response); + } + + callCreateSpace(); + // [END chat_v1_generated_ChatService_CreateSpace_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_membership.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_membership.js new file mode 100644 index 00000000000..0fe2f98d69d --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_membership.js @@ -0,0 +1,82 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START chat_v1_generated_ChatService_DeleteMembership_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the membership to delete. Chat apps can delete + * human users' or their own memberships. Chat apps can't delete other apps' + * memberships. + * When deleting a human membership, requires the `chat.memberships` scope and + * `spaces/{space}/members/{member}` format. You can use the email as an + * alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * When deleting an app membership, requires the `chat.memberships.app` scope + * and `spaces/{space}/members/app` format. + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + */ + // const name = 'abc123' + /** + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * The calling user must be a Google Workspace administrator with the + * manage chat and spaces conversations + * privilege (https://support.google.com/a/answer/13369245). + * Requires the `chat.admin.memberships` OAuth 2.0 + * scope (https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * Deleting app memberships in a space isn't supported using admin access. + */ + // const useAdminAccess = true + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callDeleteMembership() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.deleteMembership(request); + console.log(response); + } + + callDeleteMembership(); + // [END chat_v1_generated_ChatService_DeleteMembership_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_message.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_message.js new file mode 100644 index 00000000000..16f7a97b9db --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_message.js @@ -0,0 +1,75 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 chat_v1_generated_ChatService_DeleteMessage_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see Name a + * message + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). + */ + // const name = 'abc123' + /** + * When `true`, deleting a message also deletes its threaded replies. When + * `false`, if a message has threaded replies, deletion fails. + * Only applies when authenticating as a + * user (https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * Has no effect when authenticating as a Chat app + * (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + */ + // const force = true + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callDeleteMessage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.deleteMessage(request); + console.log(response); + } + + callDeleteMessage(); + // [END chat_v1_generated_ChatService_DeleteMessage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_reaction.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_reaction.js new file mode 100644 index 00000000000..1250c0eb289 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_reaction.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START chat_v1_generated_ChatService_DeleteReaction_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the reaction to delete. + * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + */ + // const name = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callDeleteReaction() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.deleteReaction(request); + console.log(response); + } + + callDeleteReaction(); + // [END chat_v1_generated_ChatService_DeleteReaction_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_space.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_space.js new file mode 100644 index 00000000000..bc74b47be03 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.delete_space.js @@ -0,0 +1,72 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 chat_v1_generated_ChatService_DeleteSpace_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the space to delete. + * Format: `spaces/{space}` + */ + // const name = 'abc123' + /** + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * The calling user must be a Google Workspace administrator with the + * manage chat and spaces conversations + * privilege (https://support.google.com/a/answer/13369245). + * Requires the `chat.admin.delete` OAuth 2.0 + * scope (https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + */ + // const useAdminAccess = true + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callDeleteSpace() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.deleteSpace(request); + console.log(response); + } + + callDeleteSpace(); + // [END chat_v1_generated_ChatService_DeleteSpace_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.find_direct_message.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.find_direct_message.js new file mode 100644 index 00000000000..aab56915a23 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.find_direct_message.js @@ -0,0 +1,72 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 chat_v1_generated_ChatService_FindDirectMessage_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the user to find direct message with. + * Format: `users/{user}`, where `{user}` is either the `id` for the + * person (https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the + * user (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + * in the Directory API. For example, if the People API profile ID is + * `123456789`, you can find a direct message with that person by using + * `users/123456789` as the `name`. When authenticated as a + * user (https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the email as an alias for `{user}`. For example, + * `users/example@gmail.com` where `example@gmail.com` is the email of the + * Google Chat user. + */ + // const name = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callFindDirectMessage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.findDirectMessage(request); + console.log(response); + } + + callFindDirectMessage(); + // [END chat_v1_generated_ChatService_FindDirectMessage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_attachment.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_attachment.js new file mode 100644 index 00000000000..78a8821b6e7 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_attachment.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START chat_v1_generated_ChatService_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. Resource name of the attachment, in the form + * `spaces/{space}/messages/{message}/attachments/{attachment}`. + */ + // const name = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callGetAttachment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.getAttachment(request); + console.log(response); + } + + callGetAttachment(); + // [END chat_v1_generated_ChatService_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-chat/v1/samples/generated/v1/chat_service.get_membership.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_membership.js new file mode 100644 index 00000000000..21260f3fe4b --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_membership.js @@ -0,0 +1,82 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START chat_v1_generated_ChatService_GetMembership_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the membership to retrieve. + * To get the app's own membership by using user + * authentication (https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can optionally use `spaces/{space}/members/app`. + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` + * When authenticated as a + * user (https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the user's email as an alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + */ + // const name = 'abc123' + /** + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * The calling user must be a Google Workspace administrator with the + * manage chat and spaces conversations + * privilege (https://support.google.com/a/answer/13369245). + * Requires the `chat.admin.memberships` or `chat.admin.memberships.readonly` + * OAuth 2.0 + * scopes (https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * Getting app memberships in a space isn't supported when using admin access. + */ + // const useAdminAccess = true + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callGetMembership() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.getMembership(request); + console.log(response); + } + + callGetMembership(); + // [END chat_v1_generated_ChatService_GetMembership_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_message.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_message.js new file mode 100644 index 00000000000..f7a015128b2 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_message.js @@ -0,0 +1,66 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START chat_v1_generated_ChatService_GetMessage_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see Name a + * message + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). + */ + // const name = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callGetMessage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.getMessage(request); + console.log(response); + } + + callGetMessage(); + // [END chat_v1_generated_ChatService_GetMessage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_space.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_space.js new file mode 100644 index 00000000000..0c5aff0f7d3 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_space.js @@ -0,0 +1,72 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 chat_v1_generated_ChatService_GetSpace_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the space, in the form `spaces/{space}`. + * Format: `spaces/{space}` + */ + // const name = 'abc123' + /** + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * The calling user must be a Google Workspace administrator with the + * manage chat and spaces conversations + * privilege (https://support.google.com/a/answer/13369245). + * Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` OAuth 2.0 + * scopes (https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + */ + // const useAdminAccess = true + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callGetSpace() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.getSpace(request); + console.log(response); + } + + callGetSpace(); + // [END chat_v1_generated_ChatService_GetSpace_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_space_event.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_space_event.js new file mode 100644 index 00000000000..d458cdff9cc --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_space_event.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START chat_v1_generated_ChatService_GetSpaceEvent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 space event. + * Format: `spaces/{space}/spaceEvents/{spaceEvent}` + */ + // const name = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callGetSpaceEvent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.getSpaceEvent(request); + console.log(response); + } + + callGetSpaceEvent(); + // [END chat_v1_generated_ChatService_GetSpaceEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_space_read_state.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_space_read_state.js new file mode 100644 index 00000000000..4dbf233dc90 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_space_read_state.js @@ -0,0 +1,69 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 chat_v1_generated_ChatService_GetSpaceReadState_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the space read state to retrieve. + * Only supports getting read state for the calling user. + * To refer to the calling user, set one of the following: + * - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`. + * - Their Workspace email address. For example, + * `users/user@example.com/spaces/{space}/spaceReadState`. + * - Their user id. For example, + * `users/123456789/spaces/{space}/spaceReadState`. + * Format: users/{user}/spaces/{space}/spaceReadState + */ + // const name = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callGetSpaceReadState() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.getSpaceReadState(request); + console.log(response); + } + + callGetSpaceReadState(); + // [END chat_v1_generated_ChatService_GetSpaceReadState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_thread_read_state.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_thread_read_state.js new file mode 100644 index 00000000000..4850f9eb237 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.get_thread_read_state.js @@ -0,0 +1,70 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 chat_v1_generated_ChatService_GetThreadReadState_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the thread read state to retrieve. + * Only supports getting read state for the calling user. + * To refer to the calling user, set one of the following: + * - The `me` alias. For example, + * `users/me/spaces/{space}/threads/{thread}/threadReadState`. + * - Their Workspace email address. For example, + * `users/user@example.com/spaces/{space}/threads/{thread}/threadReadState`. + * - Their user id. For example, + * `users/123456789/spaces/{space}/threads/{thread}/threadReadState`. + * Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState + */ + // const name = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callGetThreadReadState() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.getThreadReadState(request); + console.log(response); + } + + callGetThreadReadState(); + // [END chat_v1_generated_ChatService_GetThreadReadState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_memberships.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_memberships.js new file mode 100644 index 00000000000..5f15a3fc803 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_memberships.js @@ -0,0 +1,143 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated 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 chat_v1_generated_ChatService_ListMemberships_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 space for which to fetch a membership + * list. + * Format: spaces/{space} + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of memberships to return. The service might + * return fewer than this value. + * If unspecified, at most 100 memberships are returned. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * Negative values return an `INVALID_ARGUMENT` error. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous call to list memberships. + * Provide this parameter to retrieve the subsequent page. + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + */ + // const pageToken = 'abc123' + /** + * Optional. A query filter. + * You can filter memberships by a member's role + * (`role` (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * and type + * (`member.type` (https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)). + * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. + * To filter by type, set `member.type` to `HUMAN` or `BOT`. You can also + * filter for `member.type` using the `!=` operator. + * To filter by both role and type, use the `AND` operator. To filter by + * either role or type, use the `OR` operator. + * Either `member.type = "HUMAN"` or `member.type != "BOT"` is required + * when `use_admin_access` is set to true. Other member type filters will be + * rejected. + * For example, the following queries are valid: + * ``` + * role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + * member.type = "HUMAN" AND role = "ROLE_MANAGER" + * member.type != "BOT" + * ``` + * The following queries are invalid: + * ``` + * member.type = "HUMAN" AND member.type = "BOT" + * role = "ROLE_MANAGER" AND role = "ROLE_MEMBER" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + */ + // const filter = 'abc123' + /** + * Optional. When `true`, also returns memberships associated with a + * Google Group google.chat.v1.Membership.group_member, in + * addition to other types of memberships. If a + * filter google.chat.v1.ListMembershipsRequest.filter is set, + * Google Group google.chat.v1.Membership.group_member + * memberships that don't match the filter criteria aren't returned. + */ + // const showGroups = true + /** + * Optional. When `true`, also returns memberships associated with + * invited google.chat.v1.Membership.MembershipState.INVITED members, in + * addition to other types of memberships. If a + * filter is set, + * invited google.chat.v1.Membership.MembershipState.INVITED memberships + * that don't match the filter criteria aren't returned. + * Currently requires user + * authentication (https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + */ + // const showInvited = true + /** + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * The calling user must be a Google Workspace administrator with the + * manage chat and spaces conversations + * privilege (https://support.google.com/a/answer/13369245). + * Requires either the `chat.admin.memberships.readonly` or + * `chat.admin.memberships` OAuth 2.0 + * scope (https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * Listing app memberships in a space isn't supported when using admin access. + */ + // const useAdminAccess = true + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callListMemberships() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = chatClient.listMembershipsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMemberships(); + // [END chat_v1_generated_ChatService_ListMemberships_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_messages.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_messages.js new file mode 100644 index 00000000000..9c903910a4b --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_messages.js @@ -0,0 +1,125 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated 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 chat_v1_generated_ChatService_ListMessages_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 space to list messages from. + * Format: `spaces/{space}` + */ + // const parent = 'abc123' + /** + * The maximum number of messages returned. The service might return fewer + * messages than this value. + * If unspecified, at most 25 are returned. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * Negative values return an `INVALID_ARGUMENT` error. + */ + // const pageSize = 1234 + /** + * Optional, if resuming from a previous query. + * A page token received from a previous list messages call. Provide this + * parameter to retrieve the subsequent page. + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + */ + // const pageToken = 'abc123' + /** + * A query filter. + * You can filter messages by date (`create_time`) and thread (`thread.name`). + * To filter messages by the date they were created, specify the `create_time` + * with a timestamp in RFC-3339 (https://www.rfc-editor.org/rfc/rfc3339) + * format and double quotation marks. For example, + * `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to + * list messages that were created after a timestamp, or the less than + * operator `<` to list messages that were created before a timestamp. To + * filter messages within a time interval, use the `AND` operator between two + * timestamps. + * To filter by thread, specify the `thread.name`, formatted as + * `spaces/{space}/threads/{thread}`. You can only specify one + * `thread.name` per query. + * To filter by both thread and date, use the `AND` operator in your query. + * For example, the following queries are valid: + * ``` + * create_time > "2012-04-21T11:30:00-04:00" + * create_time > "2012-04-21T11:30:00-04:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * create_time > "2012-04-21T11:30:00+00:00" AND + * create_time < "2013-01-01T00:00:00+00:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + */ + // const filter = 'abc123' + /** + * Optional, if resuming from a previous query. + * How the list of messages is ordered. Specify a value to order by an + * ordering operation. Valid ordering operation values are as follows: + * - `ASC` for ascending. + * - `DESC` for descending. + * The default ordering is `create_time ASC`. + */ + // const orderBy = 'abc123' + /** + * Whether to include deleted messages. Deleted messages include deleted time + * and metadata about their deletion, but message content is unavailable. + */ + // const showDeleted = true + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callListMessages() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = chatClient.listMessagesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMessages(); + // [END chat_v1_generated_ChatService_ListMessages_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_reactions.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_reactions.js new file mode 100644 index 00000000000..9d553373cb5 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_reactions.js @@ -0,0 +1,116 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated 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 chat_v1_generated_ChatService_ListReactions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The message users reacted to. + * Format: `spaces/{space}/messages/{message}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of reactions returned. The service can return + * fewer reactions than this value. If unspecified, the default value is 25. + * The maximum value is 200; values above 200 are changed to 200. + */ + // const pageSize = 1234 + /** + * Optional. (If resuming from a previous query.) + * A page token received from a previous list reactions call. Provide this + * to retrieve the subsequent page. + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value might lead to unexpected results. + */ + // const pageToken = 'abc123' + /** + * Optional. A query filter. + * You can filter reactions by + * emoji (https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) + * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + * user (https://developers.google.com/workspace/chat/api/reference/rest/v1/User) + * (`user.name`). + * To filter reactions for multiple emojis or users, join similar fields + * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = + * "👍"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. + * To filter reactions by emoji and user, use the `AND` operator, such as + * `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. + * If your query uses both `AND` and `OR`, group them with parentheses. + * For example, the following queries are valid: + * ``` + * user.name = "users/{user}" + * emoji.unicode = "🙂" + * emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR emoji.unicode = "👍" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" AND user.name = "users/{user}" + * (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") + * AND user.name = "users/{user}" + * ``` + * The following queries are invalid: + * ``` + * emoji.unicode = "🙂" AND emoji.unicode = "👍" + * emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR + * user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * AND user.name = "users/{user}" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + */ + // const filter = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callListReactions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = chatClient.listReactionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListReactions(); + // [END chat_v1_generated_ChatService_ListReactions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_space_events.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_space_events.js new file mode 100644 index 00000000000..fafaf3d203b --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_space_events.js @@ -0,0 +1,127 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, filter) { + // [START chat_v1_generated_ChatService_ListSpaceEvents_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the Google Chat + * space (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + * where the events occurred. + * Format: `spaces/{space}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of space events returned. The service might + * return fewer than this value. + * Negative values return an `INVALID_ARGUMENT` error. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous list space events call. Provide this + * to retrieve the subsequent page. + * When paginating, all other parameters provided to list space events must + * match the call that provided the page token. Passing different values to + * the other parameters might lead to unexpected results. + */ + // const pageToken = 'abc123' + /** + * Required. A query filter. + * You must specify at least one event type (`event_type`) + * using the has `:` operator. To filter by multiple event types, use the `OR` + * operator. Omit batch event types in your filter. The request automatically + * returns any related batch events. For example, if you filter by new + * reactions + * (`google.workspace.chat.reaction.v1.created`), the server also returns + * batch new reactions events + * (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + * event types, see the `SpaceEvents` reference + * documentation (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + * Optionally, you can also filter by start time (`start_time`) and + * end time (`end_time`): + * * `start_time`: Exclusive timestamp from which to start listing space + * events. + * You can list events that occurred up to 28 days ago. If unspecified, lists + * space events from the past 28 days. + * * `end_time`: Inclusive timestamp until which space events are listed. + * If unspecified, lists events up to the time of the request. + * To specify a start or end time, use the equals `=` operator and format in + * RFC-3339 (https://www.rfc-editor.org/rfc/rfc3339). To filter by both + * `start_time` and `end_time`, use the `AND` operator. + * For example, the following queries are valid: + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * (event_types:"google.workspace.chat.space.v1.updated" OR + * event_types:"google.workspace.chat.message.v1.created") + * ``` + * The following queries are invalid: + * ``` + * start_time="2023-08-23T19:20:33+00:00" OR + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * event_types:"google.workspace.chat.space.v1.updated" AND + * event_types:"google.workspace.chat.message.v1.created" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + */ + // const filter = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callListSpaceEvents() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const iterable = chatClient.listSpaceEventsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSpaceEvents(); + // [END chat_v1_generated_ChatService_ListSpaceEvents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_spaces.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_spaces.js new file mode 100644 index 00000000000..546e88f0e9b --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.list_spaces.js @@ -0,0 +1,91 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START chat_v1_generated_ChatService_ListSpaces_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The maximum number of spaces to return. The service might return + * fewer than this value. + * If unspecified, at most 100 spaces are returned. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * Negative values return an `INVALID_ARGUMENT` error. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous list spaces call. + * Provide this parameter to retrieve the subsequent page. + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value may lead to unexpected results. + */ + // const pageToken = 'abc123' + /** + * Optional. A query filter. + * You can filter spaces by the space type + * (`space_type` (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)). + * To filter by space type, you must specify valid enum value, such as + * `SPACE` or `GROUP_CHAT` (the `space_type` can't be + * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` + * operator. + * For example, the following queries are valid: + * ``` + * space_type = "SPACE" + * spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + */ + // const filter = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callListSpaces() { + // Construct request + const request = { + }; + + // Run request + const iterable = chatClient.listSpacesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSpaces(); + // [END chat_v1_generated_ChatService_ListSpaces_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.search_spaces.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.search_spaces.js new file mode 100644 index 00000000000..b97443763fc --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.search_spaces.js @@ -0,0 +1,163 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(query) { + // [START chat_v1_generated_ChatService_SearchSpaces_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * The calling user must be a Google Workspace administrator with the + * manage chat and spaces conversations + * privilege (https://support.google.com/a/answer/13369245). + * Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces` + * OAuth 2.0 + * scope (https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * This method currently only supports admin access, thus only `true` is + * accepted for this field. + */ + // const useAdminAccess = true + /** + * The maximum number of spaces to return. The service may return fewer than + * this value. + * If unspecified, at most 100 spaces are returned. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + */ + // const pageSize = 1234 + /** + * A token, received from the previous search spaces call. Provide this + * parameter to retrieve the subsequent page. + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + */ + // const pageToken = 'abc123' + /** + * Required. A search query. + * You can search by using the following parameters: + * - `create_time` + * - `customer` + * - `display_name` + * - `external_user_allowed` + * - `last_active_time` + * - `space_history_state` + * - `space_type` + * `create_time` and `last_active_time` accept a timestamp in + * RFC-3339 (https://www.rfc-editor.org/rfc/rfc3339) format and the supported + * comparison operators are: `=`, `<`, `>`, `<=`, `>=`. + * `customer` is required and is used to indicate which customer + * to fetch spaces from. `customers/my_customer` is the only supported value. + * `display_name` only accepts the `HAS` (`:`) operator. The text to + * match is first tokenized into tokens and each token is prefix-matched + * case-insensitively and independently as a substring anywhere in the space's + * `display_name`. For example, `Fun Eve` matches `Fun event` or `The + * evening was fun`, but not `notFun event` or `even`. + * `external_user_allowed` accepts either `true` or `false`. + * `space_history_state` only accepts values from the `historyState` + * (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) + * field of a `space` resource. + * `space_type` is required and the only valid value is `SPACE`. + * Across different fields, only `AND` operators are supported. A valid + * example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid + * example is `space_type = "SPACE" OR display_name:"Hello"`. + * Among the same field, + * `space_type` doesn't support `AND` or `OR` operators. + * `display_name`, 'space_history_state', and 'external_user_allowed' only + * support `OR` operators. + * `last_active_time` and `create_time` support both `AND` and `OR` operators. + * `AND` can only be used to represent an interval, such as `last_active_time + * < "2022-01-01T00:00:00+00:00" AND last_active_time > + * "2023-01-01T00:00:00+00:00"`. + * The following example queries are valid: + * ``` + * customer = "customers/my_customer" AND space_type = "SPACE" + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * display_name:"Hello World" + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > + * "2022-01-01T00:00:00+00:00") + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * (display_name:"Hello World" OR display_name:"Fun event") AND + * (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < + * "2022-01-01T00:00:00+00:00") + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * (create_time > "2019-01-01T00:00:00+00:00" AND create_time < + * "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND + * (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF") + * ``` + */ + // const query = 'abc123' + /** + * Optional. How the list of spaces is ordered. + * Supported attributes to order by are: + * - `membership_count.joined_direct_human_user_count` — Denotes the count of + * human users that have directly joined a space. + * - `last_active_time` — Denotes the time when last eligible item is added to + * any topic of this space. + * - `create_time` — Denotes the time of the space creation. + * Valid ordering operation values are: + * - `ASC` for ascending. Default value. + * - `DESC` for descending. + * The supported syntax are: + * - `membership_count.joined_direct_human_user_count DESC` + * - `membership_count.joined_direct_human_user_count ASC` + * - `last_active_time DESC` + * - `last_active_time ASC` + * - `create_time DESC` + * - `create_time ASC` + */ + // const orderBy = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callSearchSpaces() { + // Construct request + const request = { + query, + }; + + // Run request + const iterable = chatClient.searchSpacesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchSpaces(); + // [END chat_v1_generated_ChatService_SearchSpaces_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.set_up_space.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.set_up_space.js new file mode 100644 index 00000000000..2c897a86e80 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.set_up_space.js @@ -0,0 +1,112 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(space) { + // [START chat_v1_generated_ChatService_SetUpSpace_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `Space.spaceType` field is required. + * To create a space, set `Space.spaceType` to `SPACE` and set + * `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when + * setting up a space, try a different `displayName`. An existing space + * within the Google Workspace organization might already use this display + * name. + * To create a group chat, set `Space.spaceType` to + * `GROUP_CHAT`. Don't set `Space.displayName`. + * To create a 1:1 conversation between humans, + * set `Space.spaceType` to `DIRECT_MESSAGE` and set + * `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * To create an 1:1 conversation between a human and the calling Chat app, set + * `Space.spaceType` to `DIRECT_MESSAGE` and + * `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * If a `DIRECT_MESSAGE` space already exists, that space is returned instead + * of creating a new space. + */ + // const space = {} + /** + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + */ + // const requestId = 'abc123' + /** + * Optional. The Google Chat users or groups to invite to join the space. Omit + * the calling user, as they are added automatically. + * The set currently allows up to 20 memberships (in addition to the caller). + * For human membership, the `Membership.member` field must contain a `user` + * with `name` populated (format: `users/{user}`) and `type` set to + * `User.Type.HUMAN`. You can only add human users when setting up a space + * (adding Chat apps is only supported for direct message setup with the + * calling app). You can also add members using the user's email as an alias + * for {user}. For example, the `user.name` can be `users/example@gmail.com`. + * To invite Gmail users or users from external Google Workspace domains, + * user's email must be used for `{user}`. + * For Google group membership, the `Membership.group_member` field must + * contain a `group` with `name` populated (format `groups/{group}`). You + * can only add Google groups when setting `Space.spaceType` to `SPACE`. + * Optional when setting `Space.spaceType` to `SPACE`. + * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at + * least two memberships. + * Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human + * user, along with exactly one membership. + * Must be empty when creating a 1:1 conversation between a human and the + * calling Chat app (when setting `Space.spaceType` to + * `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). + */ + // const memberships = [1,2,3,4] + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callSetUpSpace() { + // Construct request + const request = { + space, + }; + + // Run request + const response = await chatClient.setUpSpace(request); + console.log(response); + } + + callSetUpSpace(); + // [END chat_v1_generated_ChatService_SetUpSpace_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_membership.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_membership.js new file mode 100644 index 00000000000..3369de25380 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_membership.js @@ -0,0 +1,80 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(membership, updateMask) { + // [START chat_v1_generated_ChatService_UpdateMembership_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The membership to update. Only fields specified by `update_mask` + * are updated. + */ + // const membership = {} + /** + * Required. The field paths to update. Separate multiple values with commas + * or use `*` to update all field paths. + * Currently supported field paths: + * - `role` + */ + // const updateMask = {} + /** + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * The calling user must be a Google Workspace administrator with the + * manage chat and spaces conversations + * privilege (https://support.google.com/a/answer/13369245). + * Requires the `chat.admin.memberships` OAuth 2.0 + * scope (https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + */ + // const useAdminAccess = true + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callUpdateMembership() { + // Construct request + const request = { + membership, + updateMask, + }; + + // Run request + const response = await chatClient.updateMembership(request); + console.log(response); + } + + callUpdateMembership(); + // [END chat_v1_generated_ChatService_UpdateMembership_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_message.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_message.js new file mode 100644 index 00000000000..475f3004ac8 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_message.js @@ -0,0 +1,82 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(message) { + // [START chat_v1_generated_ChatService_UpdateMessage_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Message with fields updated. + */ + // const message = {} + /** + * Required. The field paths to update. Separate multiple values with commas + * or use `*` to update all field paths. + * Currently supported field paths: + * - `text` + * - `attachment` + * - `cards` (Requires app + * authentication (/chat/api/guides/auth/service-accounts).) + * - `cards_v2` (Requires app + * authentication (/chat/api/guides/auth/service-accounts).) + * - `accessory_widgets` (Requires app + * authentication (/chat/api/guides/auth/service-accounts).) + */ + // const updateMask = {} + /** + * Optional. If `true` and the message isn't found, a new message is created + * and `updateMask` is ignored. The specified message ID must be + * client-assigned (https://developers.google.com/workspace/chat/create-messages#name_a_created_message) + * or the request fails. + */ + // const allowMissing = true + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callUpdateMessage() { + // Construct request + const request = { + message, + }; + + // Run request + const response = await chatClient.updateMessage(request); + console.log(response); + } + + callUpdateMessage(); + // [END chat_v1_generated_ChatService_UpdateMessage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_space.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_space.js new file mode 100644 index 00000000000..40e381e12de --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_space.js @@ -0,0 +1,122 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(space) { + // [START chat_v1_generated_ChatService_UpdateSpace_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Space with fields to be updated. `Space.name` must be + * populated in the form of `spaces/{space}`. Only fields + * specified by `update_mask` are updated. + */ + // const space = {} + /** + * Required. The updated field paths, comma separated if there are + * multiple. + * Currently supported field paths: + * - `display_name` (Only supports changing the display name of a space with + * the `SPACE` type, or when also including the `space_type` mask to change a + * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a + * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument + * error. If you receive the error message `ALREADY_EXISTS` when updating the + * `displayName`, try a different `displayName`. An existing space within the + * Google Workspace organization might already use this display name.) + * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * `SPACE`. Include `display_name` together + * with `space_type` in the update mask and ensure that the specified space + * has a non-empty display name and the `SPACE` space type. Including the + * `space_type` mask and the `SPACE` type in the specified space when updating + * the display name is optional if the existing space already has the `SPACE` + * type. Trying to update the space type in other ways results in an invalid + * argument error). + * `space_type` is not supported with admin access. + * - `space_details` + * - `space_history_state` (Supports turning history on or off for the + * space (https://support.google.com/chat/answer/7664687) if the organization + * allows users to change their history + * setting (https://support.google.com/a/answer/7664184). + * Warning: mutually exclusive with all other field paths.) + * `space_history_state` is not supported with admin access. + * - `access_settings.audience` (Supports changing the access + * setting (https://support.google.com/chat/answer/11971020) of who can + * discover the space, join the space, and preview the messages in space. If + * no audience is specified in the access setting, the space's access setting + * is updated to private. Warning: mutually exclusive with all other field + * paths.) + * `access_settings.audience` is not supported with admin access. + * - Developer Preview: Supports changing the permission + * settings (https://support.google.com/chat/answer/13340792) of a space, + * supported field paths + * include: `permission_settings.manage_members_and_groups`, + * `permission_settings.modify_space_details`, + * `permission_settings.toggle_history`, + * `permission_settings.use_at_mention_all`, + * `permission_settings.manage_apps`, `permission_settings.manage_webhooks`, + * `permission_settings.reply_messages` + * (Warning: mutually exclusive with all other non-permission settings field + * paths). `permission_settings` is not supported with admin access. + */ + // const updateMask = {} + /** + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * The calling user must be a Google Workspace administrator with the + * manage chat and spaces conversations + * privilege (https://support.google.com/a/answer/13369245). + * Requires the `chat.admin.spaces` OAuth 2.0 + * scope (https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * Some `FieldMask` values are not supported using admin access. For details, + * see the description of `update_mask`. + */ + // const useAdminAccess = true + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callUpdateSpace() { + // Construct request + const request = { + space, + }; + + // Run request + const response = await chatClient.updateSpace(request); + console.log(response); + } + + callUpdateSpace(); + // [END chat_v1_generated_ChatService_UpdateSpace_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_space_read_state.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_space_read_state.js new file mode 100644 index 00000000000..ecdcbe9e330 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.update_space_read_state.js @@ -0,0 +1,83 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(spaceReadState, updateMask) { + // [START chat_v1_generated_ChatService_UpdateSpaceReadState_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The space read state and fields to update. + * Only supports updating read state for the calling user. + * To refer to the calling user, set one of the following: + * - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`. + * - Their Workspace email address. For example, + * `users/user@example.com/spaces/{space}/spaceReadState`. + * - Their user id. For example, + * `users/123456789/spaces/{space}/spaceReadState`. + * Format: users/{user}/spaces/{space}/spaceReadState + */ + // const spaceReadState = {} + /** + * Required. The field paths to update. Currently supported field paths: + * - `last_read_time` + * When the `last_read_time` is before the latest message create time, the + * space appears as unread in the UI. + * To mark the space as read, set `last_read_time` to any value later (larger) + * than the latest message create time. The `last_read_time` is coerced to + * match the latest message create time. Note that the space read state only + * affects the read state of messages that are visible in the space's + * top-level conversation. Replies in threads are unaffected by this + * timestamp, and instead rely on the thread read state. + */ + // const updateMask = {} + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callUpdateSpaceReadState() { + // Construct request + const request = { + spaceReadState, + updateMask, + }; + + // Run request + const response = await chatClient.updateSpaceReadState(request); + console.log(response); + } + + callUpdateSpaceReadState(); + // [END chat_v1_generated_ChatService_UpdateSpaceReadState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.upload_attachment.js b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.upload_attachment.js new file mode 100644 index 00000000000..3e76d4a774c --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/chat_service.upload_attachment.js @@ -0,0 +1,67 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, filename) { + // [START chat_v1_generated_ChatService_UploadAttachment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the Chat space in which the attachment is + * uploaded. Format "spaces/{space}". + */ + // const parent = 'abc123' + /** + * Required. The filename of the attachment, including the file extension. + */ + // const filename = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callUploadAttachment() { + // Construct request + const request = { + parent, + filename, + }; + + // Run request + const response = await chatClient.uploadAttachment(request); + console.log(response); + } + + callUploadAttachment(); + // [END chat_v1_generated_ChatService_UploadAttachment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-chat/v1/samples/generated/v1/snippet_metadata_google.chat.v1.json b/owl-bot-staging/google-chat/v1/samples/generated/v1/snippet_metadata_google.chat.v1.json new file mode 100644 index 00000000000..9c66ee2c655 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/samples/generated/v1/snippet_metadata_google.chat.v1.json @@ -0,0 +1,1363 @@ +{ + "clientLibrary": { + "name": "nodejs-chat", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.chat.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "chat_v1_generated_ChatService_CreateMessage_async", + "title": "ChatService createMessage Sample", + "origin": "API_DEFINITION", + "description": " Creates a message in a Google Chat space. The maximum message size, including text and cards, is 32,000 bytes. For an example, see [Send a message](https://developers.google.com/workspace/chat/create-messages). Calling this method requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) and supports the following authentication types: - For text messages, user authentication or app authentication are supported. - For card messages, only app authentication is supported. (Only Chat apps can create card messages.)", + "canonical": true, + "file": "chat_service.create_message.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMessage", + "fullName": "google.chat.v1.ChatService.CreateMessage", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "message", + "type": ".google.chat.v1.Message" + }, + { + "name": "thread_key", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "message_reply_option", + "type": ".google.chat.v1.CreateMessageRequest.MessageReplyOption" + }, + { + "name": "message_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.Message", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "CreateMessage", + "fullName": "google.chat.v1.ChatService.CreateMessage", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_ListMessages_async", + "title": "ChatService listMessages Sample", + "origin": "API_DEFINITION", + "description": " Lists messages in a space that the caller is a member of, including messages from blocked members and spaces. For an example, see [List messages](/chat/api/guides/v1/messages/list). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.list_messages.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 117, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMessages", + "fullName": "google.chat.v1.ChatService.ListMessages", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.chat.v1.ListMessagesResponse", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "ListMessages", + "fullName": "google.chat.v1.ChatService.ListMessages", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_ListMemberships_async", + "title": "ChatService listMemberships Sample", + "origin": "API_DEFINITION", + "description": " Lists memberships in a space. For an example, see [List users and Google Chat apps in a space](https://developers.google.com/workspace/chat/list-members). Listing memberships with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) lists memberships in spaces that the authenticated user has access to. Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.list_memberships.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 135, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMemberships", + "fullName": "google.chat.v1.ChatService.ListMemberships", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "show_groups", + "type": "TYPE_BOOL" + }, + { + "name": "show_invited", + "type": "TYPE_BOOL" + }, + { + "name": "use_admin_access", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.chat.v1.ListMembershipsResponse", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "ListMemberships", + "fullName": "google.chat.v1.ChatService.ListMemberships", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_GetMembership_async", + "title": "ChatService getMembership Sample", + "origin": "API_DEFINITION", + "description": " Returns details about a membership. For an example, see [Get details about a user's or Google Chat app's membership](https://developers.google.com/workspace/chat/get-members). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.get_membership.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMembership", + "fullName": "google.chat.v1.ChatService.GetMembership", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "use_admin_access", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.chat.v1.Membership", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "GetMembership", + "fullName": "google.chat.v1.ChatService.GetMembership", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_GetMessage_async", + "title": "ChatService getMessage Sample", + "origin": "API_DEFINITION", + "description": " Returns details about a message. For an example, see [Get details about a message](https://developers.google.com/workspace/chat/get-messages). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). Note: Might return a message from a blocked member or space.", + "canonical": true, + "file": "chat_service.get_message.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMessage", + "fullName": "google.chat.v1.ChatService.GetMessage", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.Message", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "GetMessage", + "fullName": "google.chat.v1.ChatService.GetMessage", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_UpdateMessage_async", + "title": "ChatService updateMessage Sample", + "origin": "API_DEFINITION", + "description": " Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/workspace/chat/update-messages). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). When using app authentication, requests can only update messages created by the calling Chat app.", + "canonical": true, + "file": "chat_service.update_message.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMessage", + "fullName": "google.chat.v1.ChatService.UpdateMessage", + "async": true, + "parameters": [ + { + "name": "message", + "type": ".google.chat.v1.Message" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.chat.v1.Message", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "UpdateMessage", + "fullName": "google.chat.v1.ChatService.UpdateMessage", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_DeleteMessage_async", + "title": "ChatService deleteMessage Sample", + "origin": "API_DEFINITION", + "description": " Deletes a message. For an example, see [Delete a message](https://developers.google.com/workspace/chat/delete-messages). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). When using app authentication, requests can only delete messages created by the calling Chat app.", + "canonical": true, + "file": "chat_service.delete_message.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMessage", + "fullName": "google.chat.v1.ChatService.DeleteMessage", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "DeleteMessage", + "fullName": "google.chat.v1.ChatService.DeleteMessage", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_GetAttachment_async", + "title": "ChatService getAttachment Sample", + "origin": "API_DEFINITION", + "description": " Gets the metadata of a message attachment. The attachment data is fetched using the [media API](https://developers.google.com/workspace/chat/api/reference/rest/v1/media/download). For an example, see [Get metadata about a message attachment](https://developers.google.com/workspace/chat/get-media-attachments). Requires [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).", + "canonical": true, + "file": "chat_service.get_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAttachment", + "fullName": "google.chat.v1.ChatService.GetAttachment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.Attachment", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "GetAttachment", + "fullName": "google.chat.v1.ChatService.GetAttachment", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_UploadAttachment_async", + "title": "ChatService uploadAttachment Sample", + "origin": "API_DEFINITION", + "description": " Uploads an attachment. For an example, see [Upload media as a file attachment](https://developers.google.com/workspace/chat/upload-media-attachments). Requires user [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see [File types blocked by Google Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).", + "canonical": true, + "file": "chat_service.upload_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UploadAttachment", + "fullName": "google.chat.v1.ChatService.UploadAttachment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filename", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.UploadAttachmentResponse", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "UploadAttachment", + "fullName": "google.chat.v1.ChatService.UploadAttachment", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_ListSpaces_async", + "title": "ChatService listSpaces Sample", + "origin": "API_DEFINITION", + "description": " Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/workspace/chat/list-spaces). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent. To list all named spaces by Google Workspace organization, use the [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) method using Workspace administrator privileges instead.", + "canonical": true, + "file": "chat_service.list_spaces.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSpaces", + "fullName": "google.chat.v1.ChatService.ListSpaces", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.ListSpacesResponse", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "ListSpaces", + "fullName": "google.chat.v1.ChatService.ListSpaces", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_SearchSpaces_async", + "title": "ChatService searchSpaces Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of spaces in a Google Workspace organization based on an administrator's search. Requires [user authentication with administrator privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges). In the request, set `use_admin_access` to `true`.", + "canonical": true, + "file": "chat_service.search_spaces.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 155, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchSpaces", + "fullName": "google.chat.v1.ChatService.SearchSpaces", + "async": true, + "parameters": [ + { + "name": "use_admin_access", + "type": "TYPE_BOOL" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.SearchSpacesResponse", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "SearchSpaces", + "fullName": "google.chat.v1.ChatService.SearchSpaces", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_GetSpace_async", + "title": "ChatService getSpace Sample", + "origin": "API_DEFINITION", + "description": " Returns details about a space. For an example, see [Get details about a space](https://developers.google.com/workspace/chat/get-spaces). Requires [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). Supports [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.get_space.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSpace", + "fullName": "google.chat.v1.ChatService.GetSpace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "use_admin_access", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.chat.v1.Space", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "GetSpace", + "fullName": "google.chat.v1.ChatService.GetSpace", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_CreateSpace_async", + "title": "ChatService createSpace Sample", + "origin": "API_DEFINITION", + "description": " Creates a named space. Spaces grouped by topics aren't supported. For an example, see [Create a space](https://developers.google.com/workspace/chat/create-spaces). If you receive the error message `ALREADY_EXISTS` when creating a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.create_space.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSpace", + "fullName": "google.chat.v1.ChatService.CreateSpace", + "async": true, + "parameters": [ + { + "name": "space", + "type": ".google.chat.v1.Space" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.Space", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "CreateSpace", + "fullName": "google.chat.v1.ChatService.CreateSpace", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_SetUpSpace_async", + "title": "ChatService setUpSpace Sample", + "origin": "API_DEFINITION", + "description": " Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space with initial members](https://developers.google.com/workspace/chat/set-up-spaces). To specify the human members to add, add memberships with the appropriate `membership.member.name`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. To specify the Google groups to add, add memberships with the appropriate `membership.group_member.name`. To add or invite a Google group, use `groups/{group}`, where `{group}` is the `id` for the group from the Cloud Identity Groups API. For example, you can use [Cloud Identity Groups lookup API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) to retrieve the ID `123456789` for group email `group@example.com`, then you can add the group to the space by setting the `membership.group_member.name` to `groups/123456789`. Group email is not supported, and Google groups can only be added as members in named spaces. For a named space or group chat, if the caller blocks, or is blocked by some members, or doesn't have permission to add some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [Invite or add a user or app to a space](https://developers.google.com/workspace/chat/create-members). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies aren't supported. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.set_up_space.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 104, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetUpSpace", + "fullName": "google.chat.v1.ChatService.SetUpSpace", + "async": true, + "parameters": [ + { + "name": "space", + "type": ".google.chat.v1.Space" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "memberships", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.chat.v1.Space", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "SetUpSpace", + "fullName": "google.chat.v1.ChatService.SetUpSpace", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_UpdateSpace_async", + "title": "ChatService updateSpace Sample", + "origin": "API_DEFINITION", + "description": " Updates a space. For an example, see [Update a space](https://developers.google.com/workspace/chat/update-spaces). If you're updating the `displayName` field and receive the error message `ALREADY_EXISTS`, try a different display name.. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.update_space.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 114, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSpace", + "fullName": "google.chat.v1.ChatService.UpdateSpace", + "async": true, + "parameters": [ + { + "name": "space", + "type": ".google.chat.v1.Space" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "use_admin_access", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.chat.v1.Space", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "UpdateSpace", + "fullName": "google.chat.v1.ChatService.UpdateSpace", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_DeleteSpace_async", + "title": "ChatService deleteSpace Sample", + "origin": "API_DEFINITION", + "description": " Deletes a named space. Always performs a cascading delete, which means that the space's child resources—like messages posted in the space and memberships in the space—are also deleted. For an example, see [Delete a space](https://developers.google.com/workspace/chat/delete-spaces). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) from a user who has permission to delete the space.", + "canonical": true, + "file": "chat_service.delete_space.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSpace", + "fullName": "google.chat.v1.ChatService.DeleteSpace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "use_admin_access", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "DeleteSpace", + "fullName": "google.chat.v1.ChatService.DeleteSpace", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_CompleteImportSpace_async", + "title": "ChatService completeImportSpace Sample", + "origin": "API_DEFINITION", + "description": " Completes the [import process](https://developers.google.com/workspace/chat/import-data) for the specified space and makes it visible to users. Requires app authentication and domain-wide delegation. For more information, see [Authorize Google Chat apps to import data](https://developers.google.com/workspace/chat/authorize-import).", + "canonical": true, + "file": "chat_service.complete_import_space.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CompleteImportSpace", + "fullName": "google.chat.v1.ChatService.CompleteImportSpace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.CompleteImportSpaceResponse", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "CompleteImportSpace", + "fullName": "google.chat.v1.ChatService.CompleteImportSpace", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_FindDirectMessage_async", + "title": "ChatService findDirectMessage Sample", + "origin": "API_DEFINITION", + "description": " Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), returns the direct message space between the specified user and the authenticated user. With [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), returns the direct message space between the specified user and the calling Chat app. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) or [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).", + "canonical": true, + "file": "chat_service.find_direct_message.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FindDirectMessage", + "fullName": "google.chat.v1.ChatService.FindDirectMessage", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.Space", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "FindDirectMessage", + "fullName": "google.chat.v1.ChatService.FindDirectMessage", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_CreateMembership_async", + "title": "ChatService createMembership Sample", + "origin": "API_DEFINITION", + "description": " Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [Invite or add a user or a Google Chat app to a space](https://developers.google.com/workspace/chat/create-members). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). To specify the member to add, set the `membership.member.name` for the human or app member, or set the `membership.group_member.name` for the group member. - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. - To add or invite a Google group in a named space, use `groups/{group}`, where `{group}` is the `id` for the group from the Cloud Identity Groups API. For example, you can use [Cloud Identity Groups lookup API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) to retrieve the ID `123456789` for group email `group@example.com`, then you can add or invite the group to a named space by setting the `membership.group_member.name` to `groups/123456789`. Group email is not supported, and Google groups can only be added as members in named spaces.", + "canonical": true, + "file": "chat_service.create_membership.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 88, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMembership", + "fullName": "google.chat.v1.ChatService.CreateMembership", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "membership", + "type": ".google.chat.v1.Membership" + }, + { + "name": "use_admin_access", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.chat.v1.Membership", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "CreateMembership", + "fullName": "google.chat.v1.ChatService.CreateMembership", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_UpdateMembership_async", + "title": "ChatService updateMembership Sample", + "origin": "API_DEFINITION", + "description": " Updates a membership. For an example, see [Update a user's membership in a space](https://developers.google.com/workspace/chat/update-members). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.update_membership.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMembership", + "fullName": "google.chat.v1.ChatService.UpdateMembership", + "async": true, + "parameters": [ + { + "name": "membership", + "type": ".google.chat.v1.Membership" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "use_admin_access", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.chat.v1.Membership", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "UpdateMembership", + "fullName": "google.chat.v1.ChatService.UpdateMembership", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_DeleteMembership_async", + "title": "ChatService deleteMembership Sample", + "origin": "API_DEFINITION", + "description": " Deletes a membership. For an example, see [Remove a user or a Google Chat app from a space](https://developers.google.com/workspace/chat/delete-members). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.delete_membership.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMembership", + "fullName": "google.chat.v1.ChatService.DeleteMembership", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "use_admin_access", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.chat.v1.Membership", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "DeleteMembership", + "fullName": "google.chat.v1.ChatService.DeleteMembership", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_CreateReaction_async", + "title": "ChatService createReaction Sample", + "origin": "API_DEFINITION", + "description": " Creates a reaction and adds it to a message. Only unicode emojis are supported. For an example, see [Add a reaction to a message](https://developers.google.com/workspace/chat/create-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.create_reaction.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateReaction", + "fullName": "google.chat.v1.ChatService.CreateReaction", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "reaction", + "type": ".google.chat.v1.Reaction" + } + ], + "resultType": ".google.chat.v1.Reaction", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "CreateReaction", + "fullName": "google.chat.v1.ChatService.CreateReaction", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_ListReactions_async", + "title": "ChatService listReactions Sample", + "origin": "API_DEFINITION", + "description": " Lists reactions to a message. For an example, see [List reactions for a message](https://developers.google.com/workspace/chat/list-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.list_reactions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 108, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListReactions", + "fullName": "google.chat.v1.ChatService.ListReactions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.ListReactionsResponse", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "ListReactions", + "fullName": "google.chat.v1.ChatService.ListReactions", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_DeleteReaction_async", + "title": "ChatService deleteReaction Sample", + "origin": "API_DEFINITION", + "description": " Deletes a reaction to a message. Only unicode emojis are supported. For an example, see [Delete a reaction](https://developers.google.com/workspace/chat/delete-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.delete_reaction.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteReaction", + "fullName": "google.chat.v1.ChatService.DeleteReaction", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "DeleteReaction", + "fullName": "google.chat.v1.ChatService.DeleteReaction", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_GetSpaceReadState_async", + "title": "ChatService getSpaceReadState Sample", + "origin": "API_DEFINITION", + "description": " Returns details about a user's read state within a space, used to identify read and unread messages. For an example, see [Get details about a user's space read state](https://developers.google.com/workspace/chat/get-space-read-state). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.get_space_read_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSpaceReadState", + "fullName": "google.chat.v1.ChatService.GetSpaceReadState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.SpaceReadState", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "GetSpaceReadState", + "fullName": "google.chat.v1.ChatService.GetSpaceReadState", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_UpdateSpaceReadState_async", + "title": "ChatService updateSpaceReadState Sample", + "origin": "API_DEFINITION", + "description": " Updates a user's read state within a space, used to identify read and unread messages. For an example, see [Update a user's space read state](https://developers.google.com/workspace/chat/update-space-read-state). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.update_space_read_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSpaceReadState", + "fullName": "google.chat.v1.ChatService.UpdateSpaceReadState", + "async": true, + "parameters": [ + { + "name": "space_read_state", + "type": ".google.chat.v1.SpaceReadState" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.chat.v1.SpaceReadState", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "UpdateSpaceReadState", + "fullName": "google.chat.v1.ChatService.UpdateSpaceReadState", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_GetThreadReadState_async", + "title": "ChatService getThreadReadState Sample", + "origin": "API_DEFINITION", + "description": " Returns details about a user's read state within a thread, used to identify read and unread messages. For an example, see [Get details about a user's thread read state](https://developers.google.com/workspace/chat/get-thread-read-state). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.get_thread_read_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetThreadReadState", + "fullName": "google.chat.v1.ChatService.GetThreadReadState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.ThreadReadState", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "GetThreadReadState", + "fullName": "google.chat.v1.ChatService.GetThreadReadState", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_GetSpaceEvent_async", + "title": "ChatService getSpaceEvent Sample", + "origin": "API_DEFINITION", + "description": " Returns an event from a Google Chat space. The [event payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) contains the most recent version of the resource that changed. For example, if you request an event about a new message but the message was later updated, the server returns the updated `Message` resource in the event payload. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). To get an event, the authenticated user must be a member of the space. For an example, see [Get details about an event from a Google Chat space](https://developers.google.com/workspace/chat/get-space-event).", + "canonical": true, + "file": "chat_service.get_space_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSpaceEvent", + "fullName": "google.chat.v1.ChatService.GetSpaceEvent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.SpaceEvent", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "GetSpaceEvent", + "fullName": "google.chat.v1.ChatService.GetSpaceEvent", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_ListSpaceEvents_async", + "title": "ChatService listSpaceEvents Sample", + "origin": "API_DEFINITION", + "description": " Lists events from a Google Chat space. For each event, the [payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) contains the most recent version of the Chat resource. For example, if you list events about new space members, the server returns `Membership` resources that contain the latest membership details. If new members were removed during the requested period, the event payload contains an empty `Membership` resource. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). To list events, the authenticated user must be a member of the space. For an example, see [List events from a Google Chat space](https://developers.google.com/workspace/chat/list-space-events).", + "canonical": true, + "file": "chat_service.list_space_events.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 119, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSpaceEvents", + "fullName": "google.chat.v1.ChatService.ListSpaceEvents", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.ListSpaceEventsResponse", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "ListSpaceEvents", + "fullName": "google.chat.v1.ChatService.ListSpaceEvents", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-chat/v1/src/index.ts b/owl-bot-staging/google-chat/v1/src/index.ts new file mode 100644 index 00000000000..7c2c08e7543 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const ChatServiceClient = v1.ChatServiceClient; +type ChatServiceClient = v1.ChatServiceClient; +export {v1, ChatServiceClient}; +export default {v1, ChatServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-chat/v1/src/v1/chat_service_client.ts b/owl-bot-staging/google-chat/v1/src/v1/chat_service_client.ts new file mode 100644 index 00000000000..5e780663c69 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/src/v1/chat_service_client.ts @@ -0,0 +1,5416 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/chat_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './chat_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Enables developers to build Chat apps and + * integrations on Google Chat Platform. + * @class + * @memberof v1 + */ +export class ChatServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + chatServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ChatServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ChatServiceClient({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 ChatServiceClient; + 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 = 'chat.' + 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 = { + attachmentPathTemplate: new this._gaxModule.PathTemplate( + 'spaces/{space}/messages/{message}/attachments/{attachment}' + ), + membershipPathTemplate: new this._gaxModule.PathTemplate( + 'spaces/{space}/members/{member}' + ), + messagePathTemplate: new this._gaxModule.PathTemplate( + 'spaces/{space}/messages/{message}' + ), + quotedMessageMetadataPathTemplate: new this._gaxModule.PathTemplate( + 'spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}' + ), + reactionPathTemplate: new this._gaxModule.PathTemplate( + 'spaces/{space}/messages/{message}/reactions/{reaction}' + ), + spacePathTemplate: new this._gaxModule.PathTemplate( + 'spaces/{space}' + ), + spaceEventPathTemplate: new this._gaxModule.PathTemplate( + 'spaces/{space}/spaceEvents/{space_event}' + ), + spaceReadStatePathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/spaces/{space}/spaceReadState' + ), + threadPathTemplate: new this._gaxModule.PathTemplate( + 'spaces/{space}/threads/{thread}' + ), + threadReadStatePathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/spaces/{space}/threads/{thread}/threadReadState' + ), + }; + + // 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 = { + listMessages: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'messages'), + listMemberships: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'memberships'), + listSpaces: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'spaces'), + searchSpaces: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'spaces'), + listReactions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'reactions'), + listSpaceEvents: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'spaceEvents') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.chat.v1.ChatService', 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.chatServiceStub) { + return this.chatServiceStub; + } + + // Put together the "service stub" for + // google.chat.v1.ChatService. + this.chatServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.chat.v1.ChatService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.chat.v1.ChatService, + 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 chatServiceStubMethods = + ['createMessage', 'listMessages', 'listMemberships', 'getMembership', 'getMessage', 'updateMessage', 'deleteMessage', 'getAttachment', 'uploadAttachment', 'listSpaces', 'searchSpaces', 'getSpace', 'createSpace', 'setUpSpace', 'updateSpace', 'deleteSpace', 'completeImportSpace', 'findDirectMessage', 'createMembership', 'updateMembership', 'deleteMembership', 'createReaction', 'listReactions', 'deleteReaction', 'getSpaceReadState', 'updateSpaceReadState', 'getThreadReadState', 'getSpaceEvent', 'listSpaceEvents']; + for (const methodName of chatServiceStubMethods) { + const callPromise = this.chatServiceStub.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.chatServiceStub; + } + + /** + * 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 'chat.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 'chat.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/chat.admin.delete', + 'https://www.googleapis.com/auth/chat.admin.memberships', + 'https://www.googleapis.com/auth/chat.admin.memberships.readonly', + 'https://www.googleapis.com/auth/chat.admin.spaces', + 'https://www.googleapis.com/auth/chat.admin.spaces.readonly', + 'https://www.googleapis.com/auth/chat.bot', + 'https://www.googleapis.com/auth/chat.delete', + 'https://www.googleapis.com/auth/chat.import', + 'https://www.googleapis.com/auth/chat.memberships', + 'https://www.googleapis.com/auth/chat.memberships.app', + 'https://www.googleapis.com/auth/chat.memberships.readonly', + 'https://www.googleapis.com/auth/chat.messages', + 'https://www.googleapis.com/auth/chat.messages.create', + 'https://www.googleapis.com/auth/chat.messages.reactions', + 'https://www.googleapis.com/auth/chat.messages.reactions.create', + 'https://www.googleapis.com/auth/chat.messages.reactions.readonly', + 'https://www.googleapis.com/auth/chat.messages.readonly', + 'https://www.googleapis.com/auth/chat.spaces', + 'https://www.googleapis.com/auth/chat.spaces.create', + 'https://www.googleapis.com/auth/chat.spaces.readonly', + 'https://www.googleapis.com/auth/chat.users.readstate', + 'https://www.googleapis.com/auth/chat.users.readstate.readonly' + ]; + } + + 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 -- + // ------------------- +/** + * Creates a message in a Google Chat space. The maximum message size, + * including text and cards, is 32,000 bytes. For an example, see [Send a + * message](https://developers.google.com/workspace/chat/create-messages). + * + * Calling this method requires + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) + * and supports the following authentication types: + * + * - For text messages, user authentication or app authentication are + * supported. + * - For card messages, only app authentication is supported. (Only Chat apps + * can create card messages.) + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the space in which to create a message. + * + * Format: `spaces/{space}` + * @param {google.chat.v1.Message} request.message + * Required. Message body. + * @param {string} [request.threadKey] + * Optional. Deprecated: Use + * {@link protos.google.chat.v1.Thread.thread_key|thread.thread_key} instead. ID for the + * thread. Supports up to 4000 characters. To start or add to a thread, create + * a message and specify a `threadKey` or the + * {@link protos.google.chat.v1.Thread.name|thread.name}. For example usage, see [Start or + * reply to a message + * thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). + * @param {string} [request.requestId] + * Optional. A unique request ID for this message. Specifying an existing + * request ID returns the message created with that ID instead of creating a + * new message. + * @param {google.chat.v1.CreateMessageRequest.MessageReplyOption} [request.messageReplyOption] + * Optional. Specifies whether a message starts a thread or replies to one. + * Only supported in named spaces. + * @param {string} [request.messageId] + * Optional. A custom ID for a message. Lets Chat apps get, update, or delete + * a message without needing to store the system-assigned ID in the message's + * resource name (represented in the message `name` field). + * + * The value for this field must meet the following requirements: + * + * * Begins with `client-`. For example, `client-custom-name` is a valid + * custom ID, but `custom-name` is not. + * * Contains up to 63 characters and only lowercase letters, numbers, and + * hyphens. + * * Is unique within a space. A Chat app can't use the same custom ID for + * different messages. + * + * For details, see [Name a + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Message|Message}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.create_message.js + * region_tag:chat_v1_generated_ChatService_CreateMessage_async + */ + createMessage( + request?: protos.google.chat.v1.ICreateMessageRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IMessage, + protos.google.chat.v1.ICreateMessageRequest|undefined, {}|undefined + ]>; + createMessage( + request: protos.google.chat.v1.ICreateMessageRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.ICreateMessageRequest|null|undefined, + {}|null|undefined>): void; + createMessage( + request: protos.google.chat.v1.ICreateMessageRequest, + callback: Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.ICreateMessageRequest|null|undefined, + {}|null|undefined>): void; + createMessage( + request?: protos.google.chat.v1.ICreateMessageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.ICreateMessageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.ICreateMessageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.IMessage, + protos.google.chat.v1.ICreateMessageRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createMessage(request, options, callback); + } +/** + * Returns details about a membership. For an example, see + * [Get details about a user's or Google Chat app's + * membership](https://developers.google.com/workspace/chat/get-members). + * + * Requires + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + * Supports + * [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * and [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the membership to retrieve. + * + * To get the app's own membership [by using user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can optionally use `spaces/{space}/members/app`. + * + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` + * + * When [authenticated as a + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the user's email as an alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * @param {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires the `chat.admin.memberships` or `chat.admin.memberships.readonly` + * [OAuth 2.0 + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * + * Getting app memberships in a space isn't supported when using admin access. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Membership|Membership}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.get_membership.js + * region_tag:chat_v1_generated_ChatService_GetMembership_async + */ + getMembership( + request?: protos.google.chat.v1.IGetMembershipRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IGetMembershipRequest|undefined, {}|undefined + ]>; + getMembership( + request: protos.google.chat.v1.IGetMembershipRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IGetMembershipRequest|null|undefined, + {}|null|undefined>): void; + getMembership( + request: protos.google.chat.v1.IGetMembershipRequest, + callback: Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IGetMembershipRequest|null|undefined, + {}|null|undefined>): void; + getMembership( + request?: protos.google.chat.v1.IGetMembershipRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IGetMembershipRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IGetMembershipRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IGetMembershipRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getMembership(request, options, callback); + } +/** + * Returns details about a message. + * For an example, see [Get details about a + * message](https://developers.google.com/workspace/chat/get-messages). + * + * Requires + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + * Supports + * [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * and [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * Note: Might return a message from a blocked member or space. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the message. + * + * Format: `spaces/{space}/messages/{message}` + * + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Message|Message}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.get_message.js + * region_tag:chat_v1_generated_ChatService_GetMessage_async + */ + getMessage( + request?: protos.google.chat.v1.IGetMessageRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IGetMessageRequest|undefined, {}|undefined + ]>; + getMessage( + request: protos.google.chat.v1.IGetMessageRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IGetMessageRequest|null|undefined, + {}|null|undefined>): void; + getMessage( + request: protos.google.chat.v1.IGetMessageRequest, + callback: Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IGetMessageRequest|null|undefined, + {}|null|undefined>): void; + getMessage( + request?: protos.google.chat.v1.IGetMessageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IGetMessageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IGetMessageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IGetMessageRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getMessage(request, options, callback); + } +/** + * Updates a message. There's a difference between the `patch` and `update` + * methods. The `patch` + * method uses a `patch` request while the `update` method uses a `put` + * request. We recommend using the `patch` method. For an example, see + * [Update a + * message](https://developers.google.com/workspace/chat/update-messages). + * + * Requires + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + * Supports + * [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * and [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * When using app authentication, requests can only update messages + * created by the calling Chat app. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.chat.v1.Message} request.message + * Required. Message with fields updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The field paths to update. Separate multiple values with commas + * or use `*` to update all field paths. + * + * Currently supported field paths: + * + * - `text` + * + * - `attachment` + * + * - `cards` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * + * - `cards_v2` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * + * - `accessory_widgets` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * @param {boolean} [request.allowMissing] + * Optional. If `true` and the message isn't found, a new message is created + * and `updateMask` is ignored. The specified message ID must be + * [client-assigned](https://developers.google.com/workspace/chat/create-messages#name_a_created_message) + * or the request fails. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Message|Message}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.update_message.js + * region_tag:chat_v1_generated_ChatService_UpdateMessage_async + */ + updateMessage( + request?: protos.google.chat.v1.IUpdateMessageRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IUpdateMessageRequest|undefined, {}|undefined + ]>; + updateMessage( + request: protos.google.chat.v1.IUpdateMessageRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IUpdateMessageRequest|null|undefined, + {}|null|undefined>): void; + updateMessage( + request: protos.google.chat.v1.IUpdateMessageRequest, + callback: Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IUpdateMessageRequest|null|undefined, + {}|null|undefined>): void; + updateMessage( + request?: protos.google.chat.v1.IUpdateMessageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IUpdateMessageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IUpdateMessageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IUpdateMessageRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'message.name': request.message!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateMessage(request, options, callback); + } +/** + * Deletes a message. + * For an example, see [Delete a + * message](https://developers.google.com/workspace/chat/delete-messages). + * + * Requires + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + * Supports + * [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * and [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * When using app authentication, requests can only delete messages + * created by the calling Chat app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the message. + * + * Format: `spaces/{space}/messages/{message}` + * + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). + * @param {boolean} request.force + * When `true`, deleting a message also deletes its threaded replies. When + * `false`, if a message has threaded replies, deletion fails. + * + * Only applies when [authenticating as a + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * Has no effect when [authenticating as a Chat app] + * (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.delete_message.js + * region_tag:chat_v1_generated_ChatService_DeleteMessage_async + */ + deleteMessage( + request?: protos.google.chat.v1.IDeleteMessageRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteMessageRequest|undefined, {}|undefined + ]>; + deleteMessage( + request: protos.google.chat.v1.IDeleteMessageRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteMessageRequest|null|undefined, + {}|null|undefined>): void; + deleteMessage( + request: protos.google.chat.v1.IDeleteMessageRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteMessageRequest|null|undefined, + {}|null|undefined>): void; + deleteMessage( + request?: protos.google.chat.v1.IDeleteMessageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteMessageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteMessageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteMessageRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteMessage(request, options, callback); + } +/** + * Gets the metadata of a message attachment. The attachment data is fetched + * using the [media + * API](https://developers.google.com/workspace/chat/api/reference/rest/v1/media/download). + * For an example, see + * [Get metadata about a message + * attachment](https://developers.google.com/workspace/chat/get-media-attachments). + * Requires [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the attachment, in the form + * `spaces/{space}/messages/{message}/attachments/{attachment}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.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/v1/chat_service.get_attachment.js + * region_tag:chat_v1_generated_ChatService_GetAttachment_async + */ + getAttachment( + request?: protos.google.chat.v1.IGetAttachmentRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IAttachment, + protos.google.chat.v1.IGetAttachmentRequest|undefined, {}|undefined + ]>; + getAttachment( + request: protos.google.chat.v1.IGetAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.IAttachment, + protos.google.chat.v1.IGetAttachmentRequest|null|undefined, + {}|null|undefined>): void; + getAttachment( + request: protos.google.chat.v1.IGetAttachmentRequest, + callback: Callback< + protos.google.chat.v1.IAttachment, + protos.google.chat.v1.IGetAttachmentRequest|null|undefined, + {}|null|undefined>): void; + getAttachment( + request?: protos.google.chat.v1.IGetAttachmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.IAttachment, + protos.google.chat.v1.IGetAttachmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.IAttachment, + protos.google.chat.v1.IGetAttachmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.IAttachment, + protos.google.chat.v1.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(); + return this.innerApiCalls.getAttachment(request, options, callback); + } +/** + * Uploads an attachment. For an example, see + * [Upload media as a file + * attachment](https://developers.google.com/workspace/chat/upload-media-attachments). + * Requires user + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * You can upload attachments up to 200 MB. Certain file types aren't + * supported. For details, see [File types blocked by Google + * Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the Chat space in which the attachment is + * uploaded. Format "spaces/{space}". + * @param {string} request.filename + * Required. The filename of the attachment, including the file extension. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.UploadAttachmentResponse|UploadAttachmentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.upload_attachment.js + * region_tag:chat_v1_generated_ChatService_UploadAttachment_async + */ + uploadAttachment( + request?: protos.google.chat.v1.IUploadAttachmentRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IUploadAttachmentResponse, + protos.google.chat.v1.IUploadAttachmentRequest|undefined, {}|undefined + ]>; + uploadAttachment( + request: protos.google.chat.v1.IUploadAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.IUploadAttachmentResponse, + protos.google.chat.v1.IUploadAttachmentRequest|null|undefined, + {}|null|undefined>): void; + uploadAttachment( + request: protos.google.chat.v1.IUploadAttachmentRequest, + callback: Callback< + protos.google.chat.v1.IUploadAttachmentResponse, + protos.google.chat.v1.IUploadAttachmentRequest|null|undefined, + {}|null|undefined>): void; + uploadAttachment( + request?: protos.google.chat.v1.IUploadAttachmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.IUploadAttachmentResponse, + protos.google.chat.v1.IUploadAttachmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.IUploadAttachmentResponse, + protos.google.chat.v1.IUploadAttachmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.IUploadAttachmentResponse, + protos.google.chat.v1.IUploadAttachmentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.uploadAttachment(request, options, callback); + } +/** + * Returns details about a space. For an example, see + * [Get details about a + * space](https://developers.google.com/workspace/chat/get-spaces). + * + * Requires + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + * Supports + * [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * and [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the space, in the form `spaces/{space}`. + * + * Format: `spaces/{space}` + * @param {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0 + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Space|Space}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.get_space.js + * region_tag:chat_v1_generated_ChatService_GetSpace_async + */ + getSpace( + request?: protos.google.chat.v1.IGetSpaceRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IGetSpaceRequest|undefined, {}|undefined + ]>; + getSpace( + request: protos.google.chat.v1.IGetSpaceRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IGetSpaceRequest|null|undefined, + {}|null|undefined>): void; + getSpace( + request: protos.google.chat.v1.IGetSpaceRequest, + callback: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IGetSpaceRequest|null|undefined, + {}|null|undefined>): void; + getSpace( + request?: protos.google.chat.v1.IGetSpaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IGetSpaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IGetSpaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IGetSpaceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getSpace(request, options, callback); + } +/** + * Creates a named space. Spaces grouped by topics aren't supported. For an + * example, see [Create a + * space](https://developers.google.com/workspace/chat/create-spaces). + * + * If you receive the error message `ALREADY_EXISTS` when creating + * a space, try a different `displayName`. An existing space within + * the Google Workspace organization might already use this display name. + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.chat.v1.Space} request.space + * Required. The `displayName` and `spaceType` fields must be populated. Only + * `SpaceType.SPACE` is supported. + * + * If you receive the error message `ALREADY_EXISTS` when creating a space, + * try a different `displayName`. An existing space within the Google + * Workspace organization might already use this display name. + * + * The space `name` is assigned on the server so anything specified in this + * field will be ignored. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Space|Space}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.create_space.js + * region_tag:chat_v1_generated_ChatService_CreateSpace_async + */ + createSpace( + request?: protos.google.chat.v1.ICreateSpaceRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ICreateSpaceRequest|undefined, {}|undefined + ]>; + createSpace( + request: protos.google.chat.v1.ICreateSpaceRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ICreateSpaceRequest|null|undefined, + {}|null|undefined>): void; + createSpace( + request: protos.google.chat.v1.ICreateSpaceRequest, + callback: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ICreateSpaceRequest|null|undefined, + {}|null|undefined>): void; + createSpace( + request?: protos.google.chat.v1.ICreateSpaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ICreateSpaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ICreateSpaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ICreateSpaceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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(); + return this.innerApiCalls.createSpace(request, options, callback); + } +/** + * Creates a space and adds specified users to it. The calling user is + * automatically added to the space, and shouldn't be specified as a + * membership in the request. For an example, see + * [Set up a space with initial + * members](https://developers.google.com/workspace/chat/set-up-spaces). + * + * To specify the human members to add, add memberships with the appropriate + * `membership.member.name`. To add a human user, use `users/{user}`, where + * `{user}` can be the email address for the user. For users in the same + * Workspace organization `{user}` can also be the `id` for the person from + * the People API, or the `id` for the user in the Directory API. For example, + * if the People API Person profile ID for `user@example.com` is `123456789`, + * you can add the user to the space by setting the `membership.member.name` + * to `users/user@example.com` or `users/123456789`. + * + * To specify the Google groups to add, add memberships with the + * appropriate `membership.group_member.name`. To add or invite a Google + * group, use `groups/{group}`, where `{group}` is the `id` for the group from + * the Cloud Identity Groups API. For example, you can use [Cloud Identity + * Groups lookup + * API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) + * to retrieve the ID `123456789` for group email `group@example.com`, then + * you can add the group to the space by setting the + * `membership.group_member.name` to `groups/123456789`. Group email is not + * supported, and Google groups can only be added as members in named spaces. + * + * For a named space or group chat, if the caller blocks, or is blocked + * by some members, or doesn't have permission to add some members, then + * those members aren't added to the created space. + * + * To create a direct message (DM) between the calling user and another human + * user, specify exactly one membership to represent the human user. If + * one user blocks the other, the request fails and the DM isn't created. + * + * To create a DM between the calling user and the calling app, set + * `Space.singleUserBotDm` to `true` and don't specify any memberships. You + * can only use this method to set up a DM with the calling app. To add the + * calling app as a member of a space or an existing DM between two human + * users, see + * [Invite or add a user or app to a + * space](https://developers.google.com/workspace/chat/create-members). + * + * If a DM already exists between two users, even when one user blocks the + * other at the time a request is made, then the existing DM is returned. + * + * Spaces with threaded replies aren't supported. If you receive the error + * message `ALREADY_EXISTS` when setting up a space, try a different + * `displayName`. An existing space within the Google Workspace organization + * might already use this display name. + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.chat.v1.Space} request.space + * Required. The `Space.spaceType` field is required. + * + * To create a space, set `Space.spaceType` to `SPACE` and set + * `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when + * setting up a space, try a different `displayName`. An existing space + * within the Google Workspace organization might already use this display + * name. + * + * To create a group chat, set `Space.spaceType` to + * `GROUP_CHAT`. Don't set `Space.displayName`. + * + * To create a 1:1 conversation between humans, + * set `Space.spaceType` to `DIRECT_MESSAGE` and set + * `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * + * To create an 1:1 conversation between a human and the calling Chat app, set + * `Space.spaceType` to `DIRECT_MESSAGE` and + * `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * + * If a `DIRECT_MESSAGE` space already exists, that space is returned instead + * of creating a new space. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + * @param {number[]} [request.memberships] + * Optional. The Google Chat users or groups to invite to join the space. Omit + * the calling user, as they are added automatically. + * + * The set currently allows up to 20 memberships (in addition to the caller). + * + * For human membership, the `Membership.member` field must contain a `user` + * with `name` populated (format: `users/{user}`) and `type` set to + * `User.Type.HUMAN`. You can only add human users when setting up a space + * (adding Chat apps is only supported for direct message setup with the + * calling app). You can also add members using the user's email as an alias + * for {user}. For example, the `user.name` can be `users/example@gmail.com`. + * To invite Gmail users or users from external Google Workspace domains, + * user's email must be used for `{user}`. + * + * For Google group membership, the `Membership.group_member` field must + * contain a `group` with `name` populated (format `groups/{group}`). You + * can only add Google groups when setting `Space.spaceType` to `SPACE`. + * + * Optional when setting `Space.spaceType` to `SPACE`. + * + * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at + * least two memberships. + * + * Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human + * user, along with exactly one membership. + * + * Must be empty when creating a 1:1 conversation between a human and the + * calling Chat app (when setting `Space.spaceType` to + * `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Space|Space}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.set_up_space.js + * region_tag:chat_v1_generated_ChatService_SetUpSpace_async + */ + setUpSpace( + request?: protos.google.chat.v1.ISetUpSpaceRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ISetUpSpaceRequest|undefined, {}|undefined + ]>; + setUpSpace( + request: protos.google.chat.v1.ISetUpSpaceRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ISetUpSpaceRequest|null|undefined, + {}|null|undefined>): void; + setUpSpace( + request: protos.google.chat.v1.ISetUpSpaceRequest, + callback: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ISetUpSpaceRequest|null|undefined, + {}|null|undefined>): void; + setUpSpace( + request?: protos.google.chat.v1.ISetUpSpaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ISetUpSpaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ISetUpSpaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ISetUpSpaceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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(); + return this.innerApiCalls.setUpSpace(request, options, callback); + } +/** + * Updates a space. For an example, see + * [Update a + * space](https://developers.google.com/workspace/chat/update-spaces). + * + * If you're updating the `displayName` field and receive the error message + * `ALREADY_EXISTS`, try a different display name.. An existing space within + * the Google Workspace organization might already use this display name. + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.chat.v1.Space} request.space + * Required. Space with fields to be updated. `Space.name` must be + * populated in the form of `spaces/{space}`. Only fields + * specified by `update_mask` are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The updated field paths, comma separated if there are + * multiple. + * + * Currently supported field paths: + * + * - `display_name` (Only supports changing the display name of a space with + * the `SPACE` type, or when also including the `space_type` mask to change a + * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a + * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument + * error. If you receive the error message `ALREADY_EXISTS` when updating the + * `displayName`, try a different `displayName`. An existing space within the + * Google Workspace organization might already use this display name.) + * + * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * `SPACE`. Include `display_name` together + * with `space_type` in the update mask and ensure that the specified space + * has a non-empty display name and the `SPACE` space type. Including the + * `space_type` mask and the `SPACE` type in the specified space when updating + * the display name is optional if the existing space already has the `SPACE` + * type. Trying to update the space type in other ways results in an invalid + * argument error). + * `space_type` is not supported with admin access. + * + * - `space_details` + * + * - `space_history_state` (Supports [turning history on or off for the + * space](https://support.google.com/chat/answer/7664687) if [the organization + * allows users to change their history + * setting](https://support.google.com/a/answer/7664184). + * Warning: mutually exclusive with all other field paths.) + * `space_history_state` is not supported with admin access. + * + * - `access_settings.audience` (Supports changing the [access + * setting](https://support.google.com/chat/answer/11971020) of who can + * discover the space, join the space, and preview the messages in space. If + * no audience is specified in the access setting, the space's access setting + * is updated to private. Warning: mutually exclusive with all other field + * paths.) + * `access_settings.audience` is not supported with admin access. + * + * - Developer Preview: Supports changing the [permission + * settings](https://support.google.com/chat/answer/13340792) of a space, + * supported field paths + * include: `permission_settings.manage_members_and_groups`, + * `permission_settings.modify_space_details`, + * `permission_settings.toggle_history`, + * `permission_settings.use_at_mention_all`, + * `permission_settings.manage_apps`, `permission_settings.manage_webhooks`, + * `permission_settings.reply_messages` + * (Warning: mutually exclusive with all other non-permission settings field + * paths). `permission_settings` is not supported with admin access. + * @param {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires the `chat.admin.spaces` [OAuth 2.0 + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * + * Some `FieldMask` values are not supported using admin access. For details, + * see the description of `update_mask`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Space|Space}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.update_space.js + * region_tag:chat_v1_generated_ChatService_UpdateSpace_async + */ + updateSpace( + request?: protos.google.chat.v1.IUpdateSpaceRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IUpdateSpaceRequest|undefined, {}|undefined + ]>; + updateSpace( + request: protos.google.chat.v1.IUpdateSpaceRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IUpdateSpaceRequest|null|undefined, + {}|null|undefined>): void; + updateSpace( + request: protos.google.chat.v1.IUpdateSpaceRequest, + callback: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IUpdateSpaceRequest|null|undefined, + {}|null|undefined>): void; + updateSpace( + request?: protos.google.chat.v1.IUpdateSpaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IUpdateSpaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IUpdateSpaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IUpdateSpaceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'space.name': request.space!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSpace(request, options, callback); + } +/** + * Deletes a named space. Always performs a cascading delete, which means + * that the space's child resources—like messages posted in the space and + * memberships in the space—are also deleted. For an example, see + * [Delete a + * space](https://developers.google.com/workspace/chat/delete-spaces). + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * from a user who has permission to delete the space. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the space to delete. + * + * Format: `spaces/{space}` + * @param {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires the `chat.admin.delete` [OAuth 2.0 + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.delete_space.js + * region_tag:chat_v1_generated_ChatService_DeleteSpace_async + */ + deleteSpace( + request?: protos.google.chat.v1.IDeleteSpaceRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteSpaceRequest|undefined, {}|undefined + ]>; + deleteSpace( + request: protos.google.chat.v1.IDeleteSpaceRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteSpaceRequest|null|undefined, + {}|null|undefined>): void; + deleteSpace( + request: protos.google.chat.v1.IDeleteSpaceRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteSpaceRequest|null|undefined, + {}|null|undefined>): void; + deleteSpace( + request?: protos.google.chat.v1.IDeleteSpaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteSpaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteSpaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteSpaceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteSpace(request, options, callback); + } +/** + * Completes the + * [import process](https://developers.google.com/workspace/chat/import-data) + * for the specified space and makes it visible to users. + * Requires app authentication and domain-wide delegation. For more + * information, see [Authorize Google Chat apps to import + * data](https://developers.google.com/workspace/chat/authorize-import). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the import mode space. + * + * Format: `spaces/{space}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.CompleteImportSpaceResponse|CompleteImportSpaceResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.complete_import_space.js + * region_tag:chat_v1_generated_ChatService_CompleteImportSpace_async + */ + completeImportSpace( + request?: protos.google.chat.v1.ICompleteImportSpaceRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.ICompleteImportSpaceResponse, + protos.google.chat.v1.ICompleteImportSpaceRequest|undefined, {}|undefined + ]>; + completeImportSpace( + request: protos.google.chat.v1.ICompleteImportSpaceRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.ICompleteImportSpaceResponse, + protos.google.chat.v1.ICompleteImportSpaceRequest|null|undefined, + {}|null|undefined>): void; + completeImportSpace( + request: protos.google.chat.v1.ICompleteImportSpaceRequest, + callback: Callback< + protos.google.chat.v1.ICompleteImportSpaceResponse, + protos.google.chat.v1.ICompleteImportSpaceRequest|null|undefined, + {}|null|undefined>): void; + completeImportSpace( + request?: protos.google.chat.v1.ICompleteImportSpaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.ICompleteImportSpaceResponse, + protos.google.chat.v1.ICompleteImportSpaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.ICompleteImportSpaceResponse, + protos.google.chat.v1.ICompleteImportSpaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.ICompleteImportSpaceResponse, + protos.google.chat.v1.ICompleteImportSpaceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.completeImportSpace(request, options, callback); + } +/** + * Returns the existing direct message with the specified user. If no direct + * message space is found, returns a `404 NOT_FOUND` error. For an example, + * see + * [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). + * + * With [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * returns the direct message space between the specified user and the + * authenticated user. + * + * With [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + * returns the direct message space between the specified user and the calling + * Chat app. + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * or [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the user to find direct message with. + * + * Format: `users/{user}`, where `{user}` is either the `id` for the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the + * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + * in the Directory API. For example, if the People API profile ID is + * `123456789`, you can find a direct message with that person by using + * `users/123456789` as the `name`. When [authenticated as a + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the email as an alias for `{user}`. For example, + * `users/example@gmail.com` where `example@gmail.com` is the email of the + * Google Chat user. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Space|Space}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.find_direct_message.js + * region_tag:chat_v1_generated_ChatService_FindDirectMessage_async + */ + findDirectMessage( + request?: protos.google.chat.v1.IFindDirectMessageRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IFindDirectMessageRequest|undefined, {}|undefined + ]>; + findDirectMessage( + request: protos.google.chat.v1.IFindDirectMessageRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IFindDirectMessageRequest|null|undefined, + {}|null|undefined>): void; + findDirectMessage( + request: protos.google.chat.v1.IFindDirectMessageRequest, + callback: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IFindDirectMessageRequest|null|undefined, + {}|null|undefined>): void; + findDirectMessage( + request?: protos.google.chat.v1.IFindDirectMessageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IFindDirectMessageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IFindDirectMessageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IFindDirectMessageRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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(); + return this.innerApiCalls.findDirectMessage(request, options, callback); + } +/** + * Creates a human membership or app membership for the calling app. Creating + * memberships for other apps isn't supported. For an example, see + * [Invite or add a user or a Google Chat app to a + * space](https://developers.google.com/workspace/chat/create-members). + * When creating a membership, if the specified member has their auto-accept + * policy turned off, then they're invited, and must accept the space + * invitation before joining. Otherwise, creating a membership adds the member + * directly to the specified space. Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * To specify the member to add, set the `membership.member.name` for the + * human or app member, or set the `membership.group_member.name` for the + * group member. + * + * - To add the calling app to a space or a direct message between two human + * users, use `users/app`. Unable to add other + * apps to the space. + * + * - To add a human user, use `users/{user}`, where `{user}` can be the email + * address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` for the person from the People API, or the `id` for + * the user in the Directory API. For example, if the People API Person + * profile ID for `user@example.com` is `123456789`, you can add the user to + * the space by setting the `membership.member.name` to + * `users/user@example.com` or `users/123456789`. + * + * - To add or invite a Google group in a named space, use + * `groups/{group}`, where `{group}` is the `id` for the group from the Cloud + * Identity Groups API. For example, you can use [Cloud Identity Groups lookup + * API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) + * to retrieve the ID `123456789` for group email `group@example.com`, then + * you can add or invite the group to a named space by setting the + * `membership.group_member.name` to `groups/123456789`. Group email is not + * supported, and Google groups can only be added as members in named spaces. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the space for which to create the + * membership. + * + * Format: spaces/{space} + * @param {google.chat.v1.Membership} request.membership + * Required. The membership relation to create. + * The `memberType` field must contain a user with the `user.name` and + * `user.type` fields populated. The server will assign a resource name + * and overwrite anything specified. + * When a Chat app creates a membership relation for a human user, it must use + * the `chat.memberships` scope, set `user.type` to `HUMAN`, and set + * `user.name` with format `users/{user}`, where `{user}` can be the email + * address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` of the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the user in the Directory API. For example, if + * the People API Person profile ID for `user@example.com` is `123456789`, you + * can add the user to the space by setting the `membership.member.name` to + * `users/user@example.com` or `users/123456789`. When a Chat app creates a + * membership relation for itself, it must use the `chat.memberships.app` + * scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + * @param {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires the `chat.admin.memberships` [OAuth 2.0 + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * + * Creating app memberships or creating memberships for users outside the + * administrator's Google Workspace organization isn't supported using admin + * access. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Membership|Membership}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.create_membership.js + * region_tag:chat_v1_generated_ChatService_CreateMembership_async + */ + createMembership( + request?: protos.google.chat.v1.ICreateMembershipRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IMembership, + protos.google.chat.v1.ICreateMembershipRequest|undefined, {}|undefined + ]>; + createMembership( + request: protos.google.chat.v1.ICreateMembershipRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.ICreateMembershipRequest|null|undefined, + {}|null|undefined>): void; + createMembership( + request: protos.google.chat.v1.ICreateMembershipRequest, + callback: Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.ICreateMembershipRequest|null|undefined, + {}|null|undefined>): void; + createMembership( + request?: protos.google.chat.v1.ICreateMembershipRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.ICreateMembershipRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.ICreateMembershipRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.IMembership, + protos.google.chat.v1.ICreateMembershipRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createMembership(request, options, callback); + } +/** + * Updates a membership. For an example, see [Update a user's membership in + * a space](https://developers.google.com/workspace/chat/update-members). + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.chat.v1.Membership} request.membership + * Required. The membership to update. Only fields specified by `update_mask` + * are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The field paths to update. Separate multiple values with commas + * or use `*` to update all field paths. + * + * Currently supported field paths: + * + * - `role` + * @param {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires the `chat.admin.memberships` [OAuth 2.0 + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Membership|Membership}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.update_membership.js + * region_tag:chat_v1_generated_ChatService_UpdateMembership_async + */ + updateMembership( + request?: protos.google.chat.v1.IUpdateMembershipRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IUpdateMembershipRequest|undefined, {}|undefined + ]>; + updateMembership( + request: protos.google.chat.v1.IUpdateMembershipRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IUpdateMembershipRequest|null|undefined, + {}|null|undefined>): void; + updateMembership( + request: protos.google.chat.v1.IUpdateMembershipRequest, + callback: Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IUpdateMembershipRequest|null|undefined, + {}|null|undefined>): void; + updateMembership( + request?: protos.google.chat.v1.IUpdateMembershipRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IUpdateMembershipRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IUpdateMembershipRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IUpdateMembershipRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'membership.name': request.membership!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateMembership(request, options, callback); + } +/** + * Deletes a membership. For an example, see + * [Remove a user or a Google Chat app from a + * space](https://developers.google.com/workspace/chat/delete-members). + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the membership to delete. Chat apps can delete + * human users' or their own memberships. Chat apps can't delete other apps' + * memberships. + * + * When deleting a human membership, requires the `chat.memberships` scope and + * `spaces/{space}/members/{member}` format. You can use the email as an + * alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * + * When deleting an app membership, requires the `chat.memberships.app` scope + * and `spaces/{space}/members/app` format. + * + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + * @param {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires the `chat.admin.memberships` [OAuth 2.0 + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * + * Deleting app memberships in a space isn't supported using admin access. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Membership|Membership}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.delete_membership.js + * region_tag:chat_v1_generated_ChatService_DeleteMembership_async + */ + deleteMembership( + request?: protos.google.chat.v1.IDeleteMembershipRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IDeleteMembershipRequest|undefined, {}|undefined + ]>; + deleteMembership( + request: protos.google.chat.v1.IDeleteMembershipRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IDeleteMembershipRequest|null|undefined, + {}|null|undefined>): void; + deleteMembership( + request: protos.google.chat.v1.IDeleteMembershipRequest, + callback: Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IDeleteMembershipRequest|null|undefined, + {}|null|undefined>): void; + deleteMembership( + request?: protos.google.chat.v1.IDeleteMembershipRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IDeleteMembershipRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IDeleteMembershipRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IDeleteMembershipRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteMembership(request, options, callback); + } +/** + * Creates a reaction and adds it to a message. Only unicode emojis are + * supported. For an example, see + * [Add a reaction to a + * message](https://developers.google.com/workspace/chat/create-reactions). + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The message where the reaction is created. + * + * Format: `spaces/{space}/messages/{message}` + * @param {google.chat.v1.Reaction} request.reaction + * Required. The reaction to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.Reaction|Reaction}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.create_reaction.js + * region_tag:chat_v1_generated_ChatService_CreateReaction_async + */ + createReaction( + request?: protos.google.chat.v1.ICreateReactionRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IReaction, + protos.google.chat.v1.ICreateReactionRequest|undefined, {}|undefined + ]>; + createReaction( + request: protos.google.chat.v1.ICreateReactionRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.IReaction, + protos.google.chat.v1.ICreateReactionRequest|null|undefined, + {}|null|undefined>): void; + createReaction( + request: protos.google.chat.v1.ICreateReactionRequest, + callback: Callback< + protos.google.chat.v1.IReaction, + protos.google.chat.v1.ICreateReactionRequest|null|undefined, + {}|null|undefined>): void; + createReaction( + request?: protos.google.chat.v1.ICreateReactionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.IReaction, + protos.google.chat.v1.ICreateReactionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.IReaction, + protos.google.chat.v1.ICreateReactionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.IReaction, + protos.google.chat.v1.ICreateReactionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createReaction(request, options, callback); + } +/** + * Deletes a reaction to a message. Only unicode emojis are supported. + * For an example, see + * [Delete a + * reaction](https://developers.google.com/workspace/chat/delete-reactions). + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the reaction to delete. + * + * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.delete_reaction.js + * region_tag:chat_v1_generated_ChatService_DeleteReaction_async + */ + deleteReaction( + request?: protos.google.chat.v1.IDeleteReactionRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteReactionRequest|undefined, {}|undefined + ]>; + deleteReaction( + request: protos.google.chat.v1.IDeleteReactionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteReactionRequest|null|undefined, + {}|null|undefined>): void; + deleteReaction( + request: protos.google.chat.v1.IDeleteReactionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteReactionRequest|null|undefined, + {}|null|undefined>): void; + deleteReaction( + request?: protos.google.chat.v1.IDeleteReactionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteReactionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteReactionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteReactionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteReaction(request, options, callback); + } +/** + * Returns details about a user's read state within a space, used to identify + * read and unread messages. For an example, see [Get details about a user's + * space read + * state](https://developers.google.com/workspace/chat/get-space-read-state). + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the space read state to retrieve. + * + * Only supports getting read state for the calling user. + * + * To refer to the calling user, set one of the following: + * + * - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`. + * + * - Their Workspace email address. For example, + * `users/user@example.com/spaces/{space}/spaceReadState`. + * + * - Their user id. For example, + * `users/123456789/spaces/{space}/spaceReadState`. + * + * Format: users/{user}/spaces/{space}/spaceReadState + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.SpaceReadState|SpaceReadState}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.get_space_read_state.js + * region_tag:chat_v1_generated_ChatService_GetSpaceReadState_async + */ + getSpaceReadState( + request?: protos.google.chat.v1.IGetSpaceReadStateRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IGetSpaceReadStateRequest|undefined, {}|undefined + ]>; + getSpaceReadState( + request: protos.google.chat.v1.IGetSpaceReadStateRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IGetSpaceReadStateRequest|null|undefined, + {}|null|undefined>): void; + getSpaceReadState( + request: protos.google.chat.v1.IGetSpaceReadStateRequest, + callback: Callback< + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IGetSpaceReadStateRequest|null|undefined, + {}|null|undefined>): void; + getSpaceReadState( + request?: protos.google.chat.v1.IGetSpaceReadStateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IGetSpaceReadStateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IGetSpaceReadStateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IGetSpaceReadStateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getSpaceReadState(request, options, callback); + } +/** + * Updates a user's read state within a space, used to identify read and + * unread messages. For an example, see [Update a user's space read + * state](https://developers.google.com/workspace/chat/update-space-read-state). + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.chat.v1.SpaceReadState} request.spaceReadState + * Required. The space read state and fields to update. + * + * Only supports updating read state for the calling user. + * + * To refer to the calling user, set one of the following: + * + * - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`. + * + * - Their Workspace email address. For example, + * `users/user@example.com/spaces/{space}/spaceReadState`. + * + * - Their user id. For example, + * `users/123456789/spaces/{space}/spaceReadState`. + * + * Format: users/{user}/spaces/{space}/spaceReadState + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The field paths to update. Currently supported field paths: + * + * - `last_read_time` + * + * When the `last_read_time` is before the latest message create time, the + * space appears as unread in the UI. + * + * To mark the space as read, set `last_read_time` to any value later (larger) + * than the latest message create time. The `last_read_time` is coerced to + * match the latest message create time. Note that the space read state only + * affects the read state of messages that are visible in the space's + * top-level conversation. Replies in threads are unaffected by this + * timestamp, and instead rely on the thread read state. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.SpaceReadState|SpaceReadState}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.update_space_read_state.js + * region_tag:chat_v1_generated_ChatService_UpdateSpaceReadState_async + */ + updateSpaceReadState( + request?: protos.google.chat.v1.IUpdateSpaceReadStateRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IUpdateSpaceReadStateRequest|undefined, {}|undefined + ]>; + updateSpaceReadState( + request: protos.google.chat.v1.IUpdateSpaceReadStateRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IUpdateSpaceReadStateRequest|null|undefined, + {}|null|undefined>): void; + updateSpaceReadState( + request: protos.google.chat.v1.IUpdateSpaceReadStateRequest, + callback: Callback< + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IUpdateSpaceReadStateRequest|null|undefined, + {}|null|undefined>): void; + updateSpaceReadState( + request?: protos.google.chat.v1.IUpdateSpaceReadStateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IUpdateSpaceReadStateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IUpdateSpaceReadStateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IUpdateSpaceReadStateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'space_read_state.name': request.spaceReadState!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSpaceReadState(request, options, callback); + } +/** + * Returns details about a user's read state within a thread, used to identify + * read and unread messages. For an example, see [Get details about a user's + * thread read + * state](https://developers.google.com/workspace/chat/get-thread-read-state). + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the thread read state to retrieve. + * + * Only supports getting read state for the calling user. + * + * To refer to the calling user, set one of the following: + * + * - The `me` alias. For example, + * `users/me/spaces/{space}/threads/{thread}/threadReadState`. + * + * - Their Workspace email address. For example, + * `users/user@example.com/spaces/{space}/threads/{thread}/threadReadState`. + * + * - Their user id. For example, + * `users/123456789/spaces/{space}/threads/{thread}/threadReadState`. + * + * Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.ThreadReadState|ThreadReadState}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.get_thread_read_state.js + * region_tag:chat_v1_generated_ChatService_GetThreadReadState_async + */ + getThreadReadState( + request?: protos.google.chat.v1.IGetThreadReadStateRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IThreadReadState, + protos.google.chat.v1.IGetThreadReadStateRequest|undefined, {}|undefined + ]>; + getThreadReadState( + request: protos.google.chat.v1.IGetThreadReadStateRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.IThreadReadState, + protos.google.chat.v1.IGetThreadReadStateRequest|null|undefined, + {}|null|undefined>): void; + getThreadReadState( + request: protos.google.chat.v1.IGetThreadReadStateRequest, + callback: Callback< + protos.google.chat.v1.IThreadReadState, + protos.google.chat.v1.IGetThreadReadStateRequest|null|undefined, + {}|null|undefined>): void; + getThreadReadState( + request?: protos.google.chat.v1.IGetThreadReadStateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.IThreadReadState, + protos.google.chat.v1.IGetThreadReadStateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.IThreadReadState, + protos.google.chat.v1.IGetThreadReadStateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.IThreadReadState, + protos.google.chat.v1.IGetThreadReadStateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getThreadReadState(request, options, callback); + } +/** + * Returns an event from a Google Chat space. The [event + * payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) + * contains the most recent version of the resource that changed. For example, + * if you request an event about a new message but the message was later + * updated, the server returns the updated `Message` resource in the event + * payload. + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * To get an event, the authenticated user must be a member of the space. + * + * For an example, see [Get details about an + * event from a Google Chat + * space](https://developers.google.com/workspace/chat/get-space-event). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the space event. + * + * Format: `spaces/{space}/spaceEvents/{spaceEvent}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.chat.v1.SpaceEvent|SpaceEvent}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.get_space_event.js + * region_tag:chat_v1_generated_ChatService_GetSpaceEvent_async + */ + getSpaceEvent( + request?: protos.google.chat.v1.IGetSpaceEventRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.ISpaceEvent, + protos.google.chat.v1.IGetSpaceEventRequest|undefined, {}|undefined + ]>; + getSpaceEvent( + request: protos.google.chat.v1.IGetSpaceEventRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.ISpaceEvent, + protos.google.chat.v1.IGetSpaceEventRequest|null|undefined, + {}|null|undefined>): void; + getSpaceEvent( + request: protos.google.chat.v1.IGetSpaceEventRequest, + callback: Callback< + protos.google.chat.v1.ISpaceEvent, + protos.google.chat.v1.IGetSpaceEventRequest|null|undefined, + {}|null|undefined>): void; + getSpaceEvent( + request?: protos.google.chat.v1.IGetSpaceEventRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.chat.v1.ISpaceEvent, + protos.google.chat.v1.IGetSpaceEventRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.chat.v1.ISpaceEvent, + protos.google.chat.v1.IGetSpaceEventRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.chat.v1.ISpaceEvent, + protos.google.chat.v1.IGetSpaceEventRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getSpaceEvent(request, options, callback); + } + + /** + * Lists messages in a space that the caller is a member of, including + * messages from blocked members and spaces. For an example, see + * [List messages](/chat/api/guides/v1/messages/list). + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the space to list messages from. + * + * Format: `spaces/{space}` + * @param {number} request.pageSize + * The maximum number of messages returned. The service might return fewer + * messages than this value. + * + * If unspecified, at most 25 are returned. + * + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * + * Negative values return an `INVALID_ARGUMENT` error. + * @param {string} request.pageToken + * Optional, if resuming from a previous query. + * + * A page token received from a previous list messages call. Provide this + * parameter to retrieve the subsequent page. + * + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * @param {string} request.filter + * A query filter. + * + * You can filter messages by date (`create_time`) and thread (`thread.name`). + * + * To filter messages by the date they were created, specify the `create_time` + * with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) + * format and double quotation marks. For example, + * `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to + * list messages that were created after a timestamp, or the less than + * operator `<` to list messages that were created before a timestamp. To + * filter messages within a time interval, use the `AND` operator between two + * timestamps. + * + * To filter by thread, specify the `thread.name`, formatted as + * `spaces/{space}/threads/{thread}`. You can only specify one + * `thread.name` per query. + * + * To filter by both thread and date, use the `AND` operator in your query. + * + * For example, the following queries are valid: + * + * ``` + * create_time > "2012-04-21T11:30:00-04:00" + * + * create_time > "2012-04-21T11:30:00-04:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * + * create_time > "2012-04-21T11:30:00+00:00" AND + * + * create_time < "2013-01-01T00:00:00+00:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @param {string} request.orderBy + * Optional, if resuming from a previous query. + * + * How the list of messages is ordered. Specify a value to order by an + * ordering operation. Valid ordering operation values are as follows: + * + * - `ASC` for ascending. + * + * - `DESC` for descending. + * + * The default ordering is `create_time ASC`. + * @param {boolean} request.showDeleted + * Whether to include deleted messages. Deleted messages include deleted time + * and metadata about their deletion, but message content is unavailable. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.chat.v1.Message|Message}. + * 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 `listMessagesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMessages( + request?: protos.google.chat.v1.IListMessagesRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IMessage[], + protos.google.chat.v1.IListMessagesRequest|null, + protos.google.chat.v1.IListMessagesResponse + ]>; + listMessages( + request: protos.google.chat.v1.IListMessagesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.chat.v1.IListMessagesRequest, + protos.google.chat.v1.IListMessagesResponse|null|undefined, + protos.google.chat.v1.IMessage>): void; + listMessages( + request: protos.google.chat.v1.IListMessagesRequest, + callback: PaginationCallback< + protos.google.chat.v1.IListMessagesRequest, + protos.google.chat.v1.IListMessagesResponse|null|undefined, + protos.google.chat.v1.IMessage>): void; + listMessages( + request?: protos.google.chat.v1.IListMessagesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.chat.v1.IListMessagesRequest, + protos.google.chat.v1.IListMessagesResponse|null|undefined, + protos.google.chat.v1.IMessage>, + callback?: PaginationCallback< + protos.google.chat.v1.IListMessagesRequest, + protos.google.chat.v1.IListMessagesResponse|null|undefined, + protos.google.chat.v1.IMessage>): + Promise<[ + protos.google.chat.v1.IMessage[], + protos.google.chat.v1.IListMessagesRequest|null, + protos.google.chat.v1.IListMessagesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listMessages(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the space to list messages from. + * + * Format: `spaces/{space}` + * @param {number} request.pageSize + * The maximum number of messages returned. The service might return fewer + * messages than this value. + * + * If unspecified, at most 25 are returned. + * + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * + * Negative values return an `INVALID_ARGUMENT` error. + * @param {string} request.pageToken + * Optional, if resuming from a previous query. + * + * A page token received from a previous list messages call. Provide this + * parameter to retrieve the subsequent page. + * + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * @param {string} request.filter + * A query filter. + * + * You can filter messages by date (`create_time`) and thread (`thread.name`). + * + * To filter messages by the date they were created, specify the `create_time` + * with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) + * format and double quotation marks. For example, + * `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to + * list messages that were created after a timestamp, or the less than + * operator `<` to list messages that were created before a timestamp. To + * filter messages within a time interval, use the `AND` operator between two + * timestamps. + * + * To filter by thread, specify the `thread.name`, formatted as + * `spaces/{space}/threads/{thread}`. You can only specify one + * `thread.name` per query. + * + * To filter by both thread and date, use the `AND` operator in your query. + * + * For example, the following queries are valid: + * + * ``` + * create_time > "2012-04-21T11:30:00-04:00" + * + * create_time > "2012-04-21T11:30:00-04:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * + * create_time > "2012-04-21T11:30:00+00:00" AND + * + * create_time < "2013-01-01T00:00:00+00:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @param {string} request.orderBy + * Optional, if resuming from a previous query. + * + * How the list of messages is ordered. Specify a value to order by an + * ordering operation. Valid ordering operation values are as follows: + * + * - `ASC` for ascending. + * + * - `DESC` for descending. + * + * The default ordering is `create_time ASC`. + * @param {boolean} request.showDeleted + * Whether to include deleted messages. Deleted messages include deleted time + * and metadata about their deletion, but message content is unavailable. + * @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.chat.v1.Message|Message} 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 `listMessagesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMessagesStream( + request?: protos.google.chat.v1.IListMessagesRequest, + 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['listMessages']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMessages.createStream( + this.innerApiCalls.listMessages as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listMessages`, 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 space to list messages from. + * + * Format: `spaces/{space}` + * @param {number} request.pageSize + * The maximum number of messages returned. The service might return fewer + * messages than this value. + * + * If unspecified, at most 25 are returned. + * + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * + * Negative values return an `INVALID_ARGUMENT` error. + * @param {string} request.pageToken + * Optional, if resuming from a previous query. + * + * A page token received from a previous list messages call. Provide this + * parameter to retrieve the subsequent page. + * + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * @param {string} request.filter + * A query filter. + * + * You can filter messages by date (`create_time`) and thread (`thread.name`). + * + * To filter messages by the date they were created, specify the `create_time` + * with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) + * format and double quotation marks. For example, + * `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to + * list messages that were created after a timestamp, or the less than + * operator `<` to list messages that were created before a timestamp. To + * filter messages within a time interval, use the `AND` operator between two + * timestamps. + * + * To filter by thread, specify the `thread.name`, formatted as + * `spaces/{space}/threads/{thread}`. You can only specify one + * `thread.name` per query. + * + * To filter by both thread and date, use the `AND` operator in your query. + * + * For example, the following queries are valid: + * + * ``` + * create_time > "2012-04-21T11:30:00-04:00" + * + * create_time > "2012-04-21T11:30:00-04:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * + * create_time > "2012-04-21T11:30:00+00:00" AND + * + * create_time < "2013-01-01T00:00:00+00:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @param {string} request.orderBy + * Optional, if resuming from a previous query. + * + * How the list of messages is ordered. Specify a value to order by an + * ordering operation. Valid ordering operation values are as follows: + * + * - `ASC` for ascending. + * + * - `DESC` for descending. + * + * The default ordering is `create_time ASC`. + * @param {boolean} request.showDeleted + * Whether to include deleted messages. Deleted messages include deleted time + * and metadata about their deletion, but message content is unavailable. + * @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.chat.v1.Message|Message}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.list_messages.js + * region_tag:chat_v1_generated_ChatService_ListMessages_async + */ + listMessagesAsync( + request?: protos.google.chat.v1.IListMessagesRequest, + 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['listMessages']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMessages.asyncIterate( + this.innerApiCalls['listMessages'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists memberships in a space. For an example, see [List users and Google + * Chat apps in a + * space](https://developers.google.com/workspace/chat/list-members). Listing + * memberships with [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * lists memberships in spaces that the Chat app has + * access to, but excludes Chat app memberships, + * including its own. Listing memberships with + * [User + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * lists memberships in spaces that the authenticated user has access to. + * + * Requires + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + * Supports + * [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * and [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the space for which to fetch a membership + * list. + * + * Format: spaces/{space} + * @param {number} [request.pageSize] + * Optional. The maximum number of memberships to return. The service might + * return fewer than this value. + * + * If unspecified, at most 100 memberships are returned. + * + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * + * Negative values return an `INVALID_ARGUMENT` error. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous call to list memberships. + * Provide this parameter to retrieve the subsequent page. + * + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * @param {string} [request.filter] + * Optional. A query filter. + * + * You can filter memberships by a member's role + * ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * and type + * ([`member.type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)). + * + * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. + * + * To filter by type, set `member.type` to `HUMAN` or `BOT`. You can also + * filter for `member.type` using the `!=` operator. + * + * To filter by both role and type, use the `AND` operator. To filter by + * either role or type, use the `OR` operator. + * + * Either `member.type = "HUMAN"` or `member.type != "BOT"` is required + * when `use_admin_access` is set to true. Other member type filters will be + * rejected. + * + * For example, the following queries are valid: + * + * ``` + * role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + * member.type = "HUMAN" AND role = "ROLE_MANAGER" + * + * member.type != "BOT" + * ``` + * + * The following queries are invalid: + * + * ``` + * member.type = "HUMAN" AND member.type = "BOT" + * role = "ROLE_MANAGER" AND role = "ROLE_MEMBER" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @param {boolean} [request.showGroups] + * Optional. When `true`, also returns memberships associated with a + * {@link protos.google.chat.v1.Membership.group_member|Google Group}, in + * addition to other types of memberships. If a + * {@link protos.google.chat.v1.ListMembershipsRequest.filter|filter} is set, + * {@link protos.google.chat.v1.Membership.group_member|Google Group} + * memberships that don't match the filter criteria aren't returned. + * @param {boolean} [request.showInvited] + * Optional. When `true`, also returns memberships associated with + * {@link protos.google.chat.v1.Membership.MembershipState.INVITED|invited} members, in + * addition to other types of memberships. If a + * filter is set, + * {@link protos.google.chat.v1.Membership.MembershipState.INVITED|invited} memberships + * that don't match the filter criteria aren't returned. + * + * Currently requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * @param {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires either the `chat.admin.memberships.readonly` or + * `chat.admin.memberships` [OAuth 2.0 + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * + * Listing app memberships in a space isn't supported when using admin access. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.chat.v1.Membership|Membership}. + * 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 `listMembershipsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMemberships( + request?: protos.google.chat.v1.IListMembershipsRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IMembership[], + protos.google.chat.v1.IListMembershipsRequest|null, + protos.google.chat.v1.IListMembershipsResponse + ]>; + listMemberships( + request: protos.google.chat.v1.IListMembershipsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.chat.v1.IListMembershipsRequest, + protos.google.chat.v1.IListMembershipsResponse|null|undefined, + protos.google.chat.v1.IMembership>): void; + listMemberships( + request: protos.google.chat.v1.IListMembershipsRequest, + callback: PaginationCallback< + protos.google.chat.v1.IListMembershipsRequest, + protos.google.chat.v1.IListMembershipsResponse|null|undefined, + protos.google.chat.v1.IMembership>): void; + listMemberships( + request?: protos.google.chat.v1.IListMembershipsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.chat.v1.IListMembershipsRequest, + protos.google.chat.v1.IListMembershipsResponse|null|undefined, + protos.google.chat.v1.IMembership>, + callback?: PaginationCallback< + protos.google.chat.v1.IListMembershipsRequest, + protos.google.chat.v1.IListMembershipsResponse|null|undefined, + protos.google.chat.v1.IMembership>): + Promise<[ + protos.google.chat.v1.IMembership[], + protos.google.chat.v1.IListMembershipsRequest|null, + protos.google.chat.v1.IListMembershipsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listMemberships(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the space for which to fetch a membership + * list. + * + * Format: spaces/{space} + * @param {number} [request.pageSize] + * Optional. The maximum number of memberships to return. The service might + * return fewer than this value. + * + * If unspecified, at most 100 memberships are returned. + * + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * + * Negative values return an `INVALID_ARGUMENT` error. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous call to list memberships. + * Provide this parameter to retrieve the subsequent page. + * + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * @param {string} [request.filter] + * Optional. A query filter. + * + * You can filter memberships by a member's role + * ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * and type + * ([`member.type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)). + * + * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. + * + * To filter by type, set `member.type` to `HUMAN` or `BOT`. You can also + * filter for `member.type` using the `!=` operator. + * + * To filter by both role and type, use the `AND` operator. To filter by + * either role or type, use the `OR` operator. + * + * Either `member.type = "HUMAN"` or `member.type != "BOT"` is required + * when `use_admin_access` is set to true. Other member type filters will be + * rejected. + * + * For example, the following queries are valid: + * + * ``` + * role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + * member.type = "HUMAN" AND role = "ROLE_MANAGER" + * + * member.type != "BOT" + * ``` + * + * The following queries are invalid: + * + * ``` + * member.type = "HUMAN" AND member.type = "BOT" + * role = "ROLE_MANAGER" AND role = "ROLE_MEMBER" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @param {boolean} [request.showGroups] + * Optional. When `true`, also returns memberships associated with a + * {@link protos.google.chat.v1.Membership.group_member|Google Group}, in + * addition to other types of memberships. If a + * {@link protos.google.chat.v1.ListMembershipsRequest.filter|filter} is set, + * {@link protos.google.chat.v1.Membership.group_member|Google Group} + * memberships that don't match the filter criteria aren't returned. + * @param {boolean} [request.showInvited] + * Optional. When `true`, also returns memberships associated with + * {@link protos.google.chat.v1.Membership.MembershipState.INVITED|invited} members, in + * addition to other types of memberships. If a + * filter is set, + * {@link protos.google.chat.v1.Membership.MembershipState.INVITED|invited} memberships + * that don't match the filter criteria aren't returned. + * + * Currently requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * @param {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires either the `chat.admin.memberships.readonly` or + * `chat.admin.memberships` [OAuth 2.0 + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * + * Listing app memberships in a space isn't supported when using admin access. + * @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.chat.v1.Membership|Membership} 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 `listMembershipsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMembershipsStream( + request?: protos.google.chat.v1.IListMembershipsRequest, + 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['listMemberships']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMemberships.createStream( + this.innerApiCalls.listMemberships as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listMemberships`, 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 space for which to fetch a membership + * list. + * + * Format: spaces/{space} + * @param {number} [request.pageSize] + * Optional. The maximum number of memberships to return. The service might + * return fewer than this value. + * + * If unspecified, at most 100 memberships are returned. + * + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * + * Negative values return an `INVALID_ARGUMENT` error. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous call to list memberships. + * Provide this parameter to retrieve the subsequent page. + * + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * @param {string} [request.filter] + * Optional. A query filter. + * + * You can filter memberships by a member's role + * ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * and type + * ([`member.type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)). + * + * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. + * + * To filter by type, set `member.type` to `HUMAN` or `BOT`. You can also + * filter for `member.type` using the `!=` operator. + * + * To filter by both role and type, use the `AND` operator. To filter by + * either role or type, use the `OR` operator. + * + * Either `member.type = "HUMAN"` or `member.type != "BOT"` is required + * when `use_admin_access` is set to true. Other member type filters will be + * rejected. + * + * For example, the following queries are valid: + * + * ``` + * role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + * member.type = "HUMAN" AND role = "ROLE_MANAGER" + * + * member.type != "BOT" + * ``` + * + * The following queries are invalid: + * + * ``` + * member.type = "HUMAN" AND member.type = "BOT" + * role = "ROLE_MANAGER" AND role = "ROLE_MEMBER" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @param {boolean} [request.showGroups] + * Optional. When `true`, also returns memberships associated with a + * {@link protos.google.chat.v1.Membership.group_member|Google Group}, in + * addition to other types of memberships. If a + * {@link protos.google.chat.v1.ListMembershipsRequest.filter|filter} is set, + * {@link protos.google.chat.v1.Membership.group_member|Google Group} + * memberships that don't match the filter criteria aren't returned. + * @param {boolean} [request.showInvited] + * Optional. When `true`, also returns memberships associated with + * {@link protos.google.chat.v1.Membership.MembershipState.INVITED|invited} members, in + * addition to other types of memberships. If a + * filter is set, + * {@link protos.google.chat.v1.Membership.MembershipState.INVITED|invited} memberships + * that don't match the filter criteria aren't returned. + * + * Currently requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * @param {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires either the `chat.admin.memberships.readonly` or + * `chat.admin.memberships` [OAuth 2.0 + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * + * Listing app memberships in a space isn't supported when using admin access. + * @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.chat.v1.Membership|Membership}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.list_memberships.js + * region_tag:chat_v1_generated_ChatService_ListMemberships_async + */ + listMembershipsAsync( + request?: protos.google.chat.v1.IListMembershipsRequest, + 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['listMemberships']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMemberships.asyncIterate( + this.innerApiCalls['listMemberships'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists spaces the caller is a member of. Group chats and DMs aren't listed + * until the first message is sent. For an example, see + * [List + * spaces](https://developers.google.com/workspace/chat/list-spaces). + * + * Requires + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + * Supports + * [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * and [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * Lists spaces visible to the caller or authenticated user. Group chats + * and DMs aren't listed until the first message is sent. + * + * To list all named spaces by Google Workspace organization, use the + * [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) + * method using Workspace administrator privileges instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of spaces to return. The service might return + * fewer than this value. + * + * If unspecified, at most 100 spaces are returned. + * + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * + * Negative values return an `INVALID_ARGUMENT` error. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous list spaces call. + * Provide this parameter to retrieve the subsequent page. + * + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value may lead to unexpected results. + * @param {string} [request.filter] + * Optional. A query filter. + * + * You can filter spaces by the space type + * ([`space_type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)). + * + * To filter by space type, you must specify valid enum value, such as + * `SPACE` or `GROUP_CHAT` (the `space_type` can't be + * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` + * operator. + * + * For example, the following queries are valid: + * + * ``` + * space_type = "SPACE" + * spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.chat.v1.Space|Space}. + * 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 `listSpacesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSpaces( + request?: protos.google.chat.v1.IListSpacesRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.ISpace[], + protos.google.chat.v1.IListSpacesRequest|null, + protos.google.chat.v1.IListSpacesResponse + ]>; + listSpaces( + request: protos.google.chat.v1.IListSpacesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.chat.v1.IListSpacesRequest, + protos.google.chat.v1.IListSpacesResponse|null|undefined, + protos.google.chat.v1.ISpace>): void; + listSpaces( + request: protos.google.chat.v1.IListSpacesRequest, + callback: PaginationCallback< + protos.google.chat.v1.IListSpacesRequest, + protos.google.chat.v1.IListSpacesResponse|null|undefined, + protos.google.chat.v1.ISpace>): void; + listSpaces( + request?: protos.google.chat.v1.IListSpacesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.chat.v1.IListSpacesRequest, + protos.google.chat.v1.IListSpacesResponse|null|undefined, + protos.google.chat.v1.ISpace>, + callback?: PaginationCallback< + protos.google.chat.v1.IListSpacesRequest, + protos.google.chat.v1.IListSpacesResponse|null|undefined, + protos.google.chat.v1.ISpace>): + Promise<[ + protos.google.chat.v1.ISpace[], + protos.google.chat.v1.IListSpacesRequest|null, + protos.google.chat.v1.IListSpacesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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(); + return this.innerApiCalls.listSpaces(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of spaces to return. The service might return + * fewer than this value. + * + * If unspecified, at most 100 spaces are returned. + * + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * + * Negative values return an `INVALID_ARGUMENT` error. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous list spaces call. + * Provide this parameter to retrieve the subsequent page. + * + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value may lead to unexpected results. + * @param {string} [request.filter] + * Optional. A query filter. + * + * You can filter spaces by the space type + * ([`space_type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)). + * + * To filter by space type, you must specify valid enum value, such as + * `SPACE` or `GROUP_CHAT` (the `space_type` can't be + * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` + * operator. + * + * For example, the following queries are valid: + * + * ``` + * space_type = "SPACE" + * spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @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.chat.v1.Space|Space} 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 `listSpacesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSpacesStream( + request?: protos.google.chat.v1.IListSpacesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listSpaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpaces.createStream( + this.innerApiCalls.listSpaces as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSpaces`, 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 {number} [request.pageSize] + * Optional. The maximum number of spaces to return. The service might return + * fewer than this value. + * + * If unspecified, at most 100 spaces are returned. + * + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * + * Negative values return an `INVALID_ARGUMENT` error. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous list spaces call. + * Provide this parameter to retrieve the subsequent page. + * + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value may lead to unexpected results. + * @param {string} [request.filter] + * Optional. A query filter. + * + * You can filter spaces by the space type + * ([`space_type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)). + * + * To filter by space type, you must specify valid enum value, such as + * `SPACE` or `GROUP_CHAT` (the `space_type` can't be + * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` + * operator. + * + * For example, the following queries are valid: + * + * ``` + * space_type = "SPACE" + * spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @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.chat.v1.Space|Space}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.list_spaces.js + * region_tag:chat_v1_generated_ChatService_ListSpaces_async + */ + listSpacesAsync( + request?: protos.google.chat.v1.IListSpacesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listSpaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpaces.asyncIterate( + this.innerApiCalls['listSpaces'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns a list of spaces in a Google Workspace organization based on an + * administrator's search. Requires [user + * authentication with administrator + * privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges). + * In the request, set `use_admin_access` to `true`. + * + * @param {Object} request + * The request object that will be sent. + * @param {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces` + * [OAuth 2.0 + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * + * This method currently only supports admin access, thus only `true` is + * accepted for this field. + * @param {number} request.pageSize + * The maximum number of spaces to return. The service may return fewer than + * this value. + * + * If unspecified, at most 100 spaces are returned. + * + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * @param {string} request.pageToken + * A token, received from the previous search spaces call. Provide this + * parameter to retrieve the subsequent page. + * + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * @param {string} request.query + * Required. A search query. + * + * You can search by using the following parameters: + * + * - `create_time` + * - `customer` + * - `display_name` + * - `external_user_allowed` + * - `last_active_time` + * - `space_history_state` + * - `space_type` + * + * `create_time` and `last_active_time` accept a timestamp in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported + * comparison operators are: `=`, `<`, `>`, `<=`, `>=`. + * + * `customer` is required and is used to indicate which customer + * to fetch spaces from. `customers/my_customer` is the only supported value. + * + * `display_name` only accepts the `HAS` (`:`) operator. The text to + * match is first tokenized into tokens and each token is prefix-matched + * case-insensitively and independently as a substring anywhere in the space's + * `display_name`. For example, `Fun Eve` matches `Fun event` or `The + * evening was fun`, but not `notFun event` or `even`. + * + * `external_user_allowed` accepts either `true` or `false`. + * + * `space_history_state` only accepts values from the [`historyState`] + * (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) + * field of a `space` resource. + * + * `space_type` is required and the only valid value is `SPACE`. + * + * Across different fields, only `AND` operators are supported. A valid + * example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid + * example is `space_type = "SPACE" OR display_name:"Hello"`. + * + * Among the same field, + * `space_type` doesn't support `AND` or `OR` operators. + * `display_name`, 'space_history_state', and 'external_user_allowed' only + * support `OR` operators. + * `last_active_time` and `create_time` support both `AND` and `OR` operators. + * `AND` can only be used to represent an interval, such as `last_active_time + * < "2022-01-01T00:00:00+00:00" AND last_active_time > + * "2023-01-01T00:00:00+00:00"`. + * + * The following example queries are valid: + * + * ``` + * customer = "customers/my_customer" AND space_type = "SPACE" + * + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * display_name:"Hello World" + * + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > + * "2022-01-01T00:00:00+00:00") + * + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * (display_name:"Hello World" OR display_name:"Fun event") AND + * (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < + * "2022-01-01T00:00:00+00:00") + * + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * (create_time > "2019-01-01T00:00:00+00:00" AND create_time < + * "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND + * (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF") + * ``` + * @param {string} [request.orderBy] + * Optional. How the list of spaces is ordered. + * + * Supported attributes to order by are: + * + * - `membership_count.joined_direct_human_user_count` — Denotes the count of + * human users that have directly joined a space. + * - `last_active_time` — Denotes the time when last eligible item is added to + * any topic of this space. + * - `create_time` — Denotes the time of the space creation. + * + * Valid ordering operation values are: + * + * - `ASC` for ascending. Default value. + * + * - `DESC` for descending. + * + * The supported syntax are: + * + * - `membership_count.joined_direct_human_user_count DESC` + * - `membership_count.joined_direct_human_user_count ASC` + * - `last_active_time DESC` + * - `last_active_time ASC` + * - `create_time DESC` + * - `create_time ASC` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.chat.v1.Space|Space}. + * 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 `searchSpacesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchSpaces( + request?: protos.google.chat.v1.ISearchSpacesRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.ISpace[], + protos.google.chat.v1.ISearchSpacesRequest|null, + protos.google.chat.v1.ISearchSpacesResponse + ]>; + searchSpaces( + request: protos.google.chat.v1.ISearchSpacesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.chat.v1.ISearchSpacesRequest, + protos.google.chat.v1.ISearchSpacesResponse|null|undefined, + protos.google.chat.v1.ISpace>): void; + searchSpaces( + request: protos.google.chat.v1.ISearchSpacesRequest, + callback: PaginationCallback< + protos.google.chat.v1.ISearchSpacesRequest, + protos.google.chat.v1.ISearchSpacesResponse|null|undefined, + protos.google.chat.v1.ISpace>): void; + searchSpaces( + request?: protos.google.chat.v1.ISearchSpacesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.chat.v1.ISearchSpacesRequest, + protos.google.chat.v1.ISearchSpacesResponse|null|undefined, + protos.google.chat.v1.ISpace>, + callback?: PaginationCallback< + protos.google.chat.v1.ISearchSpacesRequest, + protos.google.chat.v1.ISearchSpacesResponse|null|undefined, + protos.google.chat.v1.ISpace>): + Promise<[ + protos.google.chat.v1.ISpace[], + protos.google.chat.v1.ISearchSpacesRequest|null, + protos.google.chat.v1.ISearchSpacesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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(); + return this.innerApiCalls.searchSpaces(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces` + * [OAuth 2.0 + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * + * This method currently only supports admin access, thus only `true` is + * accepted for this field. + * @param {number} request.pageSize + * The maximum number of spaces to return. The service may return fewer than + * this value. + * + * If unspecified, at most 100 spaces are returned. + * + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * @param {string} request.pageToken + * A token, received from the previous search spaces call. Provide this + * parameter to retrieve the subsequent page. + * + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * @param {string} request.query + * Required. A search query. + * + * You can search by using the following parameters: + * + * - `create_time` + * - `customer` + * - `display_name` + * - `external_user_allowed` + * - `last_active_time` + * - `space_history_state` + * - `space_type` + * + * `create_time` and `last_active_time` accept a timestamp in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported + * comparison operators are: `=`, `<`, `>`, `<=`, `>=`. + * + * `customer` is required and is used to indicate which customer + * to fetch spaces from. `customers/my_customer` is the only supported value. + * + * `display_name` only accepts the `HAS` (`:`) operator. The text to + * match is first tokenized into tokens and each token is prefix-matched + * case-insensitively and independently as a substring anywhere in the space's + * `display_name`. For example, `Fun Eve` matches `Fun event` or `The + * evening was fun`, but not `notFun event` or `even`. + * + * `external_user_allowed` accepts either `true` or `false`. + * + * `space_history_state` only accepts values from the [`historyState`] + * (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) + * field of a `space` resource. + * + * `space_type` is required and the only valid value is `SPACE`. + * + * Across different fields, only `AND` operators are supported. A valid + * example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid + * example is `space_type = "SPACE" OR display_name:"Hello"`. + * + * Among the same field, + * `space_type` doesn't support `AND` or `OR` operators. + * `display_name`, 'space_history_state', and 'external_user_allowed' only + * support `OR` operators. + * `last_active_time` and `create_time` support both `AND` and `OR` operators. + * `AND` can only be used to represent an interval, such as `last_active_time + * < "2022-01-01T00:00:00+00:00" AND last_active_time > + * "2023-01-01T00:00:00+00:00"`. + * + * The following example queries are valid: + * + * ``` + * customer = "customers/my_customer" AND space_type = "SPACE" + * + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * display_name:"Hello World" + * + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > + * "2022-01-01T00:00:00+00:00") + * + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * (display_name:"Hello World" OR display_name:"Fun event") AND + * (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < + * "2022-01-01T00:00:00+00:00") + * + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * (create_time > "2019-01-01T00:00:00+00:00" AND create_time < + * "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND + * (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF") + * ``` + * @param {string} [request.orderBy] + * Optional. How the list of spaces is ordered. + * + * Supported attributes to order by are: + * + * - `membership_count.joined_direct_human_user_count` — Denotes the count of + * human users that have directly joined a space. + * - `last_active_time` — Denotes the time when last eligible item is added to + * any topic of this space. + * - `create_time` — Denotes the time of the space creation. + * + * Valid ordering operation values are: + * + * - `ASC` for ascending. Default value. + * + * - `DESC` for descending. + * + * The supported syntax are: + * + * - `membership_count.joined_direct_human_user_count DESC` + * - `membership_count.joined_direct_human_user_count ASC` + * - `last_active_time DESC` + * - `last_active_time ASC` + * - `create_time DESC` + * - `create_time ASC` + * @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.chat.v1.Space|Space} 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 `searchSpacesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchSpacesStream( + request?: protos.google.chat.v1.ISearchSpacesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchSpaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchSpaces.createStream( + this.innerApiCalls.searchSpaces as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchSpaces`, 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 {boolean} request.useAdminAccess + * When `true`, the method runs using the user's Google Workspace + * administrator privileges. + * + * The calling user must be a Google Workspace administrator with the + * [manage chat and spaces conversations + * privilege](https://support.google.com/a/answer/13369245). + * + * Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces` + * [OAuth 2.0 + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + * + * This method currently only supports admin access, thus only `true` is + * accepted for this field. + * @param {number} request.pageSize + * The maximum number of spaces to return. The service may return fewer than + * this value. + * + * If unspecified, at most 100 spaces are returned. + * + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. + * @param {string} request.pageToken + * A token, received from the previous search spaces call. Provide this + * parameter to retrieve the subsequent page. + * + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * @param {string} request.query + * Required. A search query. + * + * You can search by using the following parameters: + * + * - `create_time` + * - `customer` + * - `display_name` + * - `external_user_allowed` + * - `last_active_time` + * - `space_history_state` + * - `space_type` + * + * `create_time` and `last_active_time` accept a timestamp in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported + * comparison operators are: `=`, `<`, `>`, `<=`, `>=`. + * + * `customer` is required and is used to indicate which customer + * to fetch spaces from. `customers/my_customer` is the only supported value. + * + * `display_name` only accepts the `HAS` (`:`) operator. The text to + * match is first tokenized into tokens and each token is prefix-matched + * case-insensitively and independently as a substring anywhere in the space's + * `display_name`. For example, `Fun Eve` matches `Fun event` or `The + * evening was fun`, but not `notFun event` or `even`. + * + * `external_user_allowed` accepts either `true` or `false`. + * + * `space_history_state` only accepts values from the [`historyState`] + * (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) + * field of a `space` resource. + * + * `space_type` is required and the only valid value is `SPACE`. + * + * Across different fields, only `AND` operators are supported. A valid + * example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid + * example is `space_type = "SPACE" OR display_name:"Hello"`. + * + * Among the same field, + * `space_type` doesn't support `AND` or `OR` operators. + * `display_name`, 'space_history_state', and 'external_user_allowed' only + * support `OR` operators. + * `last_active_time` and `create_time` support both `AND` and `OR` operators. + * `AND` can only be used to represent an interval, such as `last_active_time + * < "2022-01-01T00:00:00+00:00" AND last_active_time > + * "2023-01-01T00:00:00+00:00"`. + * + * The following example queries are valid: + * + * ``` + * customer = "customers/my_customer" AND space_type = "SPACE" + * + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * display_name:"Hello World" + * + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > + * "2022-01-01T00:00:00+00:00") + * + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * (display_name:"Hello World" OR display_name:"Fun event") AND + * (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < + * "2022-01-01T00:00:00+00:00") + * + * customer = "customers/my_customer" AND space_type = "SPACE" AND + * (create_time > "2019-01-01T00:00:00+00:00" AND create_time < + * "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND + * (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF") + * ``` + * @param {string} [request.orderBy] + * Optional. How the list of spaces is ordered. + * + * Supported attributes to order by are: + * + * - `membership_count.joined_direct_human_user_count` — Denotes the count of + * human users that have directly joined a space. + * - `last_active_time` — Denotes the time when last eligible item is added to + * any topic of this space. + * - `create_time` — Denotes the time of the space creation. + * + * Valid ordering operation values are: + * + * - `ASC` for ascending. Default value. + * + * - `DESC` for descending. + * + * The supported syntax are: + * + * - `membership_count.joined_direct_human_user_count DESC` + * - `membership_count.joined_direct_human_user_count ASC` + * - `last_active_time DESC` + * - `last_active_time ASC` + * - `create_time DESC` + * - `create_time ASC` + * @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.chat.v1.Space|Space}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.search_spaces.js + * region_tag:chat_v1_generated_ChatService_SearchSpaces_async + */ + searchSpacesAsync( + request?: protos.google.chat.v1.ISearchSpacesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchSpaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchSpaces.asyncIterate( + this.innerApiCalls['searchSpaces'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists reactions to a message. For an example, see + * [List reactions for a + * message](https://developers.google.com/workspace/chat/list-reactions). + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The message users reacted to. + * + * Format: `spaces/{space}/messages/{message}` + * @param {number} [request.pageSize] + * Optional. The maximum number of reactions returned. The service can return + * fewer reactions than this value. If unspecified, the default value is 25. + * The maximum value is 200; values above 200 are changed to 200. + * @param {string} [request.pageToken] + * Optional. (If resuming from a previous query.) + * + * A page token received from a previous list reactions call. Provide this + * to retrieve the subsequent page. + * + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value might lead to unexpected results. + * @param {string} [request.filter] + * Optional. A query filter. + * + * You can filter reactions by + * [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) + * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) + * (`user.name`). + * + * To filter reactions for multiple emojis or users, join similar fields + * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = + * "👍"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. + * + * To filter reactions by emoji and user, use the `AND` operator, such as + * `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. + * + * If your query uses both `AND` and `OR`, group them with parentheses. + * + * For example, the following queries are valid: + * + * ``` + * user.name = "users/{user}" + * emoji.unicode = "🙂" + * emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR emoji.unicode = "👍" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" AND user.name = "users/{user}" + * (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") + * AND user.name = "users/{user}" + * ``` + * + * The following queries are invalid: + * + * ``` + * emoji.unicode = "🙂" AND emoji.unicode = "👍" + * emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR + * user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * AND user.name = "users/{user}" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.chat.v1.Reaction|Reaction}. + * 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 `listReactionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listReactions( + request?: protos.google.chat.v1.IListReactionsRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.IReaction[], + protos.google.chat.v1.IListReactionsRequest|null, + protos.google.chat.v1.IListReactionsResponse + ]>; + listReactions( + request: protos.google.chat.v1.IListReactionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.chat.v1.IListReactionsRequest, + protos.google.chat.v1.IListReactionsResponse|null|undefined, + protos.google.chat.v1.IReaction>): void; + listReactions( + request: protos.google.chat.v1.IListReactionsRequest, + callback: PaginationCallback< + protos.google.chat.v1.IListReactionsRequest, + protos.google.chat.v1.IListReactionsResponse|null|undefined, + protos.google.chat.v1.IReaction>): void; + listReactions( + request?: protos.google.chat.v1.IListReactionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.chat.v1.IListReactionsRequest, + protos.google.chat.v1.IListReactionsResponse|null|undefined, + protos.google.chat.v1.IReaction>, + callback?: PaginationCallback< + protos.google.chat.v1.IListReactionsRequest, + protos.google.chat.v1.IListReactionsResponse|null|undefined, + protos.google.chat.v1.IReaction>): + Promise<[ + protos.google.chat.v1.IReaction[], + protos.google.chat.v1.IListReactionsRequest|null, + protos.google.chat.v1.IListReactionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listReactions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The message users reacted to. + * + * Format: `spaces/{space}/messages/{message}` + * @param {number} [request.pageSize] + * Optional. The maximum number of reactions returned. The service can return + * fewer reactions than this value. If unspecified, the default value is 25. + * The maximum value is 200; values above 200 are changed to 200. + * @param {string} [request.pageToken] + * Optional. (If resuming from a previous query.) + * + * A page token received from a previous list reactions call. Provide this + * to retrieve the subsequent page. + * + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value might lead to unexpected results. + * @param {string} [request.filter] + * Optional. A query filter. + * + * You can filter reactions by + * [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) + * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) + * (`user.name`). + * + * To filter reactions for multiple emojis or users, join similar fields + * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = + * "👍"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. + * + * To filter reactions by emoji and user, use the `AND` operator, such as + * `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. + * + * If your query uses both `AND` and `OR`, group them with parentheses. + * + * For example, the following queries are valid: + * + * ``` + * user.name = "users/{user}" + * emoji.unicode = "🙂" + * emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR emoji.unicode = "👍" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" AND user.name = "users/{user}" + * (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") + * AND user.name = "users/{user}" + * ``` + * + * The following queries are invalid: + * + * ``` + * emoji.unicode = "🙂" AND emoji.unicode = "👍" + * emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR + * user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * AND user.name = "users/{user}" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @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.chat.v1.Reaction|Reaction} 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 `listReactionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listReactionsStream( + request?: protos.google.chat.v1.IListReactionsRequest, + 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['listReactions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReactions.createStream( + this.innerApiCalls.listReactions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listReactions`, 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 message users reacted to. + * + * Format: `spaces/{space}/messages/{message}` + * @param {number} [request.pageSize] + * Optional. The maximum number of reactions returned. The service can return + * fewer reactions than this value. If unspecified, the default value is 25. + * The maximum value is 200; values above 200 are changed to 200. + * @param {string} [request.pageToken] + * Optional. (If resuming from a previous query.) + * + * A page token received from a previous list reactions call. Provide this + * to retrieve the subsequent page. + * + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value might lead to unexpected results. + * @param {string} [request.filter] + * Optional. A query filter. + * + * You can filter reactions by + * [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) + * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) + * (`user.name`). + * + * To filter reactions for multiple emojis or users, join similar fields + * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = + * "👍"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. + * + * To filter reactions by emoji and user, use the `AND` operator, such as + * `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. + * + * If your query uses both `AND` and `OR`, group them with parentheses. + * + * For example, the following queries are valid: + * + * ``` + * user.name = "users/{user}" + * emoji.unicode = "🙂" + * emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR emoji.unicode = "👍" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" AND user.name = "users/{user}" + * (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") + * AND user.name = "users/{user}" + * ``` + * + * The following queries are invalid: + * + * ``` + * emoji.unicode = "🙂" AND emoji.unicode = "👍" + * emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR + * user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * AND user.name = "users/{user}" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @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.chat.v1.Reaction|Reaction}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.list_reactions.js + * region_tag:chat_v1_generated_ChatService_ListReactions_async + */ + listReactionsAsync( + request?: protos.google.chat.v1.IListReactionsRequest, + 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['listReactions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReactions.asyncIterate( + this.innerApiCalls['listReactions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists events from a Google Chat space. For each event, the + * [payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) + * contains the most recent version of the Chat resource. For example, if you + * list events about new space members, the server returns `Membership` + * resources that contain the latest membership details. If new members were + * removed during the requested period, the event payload contains an empty + * `Membership` resource. + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * To list events, the authenticated user must be a member of the space. + * + * For an example, see [List events from a Google Chat + * space](https://developers.google.com/workspace/chat/list-space-events). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the [Google Chat + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + * where the events occurred. + * + * Format: `spaces/{space}`. + * @param {number} request.pageSize + * Optional. The maximum number of space events returned. The service might + * return fewer than this value. + * + * Negative values return an `INVALID_ARGUMENT` error. + * @param {string} request.pageToken + * A page token, received from a previous list space events call. Provide this + * to retrieve the subsequent page. + * + * When paginating, all other parameters provided to list space events must + * match the call that provided the page token. Passing different values to + * the other parameters might lead to unexpected results. + * @param {string} request.filter + * Required. A query filter. + * + * You must specify at least one event type (`event_type`) + * using the has `:` operator. To filter by multiple event types, use the `OR` + * operator. Omit batch event types in your filter. The request automatically + * returns any related batch events. For example, if you filter by new + * reactions + * (`google.workspace.chat.reaction.v1.created`), the server also returns + * batch new reactions events + * (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + * event types, see the [`SpaceEvents` reference + * documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + * + * Optionally, you can also filter by start time (`start_time`) and + * end time (`end_time`): + * + * * `start_time`: Exclusive timestamp from which to start listing space + * events. + * You can list events that occurred up to 28 days ago. If unspecified, lists + * space events from the past 28 days. + * * `end_time`: Inclusive timestamp until which space events are listed. + * If unspecified, lists events up to the time of the request. + * + * To specify a start or end time, use the equals `=` operator and format in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both + * `start_time` and `end_time`, use the `AND` operator. + * + * For example, the following queries are valid: + * + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * (event_types:"google.workspace.chat.space.v1.updated" OR + * event_types:"google.workspace.chat.message.v1.created") + * ``` + * + * The following queries are invalid: + * + * ``` + * start_time="2023-08-23T19:20:33+00:00" OR + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * event_types:"google.workspace.chat.space.v1.updated" AND + * event_types:"google.workspace.chat.message.v1.created" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.chat.v1.SpaceEvent|SpaceEvent}. + * 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 `listSpaceEventsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSpaceEvents( + request?: protos.google.chat.v1.IListSpaceEventsRequest, + options?: CallOptions): + Promise<[ + protos.google.chat.v1.ISpaceEvent[], + protos.google.chat.v1.IListSpaceEventsRequest|null, + protos.google.chat.v1.IListSpaceEventsResponse + ]>; + listSpaceEvents( + request: protos.google.chat.v1.IListSpaceEventsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.chat.v1.IListSpaceEventsRequest, + protos.google.chat.v1.IListSpaceEventsResponse|null|undefined, + protos.google.chat.v1.ISpaceEvent>): void; + listSpaceEvents( + request: protos.google.chat.v1.IListSpaceEventsRequest, + callback: PaginationCallback< + protos.google.chat.v1.IListSpaceEventsRequest, + protos.google.chat.v1.IListSpaceEventsResponse|null|undefined, + protos.google.chat.v1.ISpaceEvent>): void; + listSpaceEvents( + request?: protos.google.chat.v1.IListSpaceEventsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.chat.v1.IListSpaceEventsRequest, + protos.google.chat.v1.IListSpaceEventsResponse|null|undefined, + protos.google.chat.v1.ISpaceEvent>, + callback?: PaginationCallback< + protos.google.chat.v1.IListSpaceEventsRequest, + protos.google.chat.v1.IListSpaceEventsResponse|null|undefined, + protos.google.chat.v1.ISpaceEvent>): + Promise<[ + protos.google.chat.v1.ISpaceEvent[], + protos.google.chat.v1.IListSpaceEventsRequest|null, + protos.google.chat.v1.IListSpaceEventsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSpaceEvents(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the [Google Chat + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + * where the events occurred. + * + * Format: `spaces/{space}`. + * @param {number} request.pageSize + * Optional. The maximum number of space events returned. The service might + * return fewer than this value. + * + * Negative values return an `INVALID_ARGUMENT` error. + * @param {string} request.pageToken + * A page token, received from a previous list space events call. Provide this + * to retrieve the subsequent page. + * + * When paginating, all other parameters provided to list space events must + * match the call that provided the page token. Passing different values to + * the other parameters might lead to unexpected results. + * @param {string} request.filter + * Required. A query filter. + * + * You must specify at least one event type (`event_type`) + * using the has `:` operator. To filter by multiple event types, use the `OR` + * operator. Omit batch event types in your filter. The request automatically + * returns any related batch events. For example, if you filter by new + * reactions + * (`google.workspace.chat.reaction.v1.created`), the server also returns + * batch new reactions events + * (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + * event types, see the [`SpaceEvents` reference + * documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + * + * Optionally, you can also filter by start time (`start_time`) and + * end time (`end_time`): + * + * * `start_time`: Exclusive timestamp from which to start listing space + * events. + * You can list events that occurred up to 28 days ago. If unspecified, lists + * space events from the past 28 days. + * * `end_time`: Inclusive timestamp until which space events are listed. + * If unspecified, lists events up to the time of the request. + * + * To specify a start or end time, use the equals `=` operator and format in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both + * `start_time` and `end_time`, use the `AND` operator. + * + * For example, the following queries are valid: + * + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * (event_types:"google.workspace.chat.space.v1.updated" OR + * event_types:"google.workspace.chat.message.v1.created") + * ``` + * + * The following queries are invalid: + * + * ``` + * start_time="2023-08-23T19:20:33+00:00" OR + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * event_types:"google.workspace.chat.space.v1.updated" AND + * event_types:"google.workspace.chat.message.v1.created" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @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.chat.v1.SpaceEvent|SpaceEvent} 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 `listSpaceEventsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSpaceEventsStream( + request?: protos.google.chat.v1.IListSpaceEventsRequest, + 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['listSpaceEvents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpaceEvents.createStream( + this.innerApiCalls.listSpaceEvents as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSpaceEvents`, 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. Resource name of the [Google Chat + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + * where the events occurred. + * + * Format: `spaces/{space}`. + * @param {number} request.pageSize + * Optional. The maximum number of space events returned. The service might + * return fewer than this value. + * + * Negative values return an `INVALID_ARGUMENT` error. + * @param {string} request.pageToken + * A page token, received from a previous list space events call. Provide this + * to retrieve the subsequent page. + * + * When paginating, all other parameters provided to list space events must + * match the call that provided the page token. Passing different values to + * the other parameters might lead to unexpected results. + * @param {string} request.filter + * Required. A query filter. + * + * You must specify at least one event type (`event_type`) + * using the has `:` operator. To filter by multiple event types, use the `OR` + * operator. Omit batch event types in your filter. The request automatically + * returns any related batch events. For example, if you filter by new + * reactions + * (`google.workspace.chat.reaction.v1.created`), the server also returns + * batch new reactions events + * (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + * event types, see the [`SpaceEvents` reference + * documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + * + * Optionally, you can also filter by start time (`start_time`) and + * end time (`end_time`): + * + * * `start_time`: Exclusive timestamp from which to start listing space + * events. + * You can list events that occurred up to 28 days ago. If unspecified, lists + * space events from the past 28 days. + * * `end_time`: Inclusive timestamp until which space events are listed. + * If unspecified, lists events up to the time of the request. + * + * To specify a start or end time, use the equals `=` operator and format in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both + * `start_time` and `end_time`, use the `AND` operator. + * + * For example, the following queries are valid: + * + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * (event_types:"google.workspace.chat.space.v1.updated" OR + * event_types:"google.workspace.chat.message.v1.created") + * ``` + * + * The following queries are invalid: + * + * ``` + * start_time="2023-08-23T19:20:33+00:00" OR + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * event_types:"google.workspace.chat.space.v1.updated" AND + * event_types:"google.workspace.chat.message.v1.created" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @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.chat.v1.SpaceEvent|SpaceEvent}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.list_space_events.js + * region_tag:chat_v1_generated_ChatService_ListSpaceEvents_async + */ + listSpaceEventsAsync( + request?: protos.google.chat.v1.IListSpaceEventsRequest, + 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['listSpaceEvents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpaceEvents.asyncIterate( + this.innerApiCalls['listSpaceEvents'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified attachment resource name string. + * + * @param {string} space + * @param {string} message + * @param {string} attachment + * @returns {string} Resource name string. + */ + attachmentPath(space:string,message:string,attachment:string) { + return this.pathTemplates.attachmentPathTemplate.render({ + space: space, + message: message, + attachment: attachment, + }); + } + + /** + * Parse the space from Attachment resource. + * + * @param {string} attachmentName + * A fully-qualified path representing Attachment resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromAttachmentName(attachmentName: string) { + return this.pathTemplates.attachmentPathTemplate.match(attachmentName).space; + } + + /** + * Parse the message from Attachment resource. + * + * @param {string} attachmentName + * A fully-qualified path representing Attachment resource. + * @returns {string} A string representing the message. + */ + matchMessageFromAttachmentName(attachmentName: string) { + return this.pathTemplates.attachmentPathTemplate.match(attachmentName).message; + } + + /** + * Parse the attachment from Attachment resource. + * + * @param {string} attachmentName + * A fully-qualified path representing Attachment resource. + * @returns {string} A string representing the attachment. + */ + matchAttachmentFromAttachmentName(attachmentName: string) { + return this.pathTemplates.attachmentPathTemplate.match(attachmentName).attachment; + } + + /** + * Return a fully-qualified membership resource name string. + * + * @param {string} space + * @param {string} member + * @returns {string} Resource name string. + */ + membershipPath(space:string,member:string) { + return this.pathTemplates.membershipPathTemplate.render({ + space: space, + member: member, + }); + } + + /** + * Parse the space from Membership resource. + * + * @param {string} membershipName + * A fully-qualified path representing Membership resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromMembershipName(membershipName: string) { + return this.pathTemplates.membershipPathTemplate.match(membershipName).space; + } + + /** + * Parse the member from Membership resource. + * + * @param {string} membershipName + * A fully-qualified path representing Membership resource. + * @returns {string} A string representing the member. + */ + matchMemberFromMembershipName(membershipName: string) { + return this.pathTemplates.membershipPathTemplate.match(membershipName).member; + } + + /** + * Return a fully-qualified message resource name string. + * + * @param {string} space + * @param {string} message + * @returns {string} Resource name string. + */ + messagePath(space:string,message:string) { + return this.pathTemplates.messagePathTemplate.render({ + space: space, + message: message, + }); + } + + /** + * Parse the space from Message resource. + * + * @param {string} messageName + * A fully-qualified path representing Message resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromMessageName(messageName: string) { + return this.pathTemplates.messagePathTemplate.match(messageName).space; + } + + /** + * Parse the message from Message resource. + * + * @param {string} messageName + * A fully-qualified path representing Message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromMessageName(messageName: string) { + return this.pathTemplates.messagePathTemplate.match(messageName).message; + } + + /** + * Return a fully-qualified quotedMessageMetadata resource name string. + * + * @param {string} space + * @param {string} message + * @param {string} quoted_message_metadata + * @returns {string} Resource name string. + */ + quotedMessageMetadataPath(space:string,message:string,quotedMessageMetadata:string) { + return this.pathTemplates.quotedMessageMetadataPathTemplate.render({ + space: space, + message: message, + quoted_message_metadata: quotedMessageMetadata, + }); + } + + /** + * Parse the space from QuotedMessageMetadata resource. + * + * @param {string} quotedMessageMetadataName + * A fully-qualified path representing QuotedMessageMetadata resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromQuotedMessageMetadataName(quotedMessageMetadataName: string) { + return this.pathTemplates.quotedMessageMetadataPathTemplate.match(quotedMessageMetadataName).space; + } + + /** + * Parse the message from QuotedMessageMetadata resource. + * + * @param {string} quotedMessageMetadataName + * A fully-qualified path representing QuotedMessageMetadata resource. + * @returns {string} A string representing the message. + */ + matchMessageFromQuotedMessageMetadataName(quotedMessageMetadataName: string) { + return this.pathTemplates.quotedMessageMetadataPathTemplate.match(quotedMessageMetadataName).message; + } + + /** + * Parse the quoted_message_metadata from QuotedMessageMetadata resource. + * + * @param {string} quotedMessageMetadataName + * A fully-qualified path representing QuotedMessageMetadata resource. + * @returns {string} A string representing the quoted_message_metadata. + */ + matchQuotedMessageMetadataFromQuotedMessageMetadataName(quotedMessageMetadataName: string) { + return this.pathTemplates.quotedMessageMetadataPathTemplate.match(quotedMessageMetadataName).quoted_message_metadata; + } + + /** + * Return a fully-qualified reaction resource name string. + * + * @param {string} space + * @param {string} message + * @param {string} reaction + * @returns {string} Resource name string. + */ + reactionPath(space:string,message:string,reaction:string) { + return this.pathTemplates.reactionPathTemplate.render({ + space: space, + message: message, + reaction: reaction, + }); + } + + /** + * Parse the space from Reaction resource. + * + * @param {string} reactionName + * A fully-qualified path representing Reaction resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromReactionName(reactionName: string) { + return this.pathTemplates.reactionPathTemplate.match(reactionName).space; + } + + /** + * Parse the message from Reaction resource. + * + * @param {string} reactionName + * A fully-qualified path representing Reaction resource. + * @returns {string} A string representing the message. + */ + matchMessageFromReactionName(reactionName: string) { + return this.pathTemplates.reactionPathTemplate.match(reactionName).message; + } + + /** + * Parse the reaction from Reaction resource. + * + * @param {string} reactionName + * A fully-qualified path representing Reaction resource. + * @returns {string} A string representing the reaction. + */ + matchReactionFromReactionName(reactionName: string) { + return this.pathTemplates.reactionPathTemplate.match(reactionName).reaction; + } + + /** + * Return a fully-qualified space resource name string. + * + * @param {string} space + * @returns {string} Resource name string. + */ + spacePath(space:string) { + return this.pathTemplates.spacePathTemplate.render({ + space: space, + }); + } + + /** + * Parse the space from Space resource. + * + * @param {string} spaceName + * A fully-qualified path representing Space resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromSpaceName(spaceName: string) { + return this.pathTemplates.spacePathTemplate.match(spaceName).space; + } + + /** + * Return a fully-qualified spaceEvent resource name string. + * + * @param {string} space + * @param {string} space_event + * @returns {string} Resource name string. + */ + spaceEventPath(space:string,spaceEvent:string) { + return this.pathTemplates.spaceEventPathTemplate.render({ + space: space, + space_event: spaceEvent, + }); + } + + /** + * Parse the space from SpaceEvent resource. + * + * @param {string} spaceEventName + * A fully-qualified path representing SpaceEvent resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromSpaceEventName(spaceEventName: string) { + return this.pathTemplates.spaceEventPathTemplate.match(spaceEventName).space; + } + + /** + * Parse the space_event from SpaceEvent resource. + * + * @param {string} spaceEventName + * A fully-qualified path representing SpaceEvent resource. + * @returns {string} A string representing the space_event. + */ + matchSpaceEventFromSpaceEventName(spaceEventName: string) { + return this.pathTemplates.spaceEventPathTemplate.match(spaceEventName).space_event; + } + + /** + * Return a fully-qualified spaceReadState resource name string. + * + * @param {string} user + * @param {string} space + * @returns {string} Resource name string. + */ + spaceReadStatePath(user:string,space:string) { + return this.pathTemplates.spaceReadStatePathTemplate.render({ + user: user, + space: space, + }); + } + + /** + * Parse the user from SpaceReadState resource. + * + * @param {string} spaceReadStateName + * A fully-qualified path representing SpaceReadState resource. + * @returns {string} A string representing the user. + */ + matchUserFromSpaceReadStateName(spaceReadStateName: string) { + return this.pathTemplates.spaceReadStatePathTemplate.match(spaceReadStateName).user; + } + + /** + * Parse the space from SpaceReadState resource. + * + * @param {string} spaceReadStateName + * A fully-qualified path representing SpaceReadState resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromSpaceReadStateName(spaceReadStateName: string) { + return this.pathTemplates.spaceReadStatePathTemplate.match(spaceReadStateName).space; + } + + /** + * Return a fully-qualified thread resource name string. + * + * @param {string} space + * @param {string} thread + * @returns {string} Resource name string. + */ + threadPath(space:string,thread:string) { + return this.pathTemplates.threadPathTemplate.render({ + space: space, + thread: thread, + }); + } + + /** + * Parse the space from Thread resource. + * + * @param {string} threadName + * A fully-qualified path representing Thread resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromThreadName(threadName: string) { + return this.pathTemplates.threadPathTemplate.match(threadName).space; + } + + /** + * Parse the thread from Thread resource. + * + * @param {string} threadName + * A fully-qualified path representing Thread resource. + * @returns {string} A string representing the thread. + */ + matchThreadFromThreadName(threadName: string) { + return this.pathTemplates.threadPathTemplate.match(threadName).thread; + } + + /** + * Return a fully-qualified threadReadState resource name string. + * + * @param {string} user + * @param {string} space + * @param {string} thread + * @returns {string} Resource name string. + */ + threadReadStatePath(user:string,space:string,thread:string) { + return this.pathTemplates.threadReadStatePathTemplate.render({ + user: user, + space: space, + thread: thread, + }); + } + + /** + * Parse the user from ThreadReadState resource. + * + * @param {string} threadReadStateName + * A fully-qualified path representing ThreadReadState resource. + * @returns {string} A string representing the user. + */ + matchUserFromThreadReadStateName(threadReadStateName: string) { + return this.pathTemplates.threadReadStatePathTemplate.match(threadReadStateName).user; + } + + /** + * Parse the space from ThreadReadState resource. + * + * @param {string} threadReadStateName + * A fully-qualified path representing ThreadReadState resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromThreadReadStateName(threadReadStateName: string) { + return this.pathTemplates.threadReadStatePathTemplate.match(threadReadStateName).space; + } + + /** + * Parse the thread from ThreadReadState resource. + * + * @param {string} threadReadStateName + * A fully-qualified path representing ThreadReadState resource. + * @returns {string} A string representing the thread. + */ + matchThreadFromThreadReadStateName(threadReadStateName: string) { + return this.pathTemplates.threadReadStatePathTemplate.match(threadReadStateName).thread; + } + + /** + * 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.chatServiceStub && !this._terminated) { + return this.chatServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-chat/v1/src/v1/chat_service_client_config.json b/owl-bot-staging/google-chat/v1/src/v1/chat_service_client_config.json new file mode 100644 index 00000000000..86bbee997a4 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/src/v1/chat_service_client_config.json @@ -0,0 +1,183 @@ +{ + "interfaces": { + "google.chat.v1.ChatService": { + "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": { + "CreateMessage": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListMessages": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListMemberships": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetMembership": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetMessage": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateMessage": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteMessage": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetAttachment": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UploadAttachment": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListSpaces": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "SearchSpaces": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetSpace": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateSpace": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "SetUpSpace": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateSpace": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteSpace": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CompleteImportSpace": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "FindDirectMessage": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateMembership": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateMembership": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteMembership": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateReaction": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListReactions": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteReaction": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetSpaceReadState": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateSpaceReadState": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetThreadReadState": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetSpaceEvent": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListSpaceEvents": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-chat/v1/src/v1/chat_service_proto_list.json b/owl-bot-staging/google-chat/v1/src/v1/chat_service_proto_list.json new file mode 100644 index 00000000000..c35b8d12652 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/src/v1/chat_service_proto_list.json @@ -0,0 +1,24 @@ +[ + "../../protos/google/apps/card/v1/card.proto", + "../../protos/google/chat/v1/action_status.proto", + "../../protos/google/chat/v1/annotation.proto", + "../../protos/google/chat/v1/attachment.proto", + "../../protos/google/chat/v1/chat_service.proto", + "../../protos/google/chat/v1/contextual_addon.proto", + "../../protos/google/chat/v1/deletion_metadata.proto", + "../../protos/google/chat/v1/event_payload.proto", + "../../protos/google/chat/v1/group.proto", + "../../protos/google/chat/v1/history_state.proto", + "../../protos/google/chat/v1/matched_url.proto", + "../../protos/google/chat/v1/membership.proto", + "../../protos/google/chat/v1/message.proto", + "../../protos/google/chat/v1/reaction.proto", + "../../protos/google/chat/v1/slash_command.proto", + "../../protos/google/chat/v1/space.proto", + "../../protos/google/chat/v1/space_event.proto", + "../../protos/google/chat/v1/space_read_state.proto", + "../../protos/google/chat/v1/space_setup.proto", + "../../protos/google/chat/v1/thread_read_state.proto", + "../../protos/google/chat/v1/user.proto", + "../../protos/google/chat/v1/widgets.proto" +] diff --git a/owl-bot-staging/google-chat/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-chat/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..b4b2079f5b7 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/src/v1/gapic_metadata.json @@ -0,0 +1,337 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.chat.v1", + "libraryPackage": "@google-apps/chat", + "services": { + "ChatService": { + "clients": { + "grpc": { + "libraryClient": "ChatServiceClient", + "rpcs": { + "CreateMessage": { + "methods": [ + "createMessage" + ] + }, + "GetMembership": { + "methods": [ + "getMembership" + ] + }, + "GetMessage": { + "methods": [ + "getMessage" + ] + }, + "UpdateMessage": { + "methods": [ + "updateMessage" + ] + }, + "DeleteMessage": { + "methods": [ + "deleteMessage" + ] + }, + "GetAttachment": { + "methods": [ + "getAttachment" + ] + }, + "UploadAttachment": { + "methods": [ + "uploadAttachment" + ] + }, + "GetSpace": { + "methods": [ + "getSpace" + ] + }, + "CreateSpace": { + "methods": [ + "createSpace" + ] + }, + "SetUpSpace": { + "methods": [ + "setUpSpace" + ] + }, + "UpdateSpace": { + "methods": [ + "updateSpace" + ] + }, + "DeleteSpace": { + "methods": [ + "deleteSpace" + ] + }, + "CompleteImportSpace": { + "methods": [ + "completeImportSpace" + ] + }, + "FindDirectMessage": { + "methods": [ + "findDirectMessage" + ] + }, + "CreateMembership": { + "methods": [ + "createMembership" + ] + }, + "UpdateMembership": { + "methods": [ + "updateMembership" + ] + }, + "DeleteMembership": { + "methods": [ + "deleteMembership" + ] + }, + "CreateReaction": { + "methods": [ + "createReaction" + ] + }, + "DeleteReaction": { + "methods": [ + "deleteReaction" + ] + }, + "GetSpaceReadState": { + "methods": [ + "getSpaceReadState" + ] + }, + "UpdateSpaceReadState": { + "methods": [ + "updateSpaceReadState" + ] + }, + "GetThreadReadState": { + "methods": [ + "getThreadReadState" + ] + }, + "GetSpaceEvent": { + "methods": [ + "getSpaceEvent" + ] + }, + "ListMessages": { + "methods": [ + "listMessages", + "listMessagesStream", + "listMessagesAsync" + ] + }, + "ListMemberships": { + "methods": [ + "listMemberships", + "listMembershipsStream", + "listMembershipsAsync" + ] + }, + "ListSpaces": { + "methods": [ + "listSpaces", + "listSpacesStream", + "listSpacesAsync" + ] + }, + "SearchSpaces": { + "methods": [ + "searchSpaces", + "searchSpacesStream", + "searchSpacesAsync" + ] + }, + "ListReactions": { + "methods": [ + "listReactions", + "listReactionsStream", + "listReactionsAsync" + ] + }, + "ListSpaceEvents": { + "methods": [ + "listSpaceEvents", + "listSpaceEventsStream", + "listSpaceEventsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ChatServiceClient", + "rpcs": { + "CreateMessage": { + "methods": [ + "createMessage" + ] + }, + "GetMembership": { + "methods": [ + "getMembership" + ] + }, + "GetMessage": { + "methods": [ + "getMessage" + ] + }, + "UpdateMessage": { + "methods": [ + "updateMessage" + ] + }, + "DeleteMessage": { + "methods": [ + "deleteMessage" + ] + }, + "GetAttachment": { + "methods": [ + "getAttachment" + ] + }, + "UploadAttachment": { + "methods": [ + "uploadAttachment" + ] + }, + "GetSpace": { + "methods": [ + "getSpace" + ] + }, + "CreateSpace": { + "methods": [ + "createSpace" + ] + }, + "SetUpSpace": { + "methods": [ + "setUpSpace" + ] + }, + "UpdateSpace": { + "methods": [ + "updateSpace" + ] + }, + "DeleteSpace": { + "methods": [ + "deleteSpace" + ] + }, + "CompleteImportSpace": { + "methods": [ + "completeImportSpace" + ] + }, + "FindDirectMessage": { + "methods": [ + "findDirectMessage" + ] + }, + "CreateMembership": { + "methods": [ + "createMembership" + ] + }, + "UpdateMembership": { + "methods": [ + "updateMembership" + ] + }, + "DeleteMembership": { + "methods": [ + "deleteMembership" + ] + }, + "CreateReaction": { + "methods": [ + "createReaction" + ] + }, + "DeleteReaction": { + "methods": [ + "deleteReaction" + ] + }, + "GetSpaceReadState": { + "methods": [ + "getSpaceReadState" + ] + }, + "UpdateSpaceReadState": { + "methods": [ + "updateSpaceReadState" + ] + }, + "GetThreadReadState": { + "methods": [ + "getThreadReadState" + ] + }, + "GetSpaceEvent": { + "methods": [ + "getSpaceEvent" + ] + }, + "ListMessages": { + "methods": [ + "listMessages", + "listMessagesStream", + "listMessagesAsync" + ] + }, + "ListMemberships": { + "methods": [ + "listMemberships", + "listMembershipsStream", + "listMembershipsAsync" + ] + }, + "ListSpaces": { + "methods": [ + "listSpaces", + "listSpacesStream", + "listSpacesAsync" + ] + }, + "SearchSpaces": { + "methods": [ + "searchSpaces", + "searchSpacesStream", + "searchSpacesAsync" + ] + }, + "ListReactions": { + "methods": [ + "listReactions", + "listReactionsStream", + "listReactionsAsync" + ] + }, + "ListSpaceEvents": { + "methods": [ + "listSpaceEvents", + "listSpaceEventsStream", + "listSpaceEventsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-chat/v1/src/v1/index.ts b/owl-bot-staging/google-chat/v1/src/v1/index.ts new file mode 100644 index 00000000000..9b6fabacc4e --- /dev/null +++ b/owl-bot-staging/google-chat/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {ChatServiceClient} from './chat_service_client'; diff --git a/owl-bot-staging/google-chat/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-chat/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..91d92831f8b --- /dev/null +++ b/owl-bot-staging/google-chat/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const chat = require('@google-apps/chat'); + +function main() { + const chatServiceClient = new chat.ChatServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-chat/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-chat/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..a81f217c209 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {ChatServiceClient} from '@google-apps/chat'; + +// check that the client class type name can be used +function doStuffWithChatServiceClient(client: ChatServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const chatServiceClient = new ChatServiceClient(); + doStuffWithChatServiceClient(chatServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-chat/v1/system-test/install.ts b/owl-bot-staging/google-chat/v1/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-chat/v1/test/gapic_chat_service_v1.ts b/owl-bot-staging/google-chat/v1/test/gapic_chat_service_v1.ts new file mode 100644 index 00000000000..1ebba6aad31 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/test/gapic_chat_service_v1.ts @@ -0,0 +1,4399 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 chatserviceModule 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('v1.ChatServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new chatserviceModule.v1.ChatServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'chat.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new chatserviceModule.v1.ChatServiceClient(); + 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 = chatserviceModule.v1.ChatServiceClient.servicePath; + assert.strictEqual(servicePath, 'chat.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = chatserviceModule.v1.ChatServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'chat.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new chatserviceModule.v1.ChatServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'chat.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new chatserviceModule.v1.ChatServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'chat.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 chatserviceModule.v1.ChatServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'chat.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 chatserviceModule.v1.ChatServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'chat.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 chatserviceModule.v1.ChatServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = chatserviceModule.v1.ChatServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new chatserviceModule.v1.ChatServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.chatServiceStub, undefined); + await client.initialize(); + assert(client.chatServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.chatServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.chatServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new chatserviceModule.v1.ChatServiceClient({ + 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 chatserviceModule.v1.ChatServiceClient({ + 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('createMessage', () => { + it('invokes createMessage without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CreateMessageRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Message() + ); + client.innerApiCalls.createMessage = stubSimpleCall(expectedResponse); + const [response] = await client.createMessage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMessage without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CreateMessageRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Message() + ); + client.innerApiCalls.createMessage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMessage( + request, + (err?: Error|null, result?: protos.google.chat.v1.IMessage|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMessage with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CreateMessageRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMessage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createMessage(request), expectedError); + const actualRequest = (client.innerApiCalls.createMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMessage with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CreateMessageRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createMessage(request), expectedError); + }); + }); + + describe('getMembership', () => { + it('invokes getMembership without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetMembershipRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetMembershipRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Membership() + ); + client.innerApiCalls.getMembership = stubSimpleCall(expectedResponse); + const [response] = await client.getMembership(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMembership as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMembership as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMembership without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetMembershipRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetMembershipRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Membership() + ); + client.innerApiCalls.getMembership = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMembership( + request, + (err?: Error|null, result?: protos.google.chat.v1.IMembership|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMembership as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMembership as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMembership with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetMembershipRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetMembershipRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMembership = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMembership(request), expectedError); + const actualRequest = (client.innerApiCalls.getMembership as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMembership as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMembership with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetMembershipRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetMembershipRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMembership(request), expectedError); + }); + }); + + describe('getMessage', () => { + it('invokes getMessage without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetMessageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Message() + ); + client.innerApiCalls.getMessage = stubSimpleCall(expectedResponse); + const [response] = await client.getMessage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMessage without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetMessageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Message() + ); + client.innerApiCalls.getMessage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMessage( + request, + (err?: Error|null, result?: protos.google.chat.v1.IMessage|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMessage with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetMessageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMessage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMessage(request), expectedError); + const actualRequest = (client.innerApiCalls.getMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMessage with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetMessageRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMessage(request), expectedError); + }); + }); + + describe('updateMessage', () => { + it('invokes updateMessage without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateMessageRequest() + ); + request.message ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateMessageRequest', ['message', 'name']); + request.message.name = defaultValue1; + const expectedHeaderRequestParams = `message.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Message() + ); + client.innerApiCalls.updateMessage = stubSimpleCall(expectedResponse); + const [response] = await client.updateMessage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMessage without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateMessageRequest() + ); + request.message ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateMessageRequest', ['message', 'name']); + request.message.name = defaultValue1; + const expectedHeaderRequestParams = `message.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Message() + ); + client.innerApiCalls.updateMessage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMessage( + request, + (err?: Error|null, result?: protos.google.chat.v1.IMessage|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMessage with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateMessageRequest() + ); + request.message ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateMessageRequest', ['message', 'name']); + request.message.name = defaultValue1; + const expectedHeaderRequestParams = `message.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMessage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateMessage(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMessage with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateMessageRequest() + ); + request.message ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateMessageRequest', ['message', 'name']); + request.message.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateMessage(request), expectedError); + }); + }); + + describe('deleteMessage', () => { + it('invokes deleteMessage without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteMessageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteMessage = stubSimpleCall(expectedResponse); + const [response] = await client.deleteMessage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMessage without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteMessageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteMessage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMessage( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMessage with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteMessageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMessage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteMessage(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMessage with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteMessageRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteMessage(request), expectedError); + }); + }); + + describe('getAttachment', () => { + it('invokes getAttachment without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.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 chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Attachment() + ); + client.innerApiCalls.getAttachment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAttachment( + request, + (err?: Error|null, result?: protos.google.chat.v1.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 chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.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 chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAttachment(request), expectedError); + }); + }); + + describe('uploadAttachment', () => { + it('invokes uploadAttachment without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UploadAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UploadAttachmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.UploadAttachmentResponse() + ); + client.innerApiCalls.uploadAttachment = stubSimpleCall(expectedResponse); + const [response] = await client.uploadAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.uploadAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes uploadAttachment without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UploadAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UploadAttachmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.UploadAttachmentResponse() + ); + client.innerApiCalls.uploadAttachment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.uploadAttachment( + request, + (err?: Error|null, result?: protos.google.chat.v1.IUploadAttachmentResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.uploadAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes uploadAttachment with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UploadAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UploadAttachmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.uploadAttachment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.uploadAttachment(request), expectedError); + const actualRequest = (client.innerApiCalls.uploadAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes uploadAttachment with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UploadAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UploadAttachmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.uploadAttachment(request), expectedError); + }); + }); + + describe('getSpace', () => { + it('invokes getSpace without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetSpaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Space() + ); + client.innerApiCalls.getSpace = stubSimpleCall(expectedResponse); + const [response] = await client.getSpace(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpace without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetSpaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Space() + ); + client.innerApiCalls.getSpace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSpace( + request, + (err?: Error|null, result?: protos.google.chat.v1.ISpace|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpace with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetSpaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSpace(request), expectedError); + const actualRequest = (client.innerApiCalls.getSpace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpace with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetSpaceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpace(request), expectedError); + }); + }); + + describe('createSpace', () => { + it('invokes createSpace without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateSpaceRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Space() + ); + client.innerApiCalls.createSpace = stubSimpleCall(expectedResponse); + const [response] = await client.createSpace(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createSpace without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateSpaceRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Space() + ); + client.innerApiCalls.createSpace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSpace( + request, + (err?: Error|null, result?: protos.google.chat.v1.ISpace|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createSpace with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateSpaceRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createSpace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSpace(request), expectedError); + }); + + it('invokes createSpace with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateSpaceRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSpace(request), expectedError); + }); + }); + + describe('setUpSpace', () => { + it('invokes setUpSpace without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.SetUpSpaceRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Space() + ); + client.innerApiCalls.setUpSpace = stubSimpleCall(expectedResponse); + const [response] = await client.setUpSpace(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes setUpSpace without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.SetUpSpaceRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Space() + ); + client.innerApiCalls.setUpSpace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setUpSpace( + request, + (err?: Error|null, result?: protos.google.chat.v1.ISpace|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes setUpSpace with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.SetUpSpaceRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.setUpSpace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setUpSpace(request), expectedError); + }); + + it('invokes setUpSpace with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.SetUpSpaceRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setUpSpace(request), expectedError); + }); + }); + + describe('updateSpace', () => { + it('invokes updateSpace without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateSpaceRequest() + ); + request.space ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateSpaceRequest', ['space', 'name']); + request.space.name = defaultValue1; + const expectedHeaderRequestParams = `space.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Space() + ); + client.innerApiCalls.updateSpace = stubSimpleCall(expectedResponse); + const [response] = await client.updateSpace(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSpace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpace without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateSpaceRequest() + ); + request.space ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateSpaceRequest', ['space', 'name']); + request.space.name = defaultValue1; + const expectedHeaderRequestParams = `space.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Space() + ); + client.innerApiCalls.updateSpace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSpace( + request, + (err?: Error|null, result?: protos.google.chat.v1.ISpace|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSpace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpace with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateSpaceRequest() + ); + request.space ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateSpaceRequest', ['space', 'name']); + request.space.name = defaultValue1; + const expectedHeaderRequestParams = `space.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSpace(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSpace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpace with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateSpaceRequest() + ); + request.space ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateSpaceRequest', ['space', 'name']); + request.space.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSpace(request), expectedError); + }); + }); + + describe('deleteSpace', () => { + it('invokes deleteSpace without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteSpaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteSpaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSpace = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSpace(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSpace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpace without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteSpaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteSpaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSpace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSpace( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSpace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpace with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteSpaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteSpaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSpace(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSpace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpace with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteSpaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteSpaceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSpace(request), expectedError); + }); + }); + + describe('completeImportSpace', () => { + it('invokes completeImportSpace without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CompleteImportSpaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CompleteImportSpaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.CompleteImportSpaceResponse() + ); + client.innerApiCalls.completeImportSpace = stubSimpleCall(expectedResponse); + const [response] = await client.completeImportSpace(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeImportSpace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeImportSpace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeImportSpace without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CompleteImportSpaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CompleteImportSpaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.CompleteImportSpaceResponse() + ); + client.innerApiCalls.completeImportSpace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeImportSpace( + request, + (err?: Error|null, result?: protos.google.chat.v1.ICompleteImportSpaceResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.completeImportSpace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeImportSpace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeImportSpace with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CompleteImportSpaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CompleteImportSpaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeImportSpace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeImportSpace(request), expectedError); + const actualRequest = (client.innerApiCalls.completeImportSpace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeImportSpace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeImportSpace with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CompleteImportSpaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CompleteImportSpaceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeImportSpace(request), expectedError); + }); + }); + + describe('findDirectMessage', () => { + it('invokes findDirectMessage without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.FindDirectMessageRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Space() + ); + client.innerApiCalls.findDirectMessage = stubSimpleCall(expectedResponse); + const [response] = await client.findDirectMessage(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes findDirectMessage without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.FindDirectMessageRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Space() + ); + client.innerApiCalls.findDirectMessage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.findDirectMessage( + request, + (err?: Error|null, result?: protos.google.chat.v1.ISpace|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes findDirectMessage with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.FindDirectMessageRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.findDirectMessage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.findDirectMessage(request), expectedError); + }); + + it('invokes findDirectMessage with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.FindDirectMessageRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.findDirectMessage(request), expectedError); + }); + }); + + describe('createMembership', () => { + it('invokes createMembership without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateMembershipRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CreateMembershipRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Membership() + ); + client.innerApiCalls.createMembership = stubSimpleCall(expectedResponse); + const [response] = await client.createMembership(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMembership as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMembership as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMembership without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateMembershipRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CreateMembershipRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Membership() + ); + client.innerApiCalls.createMembership = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMembership( + request, + (err?: Error|null, result?: protos.google.chat.v1.IMembership|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMembership as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMembership as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMembership with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateMembershipRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CreateMembershipRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMembership = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createMembership(request), expectedError); + const actualRequest = (client.innerApiCalls.createMembership as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMembership as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMembership with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateMembershipRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CreateMembershipRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createMembership(request), expectedError); + }); + }); + + describe('updateMembership', () => { + it('invokes updateMembership without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateMembershipRequest() + ); + request.membership ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateMembershipRequest', ['membership', 'name']); + request.membership.name = defaultValue1; + const expectedHeaderRequestParams = `membership.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Membership() + ); + client.innerApiCalls.updateMembership = stubSimpleCall(expectedResponse); + const [response] = await client.updateMembership(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMembership as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMembership as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMembership without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateMembershipRequest() + ); + request.membership ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateMembershipRequest', ['membership', 'name']); + request.membership.name = defaultValue1; + const expectedHeaderRequestParams = `membership.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Membership() + ); + client.innerApiCalls.updateMembership = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMembership( + request, + (err?: Error|null, result?: protos.google.chat.v1.IMembership|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMembership as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMembership as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMembership with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateMembershipRequest() + ); + request.membership ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateMembershipRequest', ['membership', 'name']); + request.membership.name = defaultValue1; + const expectedHeaderRequestParams = `membership.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMembership = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateMembership(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMembership as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMembership as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMembership with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateMembershipRequest() + ); + request.membership ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateMembershipRequest', ['membership', 'name']); + request.membership.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateMembership(request), expectedError); + }); + }); + + describe('deleteMembership', () => { + it('invokes deleteMembership without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteMembershipRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteMembershipRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Membership() + ); + client.innerApiCalls.deleteMembership = stubSimpleCall(expectedResponse); + const [response] = await client.deleteMembership(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMembership as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMembership as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMembership without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteMembershipRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteMembershipRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Membership() + ); + client.innerApiCalls.deleteMembership = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMembership( + request, + (err?: Error|null, result?: protos.google.chat.v1.IMembership|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMembership as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMembership as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMembership with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteMembershipRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteMembershipRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMembership = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteMembership(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteMembership as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMembership as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMembership with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteMembershipRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteMembershipRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteMembership(request), expectedError); + }); + }); + + describe('createReaction', () => { + it('invokes createReaction without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateReactionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CreateReactionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Reaction() + ); + client.innerApiCalls.createReaction = stubSimpleCall(expectedResponse); + const [response] = await client.createReaction(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createReaction as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createReaction as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createReaction without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateReactionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CreateReactionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.Reaction() + ); + client.innerApiCalls.createReaction = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createReaction( + request, + (err?: Error|null, result?: protos.google.chat.v1.IReaction|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createReaction as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createReaction as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createReaction with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateReactionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CreateReactionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createReaction = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createReaction(request), expectedError); + const actualRequest = (client.innerApiCalls.createReaction as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createReaction as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createReaction with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.CreateReactionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.CreateReactionRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createReaction(request), expectedError); + }); + }); + + describe('deleteReaction', () => { + it('invokes deleteReaction without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteReactionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteReactionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteReaction = stubSimpleCall(expectedResponse); + const [response] = await client.deleteReaction(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteReaction as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteReaction as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteReaction without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteReactionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteReactionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteReaction = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteReaction( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteReaction as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteReaction as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteReaction with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteReactionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteReactionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteReaction = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteReaction(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteReaction as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteReaction as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteReaction with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.DeleteReactionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.DeleteReactionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteReaction(request), expectedError); + }); + }); + + describe('getSpaceReadState', () => { + it('invokes getSpaceReadState without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceReadStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetSpaceReadStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.SpaceReadState() + ); + client.innerApiCalls.getSpaceReadState = stubSimpleCall(expectedResponse); + const [response] = await client.getSpaceReadState(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpaceReadState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpaceReadState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpaceReadState without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceReadStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetSpaceReadStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.SpaceReadState() + ); + client.innerApiCalls.getSpaceReadState = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSpaceReadState( + request, + (err?: Error|null, result?: protos.google.chat.v1.ISpaceReadState|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpaceReadState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpaceReadState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpaceReadState with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceReadStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetSpaceReadStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpaceReadState = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSpaceReadState(request), expectedError); + const actualRequest = (client.innerApiCalls.getSpaceReadState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpaceReadState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpaceReadState with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceReadStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetSpaceReadStateRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpaceReadState(request), expectedError); + }); + }); + + describe('updateSpaceReadState', () => { + it('invokes updateSpaceReadState without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateSpaceReadStateRequest() + ); + request.spaceReadState ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateSpaceReadStateRequest', ['spaceReadState', 'name']); + request.spaceReadState.name = defaultValue1; + const expectedHeaderRequestParams = `space_read_state.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.SpaceReadState() + ); + client.innerApiCalls.updateSpaceReadState = stubSimpleCall(expectedResponse); + const [response] = await client.updateSpaceReadState(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSpaceReadState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpaceReadState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpaceReadState without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateSpaceReadStateRequest() + ); + request.spaceReadState ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateSpaceReadStateRequest', ['spaceReadState', 'name']); + request.spaceReadState.name = defaultValue1; + const expectedHeaderRequestParams = `space_read_state.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.SpaceReadState() + ); + client.innerApiCalls.updateSpaceReadState = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSpaceReadState( + request, + (err?: Error|null, result?: protos.google.chat.v1.ISpaceReadState|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSpaceReadState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpaceReadState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpaceReadState with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateSpaceReadStateRequest() + ); + request.spaceReadState ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateSpaceReadStateRequest', ['spaceReadState', 'name']); + request.spaceReadState.name = defaultValue1; + const expectedHeaderRequestParams = `space_read_state.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpaceReadState = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSpaceReadState(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSpaceReadState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpaceReadState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpaceReadState with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateSpaceReadStateRequest() + ); + request.spaceReadState ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.UpdateSpaceReadStateRequest', ['spaceReadState', 'name']); + request.spaceReadState.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSpaceReadState(request), expectedError); + }); + }); + + describe('getThreadReadState', () => { + it('invokes getThreadReadState without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetThreadReadStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetThreadReadStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.ThreadReadState() + ); + client.innerApiCalls.getThreadReadState = stubSimpleCall(expectedResponse); + const [response] = await client.getThreadReadState(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getThreadReadState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getThreadReadState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getThreadReadState without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetThreadReadStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetThreadReadStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.ThreadReadState() + ); + client.innerApiCalls.getThreadReadState = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getThreadReadState( + request, + (err?: Error|null, result?: protos.google.chat.v1.IThreadReadState|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getThreadReadState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getThreadReadState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getThreadReadState with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetThreadReadStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetThreadReadStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getThreadReadState = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getThreadReadState(request), expectedError); + const actualRequest = (client.innerApiCalls.getThreadReadState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getThreadReadState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getThreadReadState with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetThreadReadStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetThreadReadStateRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getThreadReadState(request), expectedError); + }); + }); + + describe('getSpaceEvent', () => { + it('invokes getSpaceEvent without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetSpaceEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.SpaceEvent() + ); + client.innerApiCalls.getSpaceEvent = stubSimpleCall(expectedResponse); + const [response] = await client.getSpaceEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpaceEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpaceEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpaceEvent without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetSpaceEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.SpaceEvent() + ); + client.innerApiCalls.getSpaceEvent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSpaceEvent( + request, + (err?: Error|null, result?: protos.google.chat.v1.ISpaceEvent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpaceEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpaceEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpaceEvent with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetSpaceEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpaceEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSpaceEvent(request), expectedError); + const actualRequest = (client.innerApiCalls.getSpaceEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpaceEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpaceEvent with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.GetSpaceEventRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpaceEvent(request), expectedError); + }); + }); + + describe('listMessages', () => { + it('invokes listMessages without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMessagesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMessagesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Message()), + generateSampleMessage(new protos.google.chat.v1.Message()), + generateSampleMessage(new protos.google.chat.v1.Message()), + ]; + client.innerApiCalls.listMessages = stubSimpleCall(expectedResponse); + const [response] = await client.listMessages(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMessages as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMessages as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMessages without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMessagesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMessagesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Message()), + generateSampleMessage(new protos.google.chat.v1.Message()), + generateSampleMessage(new protos.google.chat.v1.Message()), + ]; + client.innerApiCalls.listMessages = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMessages( + request, + (err?: Error|null, result?: protos.google.chat.v1.IMessage[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMessages as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMessages as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMessages with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMessagesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMessagesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMessages = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMessages(request), expectedError); + const actualRequest = (client.innerApiCalls.listMessages as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMessages as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMessagesStream without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMessagesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMessagesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Message()), + generateSampleMessage(new protos.google.chat.v1.Message()), + generateSampleMessage(new protos.google.chat.v1.Message()), + ]; + client.descriptors.page.listMessages.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMessagesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.chat.v1.Message[] = []; + stream.on('data', (response: protos.google.chat.v1.Message) => { + 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.listMessages.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMessages, request)); + assert( + (client.descriptors.page.listMessages.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMessagesStream with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMessagesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMessagesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMessages.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listMessagesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.chat.v1.Message[] = []; + stream.on('data', (response: protos.google.chat.v1.Message) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMessages.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMessages, request)); + assert( + (client.descriptors.page.listMessages.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMessages without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMessagesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMessagesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Message()), + generateSampleMessage(new protos.google.chat.v1.Message()), + generateSampleMessage(new protos.google.chat.v1.Message()), + ]; + client.descriptors.page.listMessages.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.chat.v1.IMessage[] = []; + const iterable = client.listMessagesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMessages.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMessages.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMessages with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMessagesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMessagesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMessages.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMessagesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.chat.v1.IMessage[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMessages.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMessages.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listMemberships', () => { + it('invokes listMemberships without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMembershipsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMembershipsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Membership()), + generateSampleMessage(new protos.google.chat.v1.Membership()), + generateSampleMessage(new protos.google.chat.v1.Membership()), + ]; + client.innerApiCalls.listMemberships = stubSimpleCall(expectedResponse); + const [response] = await client.listMemberships(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMemberships as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMemberships as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMemberships without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMembershipsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMembershipsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Membership()), + generateSampleMessage(new protos.google.chat.v1.Membership()), + generateSampleMessage(new protos.google.chat.v1.Membership()), + ]; + client.innerApiCalls.listMemberships = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMemberships( + request, + (err?: Error|null, result?: protos.google.chat.v1.IMembership[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMemberships as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMemberships as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMemberships with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMembershipsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMembershipsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMemberships = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMemberships(request), expectedError); + const actualRequest = (client.innerApiCalls.listMemberships as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMemberships as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMembershipsStream without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMembershipsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMembershipsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Membership()), + generateSampleMessage(new protos.google.chat.v1.Membership()), + generateSampleMessage(new protos.google.chat.v1.Membership()), + ]; + client.descriptors.page.listMemberships.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMembershipsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.chat.v1.Membership[] = []; + stream.on('data', (response: protos.google.chat.v1.Membership) => { + 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.listMemberships.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMemberships, request)); + assert( + (client.descriptors.page.listMemberships.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMembershipsStream with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMembershipsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMembershipsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMemberships.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listMembershipsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.chat.v1.Membership[] = []; + stream.on('data', (response: protos.google.chat.v1.Membership) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMemberships.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMemberships, request)); + assert( + (client.descriptors.page.listMemberships.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMemberships without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMembershipsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMembershipsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Membership()), + generateSampleMessage(new protos.google.chat.v1.Membership()), + generateSampleMessage(new protos.google.chat.v1.Membership()), + ]; + client.descriptors.page.listMemberships.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.chat.v1.IMembership[] = []; + const iterable = client.listMembershipsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMemberships.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMemberships.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMemberships with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListMembershipsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListMembershipsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMemberships.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMembershipsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.chat.v1.IMembership[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMemberships.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMemberships.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSpaces', () => { + it('invokes listSpaces without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpacesRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + ]; + client.innerApiCalls.listSpaces = stubSimpleCall(expectedResponse); + const [response] = await client.listSpaces(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listSpaces without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpacesRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + ]; + client.innerApiCalls.listSpaces = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSpaces( + request, + (err?: Error|null, result?: protos.google.chat.v1.ISpace[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listSpaces with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpacesRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listSpaces = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSpaces(request), expectedError); + }); + + it('invokes listSpacesStream without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpacesRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + ]; + client.descriptors.page.listSpaces.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSpacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.chat.v1.Space[] = []; + stream.on('data', (response: protos.google.chat.v1.Space) => { + 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.listSpaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSpaces, request)); + }); + + it('invokes listSpacesStream with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpacesRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listSpaces.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSpacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.chat.v1.Space[] = []; + stream.on('data', (response: protos.google.chat.v1.Space) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSpaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSpaces, request)); + }); + + it('uses async iteration with listSpaces without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpacesRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + ]; + client.descriptors.page.listSpaces.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.chat.v1.ISpace[] = []; + const iterable = client.listSpacesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSpaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + + it('uses async iteration with listSpaces with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpacesRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listSpaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSpacesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.chat.v1.ISpace[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSpaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('searchSpaces', () => { + it('invokes searchSpaces without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.SearchSpacesRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + ]; + client.innerApiCalls.searchSpaces = stubSimpleCall(expectedResponse); + const [response] = await client.searchSpaces(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchSpaces without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.SearchSpacesRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + ]; + client.innerApiCalls.searchSpaces = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchSpaces( + request, + (err?: Error|null, result?: protos.google.chat.v1.ISpace[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchSpaces with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.SearchSpacesRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.searchSpaces = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchSpaces(request), expectedError); + }); + + it('invokes searchSpacesStream without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.SearchSpacesRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + ]; + client.descriptors.page.searchSpaces.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchSpacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.chat.v1.Space[] = []; + stream.on('data', (response: protos.google.chat.v1.Space) => { + 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.searchSpaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchSpaces, request)); + }); + + it('invokes searchSpacesStream with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.SearchSpacesRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchSpaces.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchSpacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.chat.v1.Space[] = []; + stream.on('data', (response: protos.google.chat.v1.Space) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchSpaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchSpaces, request)); + }); + + it('uses async iteration with searchSpaces without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.SearchSpacesRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + generateSampleMessage(new protos.google.chat.v1.Space()), + ]; + client.descriptors.page.searchSpaces.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.chat.v1.ISpace[] = []; + const iterable = client.searchSpacesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchSpaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + + it('uses async iteration with searchSpaces with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.SearchSpacesRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchSpaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchSpacesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.chat.v1.ISpace[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchSpaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('listReactions', () => { + it('invokes listReactions without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListReactionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListReactionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Reaction()), + generateSampleMessage(new protos.google.chat.v1.Reaction()), + generateSampleMessage(new protos.google.chat.v1.Reaction()), + ]; + client.innerApiCalls.listReactions = stubSimpleCall(expectedResponse); + const [response] = await client.listReactions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listReactions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listReactions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReactions without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListReactionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListReactionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Reaction()), + generateSampleMessage(new protos.google.chat.v1.Reaction()), + generateSampleMessage(new protos.google.chat.v1.Reaction()), + ]; + client.innerApiCalls.listReactions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listReactions( + request, + (err?: Error|null, result?: protos.google.chat.v1.IReaction[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listReactions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listReactions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReactions with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListReactionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListReactionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listReactions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listReactions(request), expectedError); + const actualRequest = (client.innerApiCalls.listReactions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listReactions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReactionsStream without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListReactionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListReactionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Reaction()), + generateSampleMessage(new protos.google.chat.v1.Reaction()), + generateSampleMessage(new protos.google.chat.v1.Reaction()), + ]; + client.descriptors.page.listReactions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listReactionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.chat.v1.Reaction[] = []; + stream.on('data', (response: protos.google.chat.v1.Reaction) => { + 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.listReactions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listReactions, request)); + assert( + (client.descriptors.page.listReactions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listReactionsStream with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListReactionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListReactionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReactions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listReactionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.chat.v1.Reaction[] = []; + stream.on('data', (response: protos.google.chat.v1.Reaction) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listReactions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listReactions, request)); + assert( + (client.descriptors.page.listReactions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listReactions without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListReactionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListReactionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.Reaction()), + generateSampleMessage(new protos.google.chat.v1.Reaction()), + generateSampleMessage(new protos.google.chat.v1.Reaction()), + ]; + client.descriptors.page.listReactions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.chat.v1.IReaction[] = []; + const iterable = client.listReactionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listReactions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listReactions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listReactions with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListReactionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListReactionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReactions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listReactionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.chat.v1.IReaction[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listReactions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listReactions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSpaceEvents', () => { + it('invokes listSpaceEvents without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpaceEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListSpaceEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), + generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), + generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), + ]; + client.innerApiCalls.listSpaceEvents = stubSimpleCall(expectedResponse); + const [response] = await client.listSpaceEvents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSpaceEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpaceEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpaceEvents without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpaceEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListSpaceEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), + generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), + generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), + ]; + client.innerApiCalls.listSpaceEvents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSpaceEvents( + request, + (err?: Error|null, result?: protos.google.chat.v1.ISpaceEvent[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSpaceEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpaceEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpaceEvents with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpaceEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListSpaceEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSpaceEvents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSpaceEvents(request), expectedError); + const actualRequest = (client.innerApiCalls.listSpaceEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpaceEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpaceEventsStream without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpaceEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListSpaceEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), + generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), + generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), + ]; + client.descriptors.page.listSpaceEvents.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSpaceEventsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.chat.v1.SpaceEvent[] = []; + stream.on('data', (response: protos.google.chat.v1.SpaceEvent) => { + 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.listSpaceEvents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSpaceEvents, request)); + assert( + (client.descriptors.page.listSpaceEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSpaceEventsStream with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpaceEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListSpaceEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSpaceEvents.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSpaceEventsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.chat.v1.SpaceEvent[] = []; + stream.on('data', (response: protos.google.chat.v1.SpaceEvent) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSpaceEvents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSpaceEvents, request)); + assert( + (client.descriptors.page.listSpaceEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSpaceEvents without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpaceEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListSpaceEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), + generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), + generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), + ]; + client.descriptors.page.listSpaceEvents.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.chat.v1.ISpaceEvent[] = []; + const iterable = client.listSpaceEventsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSpaceEvents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSpaceEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSpaceEvents with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.ListSpaceEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.chat.v1.ListSpaceEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSpaceEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSpaceEventsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.chat.v1.ISpaceEvent[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSpaceEvents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSpaceEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('attachment', () => { + const fakePath = "/rendered/path/attachment"; + const expectedParameters = { + space: "spaceValue", + message: "messageValue", + attachment: "attachmentValue", + }; + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attachmentPath', () => { + const result = client.attachmentPath("spaceValue", "messageValue", "attachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchSpaceFromAttachmentName', () => { + const result = client.matchSpaceFromAttachmentName(fakePath); + assert.strictEqual(result, "spaceValue"); + assert((client.pathTemplates.attachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMessageFromAttachmentName', () => { + const result = client.matchMessageFromAttachmentName(fakePath); + assert.strictEqual(result, "messageValue"); + assert((client.pathTemplates.attachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttachmentFromAttachmentName', () => { + const result = client.matchAttachmentFromAttachmentName(fakePath); + assert.strictEqual(result, "attachmentValue"); + assert((client.pathTemplates.attachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('membership', () => { + const fakePath = "/rendered/path/membership"; + const expectedParameters = { + space: "spaceValue", + member: "memberValue", + }; + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.membershipPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.membershipPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('membershipPath', () => { + const result = client.membershipPath("spaceValue", "memberValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.membershipPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchSpaceFromMembershipName', () => { + const result = client.matchSpaceFromMembershipName(fakePath); + assert.strictEqual(result, "spaceValue"); + assert((client.pathTemplates.membershipPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMemberFromMembershipName', () => { + const result = client.matchMemberFromMembershipName(fakePath); + assert.strictEqual(result, "memberValue"); + assert((client.pathTemplates.membershipPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('message', () => { + const fakePath = "/rendered/path/message"; + const expectedParameters = { + space: "spaceValue", + message: "messageValue", + }; + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.messagePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.messagePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('messagePath', () => { + const result = client.messagePath("spaceValue", "messageValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.messagePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchSpaceFromMessageName', () => { + const result = client.matchSpaceFromMessageName(fakePath); + assert.strictEqual(result, "spaceValue"); + assert((client.pathTemplates.messagePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMessageFromMessageName', () => { + const result = client.matchMessageFromMessageName(fakePath); + assert.strictEqual(result, "messageValue"); + assert((client.pathTemplates.messagePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('quotedMessageMetadata', () => { + const fakePath = "/rendered/path/quotedMessageMetadata"; + const expectedParameters = { + space: "spaceValue", + message: "messageValue", + quoted_message_metadata: "quotedMessageMetadataValue", + }; + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.quotedMessageMetadataPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.quotedMessageMetadataPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('quotedMessageMetadataPath', () => { + const result = client.quotedMessageMetadataPath("spaceValue", "messageValue", "quotedMessageMetadataValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.quotedMessageMetadataPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchSpaceFromQuotedMessageMetadataName', () => { + const result = client.matchSpaceFromQuotedMessageMetadataName(fakePath); + assert.strictEqual(result, "spaceValue"); + assert((client.pathTemplates.quotedMessageMetadataPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMessageFromQuotedMessageMetadataName', () => { + const result = client.matchMessageFromQuotedMessageMetadataName(fakePath); + assert.strictEqual(result, "messageValue"); + assert((client.pathTemplates.quotedMessageMetadataPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchQuotedMessageMetadataFromQuotedMessageMetadataName', () => { + const result = client.matchQuotedMessageMetadataFromQuotedMessageMetadataName(fakePath); + assert.strictEqual(result, "quotedMessageMetadataValue"); + assert((client.pathTemplates.quotedMessageMetadataPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('reaction', () => { + const fakePath = "/rendered/path/reaction"; + const expectedParameters = { + space: "spaceValue", + message: "messageValue", + reaction: "reactionValue", + }; + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reactionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.reactionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('reactionPath', () => { + const result = client.reactionPath("spaceValue", "messageValue", "reactionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.reactionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchSpaceFromReactionName', () => { + const result = client.matchSpaceFromReactionName(fakePath); + assert.strictEqual(result, "spaceValue"); + assert((client.pathTemplates.reactionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMessageFromReactionName', () => { + const result = client.matchMessageFromReactionName(fakePath); + assert.strictEqual(result, "messageValue"); + assert((client.pathTemplates.reactionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchReactionFromReactionName', () => { + const result = client.matchReactionFromReactionName(fakePath); + assert.strictEqual(result, "reactionValue"); + assert((client.pathTemplates.reactionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('space', () => { + const fakePath = "/rendered/path/space"; + const expectedParameters = { + space: "spaceValue", + }; + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.spacePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.spacePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('spacePath', () => { + const result = client.spacePath("spaceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.spacePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchSpaceFromSpaceName', () => { + const result = client.matchSpaceFromSpaceName(fakePath); + assert.strictEqual(result, "spaceValue"); + assert((client.pathTemplates.spacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spaceEvent', () => { + const fakePath = "/rendered/path/spaceEvent"; + const expectedParameters = { + space: "spaceValue", + space_event: "spaceEventValue", + }; + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.spaceEventPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.spaceEventPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('spaceEventPath', () => { + const result = client.spaceEventPath("spaceValue", "spaceEventValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.spaceEventPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchSpaceFromSpaceEventName', () => { + const result = client.matchSpaceFromSpaceEventName(fakePath); + assert.strictEqual(result, "spaceValue"); + assert((client.pathTemplates.spaceEventPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpaceEventFromSpaceEventName', () => { + const result = client.matchSpaceEventFromSpaceEventName(fakePath); + assert.strictEqual(result, "spaceEventValue"); + assert((client.pathTemplates.spaceEventPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spaceReadState', () => { + const fakePath = "/rendered/path/spaceReadState"; + const expectedParameters = { + user: "userValue", + space: "spaceValue", + }; + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.spaceReadStatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.spaceReadStatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('spaceReadStatePath', () => { + const result = client.spaceReadStatePath("userValue", "spaceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.spaceReadStatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchUserFromSpaceReadStateName', () => { + const result = client.matchUserFromSpaceReadStateName(fakePath); + assert.strictEqual(result, "userValue"); + assert((client.pathTemplates.spaceReadStatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpaceFromSpaceReadStateName', () => { + const result = client.matchSpaceFromSpaceReadStateName(fakePath); + assert.strictEqual(result, "spaceValue"); + assert((client.pathTemplates.spaceReadStatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('thread', () => { + const fakePath = "/rendered/path/thread"; + const expectedParameters = { + space: "spaceValue", + thread: "threadValue", + }; + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.threadPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.threadPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('threadPath', () => { + const result = client.threadPath("spaceValue", "threadValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.threadPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchSpaceFromThreadName', () => { + const result = client.matchSpaceFromThreadName(fakePath); + assert.strictEqual(result, "spaceValue"); + assert((client.pathTemplates.threadPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchThreadFromThreadName', () => { + const result = client.matchThreadFromThreadName(fakePath); + assert.strictEqual(result, "threadValue"); + assert((client.pathTemplates.threadPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('threadReadState', () => { + const fakePath = "/rendered/path/threadReadState"; + const expectedParameters = { + user: "userValue", + space: "spaceValue", + thread: "threadValue", + }; + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.threadReadStatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.threadReadStatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('threadReadStatePath', () => { + const result = client.threadReadStatePath("userValue", "spaceValue", "threadValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.threadReadStatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchUserFromThreadReadStateName', () => { + const result = client.matchUserFromThreadReadStateName(fakePath); + assert.strictEqual(result, "userValue"); + assert((client.pathTemplates.threadReadStatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpaceFromThreadReadStateName', () => { + const result = client.matchSpaceFromThreadReadStateName(fakePath); + assert.strictEqual(result, "spaceValue"); + assert((client.pathTemplates.threadReadStatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchThreadFromThreadReadStateName', () => { + const result = client.matchThreadFromThreadReadStateName(fakePath); + assert.strictEqual(result, "threadValue"); + assert((client.pathTemplates.threadReadStatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-chat/v1/tsconfig.json b/owl-bot-staging/google-chat/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-chat/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-chat/v1/webpack.config.js b/owl-bot-staging/google-chat/v1/webpack.config.js new file mode 100644 index 00000000000..fec747251c3 --- /dev/null +++ b/owl-bot-staging/google-chat/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'ChatService', + filename: './chat-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', +};